Update current user's primary blog after creating a blog in wordpress multisite (1 post)

  1. chibib0
    Posted 3 years ago #

    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,

        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?

Topic Closed

This topic has been closed to new replies.

About this Topic