Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I wanted to add an action on when a user activated the blog through standard signup process, all my custom meta on the registration will be inserted on my modified wp_blogs table.

Here is my code for the custom signup meta.

add_filter( 'add_signup_meta', 'custom_add_signup_meta' );

function custom_add_signup_meta ( $blogmeta = array() ) {

        $the_country = $_POST['country-origin'];
        $d_currency = $_POST['user_currency'];
        $d_zone = $_POST['state-origin'];

        $blogmeta['countries_id'] = $the_country;
        $blogmeta['default_currency'] = $d_currency;
        $blogmeta['zone_id'] = $d_zone;

    return $blogmeta;

}

Now I want to hook the function below somewhere applicable which has arguments of $blog_id and my custom meta $blogmeta

function insert_custom_datas1($blog_id, $blogmeta) {
        global $wpdb;
        $wp_blogs = $wpdb->base_prefix . "blogs";

        $wpdb->query("UPDATE `" . $wp_blogs . "` SET `countries_id`='".$wpdb->escape($blogmeta['countries_id'])."', `default_currency`='".$wpdb->escape($blogmeta['default_currency'])."', `zone_id`='".$wpdb->escape($blogmeta['zone_id'])."' where `blog_id` = '" . (int)$blog_id . "'");

}

Please help in accomplishing this.

share|improve this question
add comment

1 Answer

up vote 0 down vote accepted

I think this is what you're looking for:

add_action('wpmu_new_blog', 'insert_custom_datas1', 10, 6);
function insert_custom_datas1($blog_id, $user_id, $domain, $path, $site_id, $blogmeta) {
    // Your code here
}

Let us know how it goes?

share|improve this answer
    
Thanks. I'll try this up and get back to you. –  Ken Jul 24 '12 at 21:12
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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