Update current user's primary blog after creating a blog in wordpress multisite
-
I wanted to update the current user’s primary blog to the blog created after blog signup on wp-signup.php form. So that the current user’s primary blog is set to the blog he had created.
I tried this but its not working,
add_action('wpmu_new_blog','update_primary_blog',10); function update_primary_blog() { global $wpdb; update_user_meta( get_current_user_id(), 'primary_blog', $wpdb->insert_id ); }
Is there another way to do it?
- The topic ‘Update current user's primary blog after creating a blog in wordpress multisite’ is closed to new replies.