• Starting a new topic as requested…

    It is my understanding that all new registered users under WP 3.1 MS are automatically assigned Subscriber status to blog ID 1, but this clearly does not seem to be the case (at least for us at tripawds.com) as they are not being listed under Site Admin as a user of the main site. The exception, however, is that new users who also create a blog/site are being assigned subscriber status to blog id 1. Those who create no site, are not.

    Now, we have been using the following in mu-plugins to automatically assign all new users main blog Subscriber status:

    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 );

    It’s been working like a charm, until our 3.1 upgrade. Since then, only users who create a site are being added to the main site.

    So… My questions include:

    • Should all new users (with or without a bblog) appear as subscribers under the primary site admin / users?
    • Could this “new-user” plugin be keeping WP from doing its job?
    • Any suggested tweaks for getting this plugin working again under WP 3.1?

    Many thanks to all for any input.

    I did look into macbis’ Multisite User Management plugi, however, it appears to assign users to all sites, and we only want to add new users to site id 1. FYI: They need to be registered members of site id 1 where our SimplePress forums reside.

Viewing 15 replies - 1 through 15 (of 42 total)
  • Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Okay. Looking at that real fast

    wpmu_new_blog specifies the creation of new BLOGS.

    So. Maybe try using user_register instead? Something that calls user registration, basically. Maybe user activation…

    wpmu_new_blog specifies the creation of new BLOGS.

    Good catch. ?? Yes, this is why it’s only doing it on new blog creation and not new *user* creation.

    wpmu_new_user is the one you need.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Ah, there you are then ?? I call user_register for another plugin. Wasn’t sure what you’d want for this one ??

    Thread Starter agreda

    (@agreda)

    As usual, y’all rock. And now for the proverbial, however…

    Changing wpmu_new_blog to wpmu_new_user results in the following error on the activation page:

    Warning: Missing argument 2 for ds_new_user_meta() in /home/triblogs/public_html/wp-content/mu-plugins/new_user.php on line 3

    Here is line 3:
    function ds_new_user_meta($blog_id, $user_id) {

    Interesting aside: Just confirmed using wpmu_new_blog does not throw the error.

    Using user_register results in the same error. What am I missing here? Should there be a $thing that indicates user level after that $user_id thing? Or am I obviously just clueless?

    Thanks again!

    Hi agreda – thenbrent has just done an update to his great plug-in to fix the non-registration on the main/blog ID 1 site:

    https://www.ads-software.com/support/topic/plugin-multisite-user-management-update-for-31

    I can’t speak for him, but I’m sure this will be pushed out as an update for the main plug-in shortly.

    I’m a little confused why this pseudo subscriber role is created for network sites as it creates quite a few problems, especially as general plug-ins tend to refer to users by role, not by capabilities… I’ve had to add hack/add ‘can_edit’ statements to adjust content for these ‘ghost users’ who don’t appear to belong to any blog…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    wpmu_new_user makes a different call… I think it’s this?

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

    That’s a WAG, mind you.

    Thread Starter agreda

    (@agreda)

    @ipstenu Thanks, but that’s the code that threw the error in my last post.

    And forgive me, but it must not be my week for deciphering obvious acronyms… WAG?

    @squidgemonstr Thanks, I’ll check that out.

    I too am at a loss about the whole “pseudo” thing – why not just make them subscribers, or don’t.

    Any ideas how we might get dsader (the ds in ds_new_user_meta, i believe) to take a look at this?

    it must not be my week for deciphering obvious acronyms… WAG?

    wild-ass guess. ;P

    I too am at a loss about the whole “pseudo” thing – why not just make them subscribers, or don’t.

    because you don’t want someone physically attached to all blogs and show up in each blog’s users menu.

    this way, their “pseudo”-ness allows them to use the “must be logged in to comment” but doesn’t give them any kind of dashboard access on every single blog in the network.

    Thread Starter agreda

    (@agreda)

    @andrea thanks for the clarification. Makes sense for all blogs, I just feel the should be “real” users of site 1, perhaps via a superadmin option… or maybe I’m just being selfish since that’s what I’m trying to get working again with this script that stopped working after upgrading to 3.1.

    FYI: They need to be registered members of site id 1 where our SimplePress forums reside.

    Yeah, you/we/someone needs to find the right code snippet to manually make sure all users are physically added to blog 1.

    And I just notcied you said SITE ID 1.

    no.

    You want BLOG ID 1.

    Thread Starter agreda

    (@agreda)

    [sigh] I thought since wp rolled in mu, “Blogs are now called Sites; Site is now called Network.”

    Thanks again for the help! Hoping someone else might be able to shed some light on the answer…

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    Yes, on the front end site == blog

    On the BACK end … Um. Chimera is the word that comes to mind right now.

    How ’bout ‘dis?

    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');

    How are you getting on agreda?

    The change WP 3.1 has caused all manner of issues with the ‘subscriber access’ vs actual ‘subscriber’ for the network, group, family(?!) of sites. I have to say that the plug-in I referenced fixed all the issues though as you can assign default user subscription levels to each blog/site(?!) which in turn will make them appear in the site admin for each site you’d like ??

    I do think you’re right in asking if there is reason in WordPress’s madness for creating the psudo role to make it more flexible for the way that people might use multi-site set-ups… but I can’t see one.

    Anyway, hope you’re making progress.

    Moderator Ipstenu (Mika Epstein)

    (@ipstenu)

    ?????? Advisor and Activist

    squidgemonster – There is a reason. I suspect what you meant is not ‘I can’t see one’ and really is ‘I can’t see why they thought that reason was good enough.’ ??

    As Andrea said, in this thread

    because you don’t want someone physically attached to all blogs and show up in each blog’s users menu.

    And that, validly, has a point.

    www.ads-software.com Multisite now behaves like WordPress.com. You sign up for a blog but unless you get assigned a role to the blog, you’re not a ‘member’ of the blog. And you know… that’s sensible. You have no real role as a psudeo-subscriber. nor do you need on.

    https://core.trac.www.ads-software.com/ticket/14696

    Part of the goal with moving the menus to Network Admin is that the whole ‘Dashboard Blog’ concept was a massive annoyance to everyone code-wise and UI wise. Having to say “Oh yeah, the main site is the master site AND it’s where I control the universe” is logistically unsound. Much like you cannot in-line edit posts, you should not be mixing up Admin and User areas.

Viewing 15 replies - 1 through 15 (of 42 total)
  • The topic ‘Adding All New Users to Main Site’ is closed to new replies.