WordPress.org

Ready to get started?Download WordPress

Forums

How to let registered users have access to all sites in MU? (6 posts)

  1. lilblogger
    Member
    Posted 3 years ago #

    I have a classifieds WordPress website that has city specific sites (e.g. domain.com/seattle, domain.com/newyork).

    Once someone registers at domain.com/seattle, I want them to be able to also post on domain.com/newyork without having to re-register for domain.com/newyork.

    How do I do this?

  2. They don't have to re-register to post comments on all sub sites. Do you want tthem to be able to post comments, or actual blog posts?

  3. lilblogger
    Member
    Posted 3 years ago #

    Blog posts

  4. Then you'll have to register them as author on every site when they sign up.

    I know dsader left a script in here somewhere.... :D

  5. David Sader
    Member
    Posted 3 years ago #

    In here or the wpmu forums from a while ago:

    http://wordpress.org/support/topic/automatically-add-all-new-users-to-all-sites-on-network-as-subscribers?replies=15

    http://wordpress.org/support/topic/add-new-user-to-all-blogs?replies=1

    http://mu.wordpress.org/forums/topic/9913

    Anyway, something like this works on my test server with only a handful of blogs:

    <?php
    function ds_add_new_user_to_all_blogs($user_id) {
      global $wpdb;
      $blog_list = $wpdb->get_results("SELECT blog_id FROM " . $wpdb->blogs);
      foreach ($blog_list as $blog) {
        add_user_to_blog($blog->blog_id, $user_id, 'author');
      }
    }
    add_action( 'wpmu_new_user', 'ds_add_new_user_to_all_blogs' );
    ?>

    This adds user as author to all other blogs, while user gets admin role on his "gimme site" from signup.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.