Support » Networking WordPress » Multisite Users Help

  • Hey,

    I’m trying to setup a WordPress multisite network with two sites: Primary and Support.

    I have Restricted Registration on Support and open registration on primary.

    Now, Here’s the problem:

    I want all my Support users to be a part of ‘Primary’ website. They can access all the areas and their profile will sync automatically etc.

    But I don’t want my Primary users to access Support website.

    If I enable registration, then it adds the user to Global “pool” of users and they can access the support website without any problem.

    Any idea how to resolve the problem?

    Thanks!

Viewing 3 replies - 1 through 3 (of 3 total)
  • In a Network there is only one location for the wp-signup.php (all links to Register i.e. /wp-login.php?action=register redirect to it). NetworkAdmin controls signups at one location /wp-admin/network/settings.php

    Registration to a network of sites will allow all users that are logged in to pass the “is_user_logged_in” check. The “global pool” is what it is. Can’t change that. Network users are network users while logged in. So your Support site’s Discussion Settings (“Users must be registered and logged in to comment”) won’t restrict anyone but non-logged in visitors.

    https://developer.wordpress.org/reference/functions/is_user_logged_in/

    So, to restrict visibility on a “members only” support site you will need to use a function such as “is_user_member_of_blog” instead to wrap protected content. If you put a wrapper around certain parts of a theme file, only members will see that part of the page.

    if ( is_user_member_of_blog() ) {
        /*
        * The user is a member of this blog.
        * We could do stuff here, like show them a link, etc.
        */
    }

    https://developer.wordpress.org/reference/functions/is_user_member_of_blog/

    I offer my own plugin as an example, since I somewhat do what you are after:
    https://wordpress.org/plugins/more-privacy-options/

    Get users into the “members only pool” of the Support site and assign a role in the usual WordPress methods under the Support site’s “Dashboard->Users” menu.

    This should get you most of the way to what you are after, I figure.

    Hey,

    Thanks for the help.

    Is there any other way? what if I install wordpress into separate MYSQL table (avoid Multisite) and use foreign keys to link them.

    noobiestrikesagain

    (@noobiestrikesagain)

    Hey,

    Can anyone suggest me if using

    define('CUSTOM_USER_TABLE', 'wp_users');
    define('CUSTOM_USERMETA_TABLE', 'wp_usermeta');

    will do the trick for above problem?

    Thanks in advance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Multisite Users Help’ is closed to new replies.