0

Following along with the answer posted here,

How to add Custom Blog Options to new blog setup form?

I am attempting to understand why the custom meta is added to the options table for the blog as long as I do not let the update_blog_option() run. I added echos and an exit() before that function to be sure the values were correct, and it populated the correct value in the options table. But when I remove the exit() and let it run through, it does NOT populate.

The code in question is,

add_action('wpmu_new_blog', 'process_extra_field_on_blog_signup', 10, 6);
function process_extra_field_on_blog_signup($blog_id, $user_id, $domain, $path, $site_id,     $meta) {
update_blog_option($blog_id, 'extra_field', $meta['extra_field']);
}

Additionally, what exactly does the table wp_signups do? Is it a temporary holding location for signups until activated? And does that data get passed to the blog once activated? In which case, the meta that is stored there would get passed anyway right?

The code used to add the custom meta is,

add_filter('add_signup_meta', 'append_extra_field_as_meta');
function append_extra_field_as_meta($meta) {
if(isset($_REQUEST['extra_field'])) {
    $meta['extra_field'] = $_REQUEST['extra_field'];
}
return $meta;
}

And that is getting stored proper in the wp_signups table.

Thank you for your help.

1 Answer 1

0

I had this same problem and I found that the blogtemplates plugin was deleting my options after I updated them. You may have a similar situation.

I fixed my case by making my wpmu_new_blog hook execute after blog templates.

    // blogtemplates executes at 9999, go last at 10000
    add_action('wpmu_new_blog', 'process_extra_field_on_blog_signup', 10000, 6);

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.