WordPress.org

Ready to get started?Download WordPress

Forums

Automatically add all new users to all sites on network as subscribers. (17 posts)

  1. bradenunruh
    Member
    Posted 4 years ago #

    How can I automatically add all new users to all sites on network as subscribers. Also, If anyone knows how to get the plugin subscribe2 to automatically subscribe all new users to all sites on the network?

    Thanks.
    -Braden

  2. Douglas Bell
    Member
    Posted 4 years ago #

    New users are already automatically added as subscribers to one of your sites, which you specify in your Network Options page (listed as Options under the Super Admin menu in your admin). However all of those users already have permissions equivalent to subscribers on all of the other sites, even though they aren't necessarily listed as such. (In short, they can view sites, leave comments on sites, and edit their own profile.)

    I don't off the top of my head know of a plugin that allows users to be auto-assigned permissions across the entire network, but if you simply want to assign Subscriber permissions to everyone, it's not entirely necessary to do so, since it doesn't give them any more privileges than they already have.

  3. bradenunruh
    Member
    Posted 4 years ago #

    That's what I thought, but the issue I'm running into is that If a user logs into a site other than the main site and goes to the dashboard, it redirects them to the main site dashboard. They need to go to the dashboard for the non-main site to subscribe with the subscribe2 plugin.

  4. thenbrent
    Member
    Posted 4 years ago #

    Hi Braden, I've just written a plugin which allocates newly registered users a role for each site. Rather than allocating a subscriber role, it lets the super admin specify a default role for each site. For something I'm doing, I wanted new users to receive the Author role for one site, Contributor for another and Subscriber for the rest.

    It's not in wordpress.org plugin directory yet, I have to wait till my application is approved. But if you'd like to test it, send me an email to my username as show on the left at gmail.com and I'll give you a download link.

  5. bradenunruh
    Member
    Posted 4 years ago #

    That sounds perfect! I'll shoot you an e-mail!

  6. thenbrent
    Member
    Posted 4 years ago #

    For anyone else wanting to automatically add new users to each of their sites, the plugin is now in the WordPress plugin directory: Multisite User Management.

  7. Checkin' it out now... ;)

  8. agreda
    Member
    Posted 4 years ago #

    webmacster87 said:

    New users are already automatically added as subscribers to one of your sites, which you specify in your Network Options page...

    So, WP 3.0 will allow you to automatically add all new users as a subscriber to the main blog? If so, why would one need the User Management plugin suggested by thenbrent?

    We're still running WPMU 2.92 and preparing to upgrade. I was searching these forums to see if anyone might have feedback regarding this discussion about how to add all new users to main blog in the old MU forums.

    To add all new users as subscribers to our main blog, we currently use this "new user" custom plugin as directed in that topic:

    function ds_new_user_meta($blog_id, $user_id) {
    add_user_to_blog('1', $user_id, 'subscriber' );
    }
    add_action( 'wpmu_new_blog', 'ds_new_user_meta', 10, 2 );

    Can someone please confirm if this would be 3.0 compatible or if it is no longer necessary?

    Thank you!

  9. They are pseudo-subscribers. They can be logged in to comment, but in some cases will not show up as "attached" to the main blog.

    And this is an issue if you're using other plugins, mostly, especially if they pull a list of all subscribers.

    Also, if a user gets their own blog, they are de-attached (by default) from the main blog. they still have that pseudo-subscribers access tho.

    Codee looks fine to me, can;t see why it wouldn't work. Best to wait & see if dsader chimes in. (yay for initialed function names!)

  10. David Sader
    Member
    Posted 4 years ago #

    I haven't tested that particular code with WP3.0 per se, but I've used the wpmu_new_blog hook and can verify that it is still does its thang.

  11. agreda
    Member
    Posted 4 years ago #

    Thanks! We'll give it a shot since we do need to "attach" the users to our main blog for instant access to our SimplePress discussion forums.

  12. agreda
    Member
    Posted 4 years ago #

    Anyone have any idea how this might affect add_user_to_blog if at all?

    wp_insert_user in 3.0 is not backwards compatible
    http://core.trac.wordpress.org/ticket/14308

  13. David Sader
    Member
    Posted 4 years ago #

    Dunno, never used wp_insert_user

    But I've used add_user_to_blog recently in WP3 and it works fine. Keep in mind, the code you pasted above hooks when a new blog is created.

    Hooking the "wpmu_new_user" may be better in your case if the new user chooses not to create a blog on signup:

    function ds_new_user_meta_2($user_id) {
    add_user_to_blog('1', $user_id, 'subscriber');
    }
    add_action( 'wpmu_new_user', 'ds_new_user_meta_2');
  14. agreda
    Member
    Posted 4 years ago #

    @dsader Thanks for the suggestion, but for whatever reason, the script as is functions perfectly for us — all new users, with or without a blog, are getting added to blog 1 as subscribers. Since it ain't broke I won't be fixing it. ;-)

    Off Topic: How is it going with Toggle Admin Menus for WP 3.0? Anywhere I can subscribe for an update about that?

  15. David Sader
    Member
    Posted 4 years ago #

  16. Derek Fox
    Member
    Posted 3 years ago #

    For anyone else wanting to automatically add new users to each of their sites, the plugin is now in the WordPress plugin directory: Multisite User Management.

    @thenbrent thank you so much for creating this plug in because it is amazing ... just what I was looking for. I am working on creating a WordPress Webmaster Academy (http://wordpresswebmasteracademy.com) and using network blogs to create different courses. i am using s2members and buddypress with network ... very crazy if you ask me. But I was having an issue with someone signing up and then not getting the right role on the other blogs so this helped a ton.

    you saved my life! lol

    thanks
    Derek

  17. Please see this page about the use of the trademark "WordPress" in top-level domain names.

    http://wordpress.org/about/domains/

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.