Use is_user_member_of_blog()
to check if the current user has been assigned to the blog in wp-admin/network/site-users.php
. Then hook into template_redirect
and run the test:
add_action( 'template_redirect', function() {
if ( ! is_user_member_of_blog() )
die( 'Please ask the network administrator to get access to this blog.' );
});
Related Posts:
- Troubleshooting a “You do not have sufficient permissions to access this page” error
- WordPress Multisite Layered Admins
- access the plugins for each role in WordPress multisite
- Give users acces to admin a single post or set up WP network?
- Allow member to have access to custom post type only. Permission to only edit their own posts
- Where are available Roles Defined in the wp_ database?
- Why are my roles not visible in a Multi-site/Network?
- Site admin in a network install can’t edit users?
- How to Control user registrations directly on sub-sites
- Issue with Custom Roles in Multisite
- How to enable a site administrator to edit users in a WordPress network/ multisite setup?
- How can I display all Multisite blogs where this user is administrator?
- Add role across network in multisite
- Possible to make custom role in multisite that can add sites?
- Prevent user creating new users with specific roles
- Can you have multi-site WP and keep users separate?
- Restrict the user access in multi site for non-assigned blogs
- Multisite Independent User Base
- How To Remove Dashboard Menu Items for Multisite Users?
- How to get a user role of a specific blog in multisite?
- Can wp-cli display all users and their roles across all sites in a multisite instance?
- Can simple Admin save options in a Multisite?
- Identical members roles on all sites in a multisite
- How can I get multisite primary blog (url or path) for current user?
- Can I create users that have access to *some* other users posts instead of all other users posts?
- Set default page for user account in admin
- WPMU – new users are automatically subscribed to the main blog – how to prevent that?
- How can I have different groups of editors only allowed to edit certain parent+subpages?
- WordPress Multisite prevent direct access to subdomain
- create_users capabilities on a role on multisite
- Within the database, where is the flag which says that a user has Super Admin rights?
- Update User Role Across Network when Main Site User is Updated
- Assign role to user on first login, if they are first (after admin)
- Avoid having infinite loops
- Managing Users and Creating Groups [closed]
- Get the User ID Who Owns a Given Blog ID in Multisite
- Create custom role, multisite, add users/sites?
- Make a user administrator to a sub directory site and a contributor to main site in multisite network
- wordpress editor role remove all but ‘menus’ in appearance menu
- How to change user starting role in WordPress MultiSite?
- Allow Author on Site A capability to upload files on Site B in Multi Site
- How to protect post attachments related to a custom post type, from non-logged in users, on 1 subsite of a multisite installation?
- Multisite registration problem [closed]
- Good way to block users within a multisite setup without deleting them?
- Subsite access without being a member of the subsite in wp multisite network
- Multisite user roles – capabilities not working
- Create Custom Multisite User Role to Reduce Capabilities
- Restrict Capability of Administrator to Create, Edit and Delete Pages in Multisite
- Multi-Site Subfolder User Permission Issue
- Admin permission for creating blogs in multisite
- Limit a user to have access to only specified pages?
- Add access control origin header information across multisite
- Remove superadmin role from the “change role to” menu in user listing
- Copy user role on multisite so the user can access subsites with same role
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- How to change a user role after registering in multisite?
- How to sync roles across Multisite?
- Multisite network admin – User’s role not showing up
- WordPress Multisite Add User
- You need to login with a user that has edit posts capacity?
- WordPress multisite, allow non super admins to create sites
- Disable site visiting and user logins excepting for a specific user
- Hiding media uploaded by other users in wordpress multisite?
- WPMU If MU site has no administrator, deactivate site
- Common user login for two different wordpress installation and bbpress
- How to check main site user level from subsite in a multisite network
- can’t create user without email for an author after converting single site to multisite
- Easily adding multiple existing users to a multisite site
- Language per user role, how can I achieve this?
- Admin users not able to see network menus
- How to hold posts and accounts for moderation on WordPress Network site
- let user select roles in the wordpress subsites
- Redirect a user roll to a page after login in mutlisite network
- User Roles in multisite – odd behavior
- Users getting linked unwanted to main mu in WordPress multisite (WPMU)
- WordPress single sign on using cookies with shared user role functionality between more than 2 wordpress subdomains
- A different role for each site in a multisite
- WordPress install checking permissions of user id 0
- Multisite error when adding a user: already a member of this site
- WordPress Multisite FQDN Admin Access
- How to create child/sub user under parent user
- How create a multisite setup with “phantom” accounts and passwords?
- Multisite vs Role Scoper
- Get users from all/specific blog by user_role and current_user role
- Is there any way to give all users access to one blog in a multisite network without using a plugin?
- WordPress and multisites, the rigth choice?
- Some Subdomains on a Multisite Install Not Found
- How can I display all Multisite blogs where this user is administrator?
- Multi site and media uploader
- How to give “author” user role appropriate capabilities to add PollDaddy polls? WordPress multisite
- iis6 multisite and permissions
- Multisite and users being listed on network administration dashboard and not main site dashboard
- New folder and file permissions are not correct
- Multisite Login Access Restrictions
- wp_get_attachment_image_src multisite issue
- Favicon plugin for WordPress running in network mode (multisite)? [closed]
- Hide everything on site for visitors except specific page IDs
- turn single domain off
- Entry page for a wordpress multisite
- Network Admin URL is shown to anyone before accessing a blog