The MU forums have moved to WordPress.org

How to automatically add ALL new users to main blog? (36 posts)

  1. agreda
    Member
    Posted 13 years ago #

    i want to hide some option of new blog’s users dashboard…

    FYI: We use the Toggle Admin Menus Sitewide WPMU Plugin to do just that.

  2. andrea_r
    Moderator
    Posted 13 years ago #

    Can you link directly to a plugin download?

  3. agreda
    Member
    Posted 13 years ago #

  4. r-a-y
    Member
    Posted 13 years ago #

    This thread was just what I was looking for!

    DeannaS' WPMU Default User Role plugin combined with dsader's Power Tools snippet will probably do what I need.

  5. camyden
    Member
    Posted 13 years ago #

    I'm having a related issue.. want to add all current users to any blogs the admin creates in the future.. I'm using this to add new users to all existing blogs.. and it's working great.

    <?php
    add_action('wpmu_new_user', 'reg_user_as_contributor');
    
    function reg_user_as_contributor($user_id){
    $blog_array = get_blogs_of_user(1);
    foreach($blog_array as $admin_blog){
    add_user_to_blog( $admin_blog->userblog_id, $user_id, 'contributor' );
    }
    }
    ?>
  6. psycolor
    Member
    Posted 13 years ago #

    hi guys, this thread is very interesting! i'm trying to achieve something similar, but having trouble to figure out what's the best way to do this.

    for testing, i migrated a single-blog wp to the new WP3 beta2 and added mu functionalities with buddypress. all seems to work fine.

    what I would like to do is to selectively add users to the new blogs. by default all users are members of the core blog (id1).
    adding users to each blog, can be done from each blog settings page by typing one user at a time (if you know their user names!)

    i'm not sure if this was the same for the previous version of MU, but
    it is definitely a fiddly job with many users!
    can anyone suggest a function to to be used combined with the WPMU powertool earlier to update the wp_bp_user_blogs table to mass edit the users belonging to a specific blog?
    the table has an id, user_id and blog_id.

    in principle i could just manually update the table via phpmyadmin or something similar, but i'm trying to learn how to code plugins, therefore any suggestion will be very much appreciated to help! (i'm actually very surprised that nobody has thought about implementing an extension to the user table to allow selecting available blog?!

    thanks!

About this Topic