is_user_logged_in()
is a pluggable function, which means you can override its functionality. That’s probably where I’d start.
Something like this may do what you’re looking for. This is untested code and comes with no warranties of any kind.
function is_user_logged_in() {
$user = wp_get_current_user();
$current_blog_id = get_current_blog_id();
$allowed = false;
$blogs_of_user = get_blogs_of_user( $user->ID );
foreach( $blogs_of_user as $blog ) {
if( $blog->userblog_id == $current_blog_id ) {
$allowed = true;
}
}
if( ! $allowed ) {
return false;
}
return $user->exists();
}
References
Related Posts:
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- Multisite Login Access Restrictions
- Troubleshooting a “You do not have sufficient permissions to access this page” error
- Restrict users on multisite WordPress install
- Can you have multi-site WP and keep users separate?
- Multisite Independent User Base
- How can I get multisite primary blog (url or path) for current user?
- WordPress Multisite prevent direct access to subdomain
- access the plugins for each role in WordPress multisite
- 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
- Multi-Site Subfolder User Permission Issue
- Add access control origin header information across multisite
- Disable site visiting and user logins excepting for a specific user
- Hiding media uploaded by other users in wordpress multisite?
- Common user login for two different wordpress installation and bbpress
- How to check main site user level from subsite in a multisite network
- Give users acces to admin a single post or set up WP network?
- Users getting linked unwanted to main mu in WordPress multisite (WPMU)
- WordPress Multisite FQDN Admin Access
- Some Subdomains on a Multisite Install Not Found
- How to delete post revisions?
- How to get blog name, when using WordPress Multisite
- Which asset URLs are acceptable in a “vanilla” MU install?
- Using MAMP and Xip.io to view a WordPress Multisite on a local network
- WP_Site_Query vs. WP_Network_Query in WordPress 4.6
- Multisite/network–automatic self-registration, blog setup
- COOKIE_DOMAIN setting confusion
- Possible to make custom role in multisite that can add sites?
- Multisite: use media from one site vs. copying the same media to all language sites?
- Nginx rules for subdomain multisite install (Bedrock)
- “Upgrade Network” error: stuck with SSL certificate verification
- when using add_user_to_blog getting error “Call to undefined function get_userdata”
- the blog owner multisite
- Multisite without .htaccess
- Max number of multisites
- Multisite installation on IIS gives 404 trying to access the admin dashboard
- WordPress MU Domain Mapping Customizer Error
- How to properly force https and www on multisite with Apache HTAccess
- Multisite Redirect issue
- Stop WordPress Entirely and Run My Own Code
- Performance on WPMS
- Display site administrator’s id by current blog id inside link
- SELinux security vs WordPress updates
- Can you manage multiple domain names from a single WordPress multisite network?
- Installed domain-based Multisite but can’t access wp-admin (redirect loop)
- WordPress Multisite Strange Redirect on Primary Site
- Switch MultiSite main site with another (multilingual sites) – with subfolder – no subdomain
- My Media Library is broken across all my subsites
- WordPress multisite proper prefix attribution
- WordPress stuck in deleting user
- Updated to version 3.8 and Admin pages are very slow. How to diagnose problem? [closed]
- Multisite install on subdomain w/ subdomains change siteURL
- Make uploads live outside of the WP folder
- Multisite Sub domains not working
- How Can I Change The Name Of My Subdomain in WordPress Multisite
- Display site description instead of site name
- Error : Cookies are blocked or not supported by your browser
- WordPress multi-site: How do I create the home page, the root URL?
- Multiple Websites that share some content types and not others
- Solving a get_user_meta() problem in Multisite
- Is it possible to query posts with tax queries after multisite switch_to_blog() function?
- In Multisite the users profile picture keeps disappearing for “the other site”
- How to use the sunrise.php script for Multisite network domain mapping?
- How to pull data from child installation to parent theme
- Which is the correct way to migrate content from single WP to WP multisite
- How to have one installation at blog.example.com and multiple blogs in sub folders such as blog.example.com/userA?
- Website not listed under Sites (in a Network environment)
- Running hundreds of WP in multisite
- get_site_option / update_site_option – the main site and sub sites do not share the same storage
- Bitnami multisite change URL of secondary blog
- Can I use the main Multisite as a backend only?
- Number of total comment does not tally with the number of comment?
- Downloading customized theme from wordpress
- Domain not redirected correctly with WordPress Multisite
- Subsites in Multisite throw 404 in wp-admin
- WordPress theme to support single website but with 3 sections for 3 languages
- Can assign a new domain to a site in a multisite?
- the menu of the network does not display my second website
- Multisite – site user limited only for this site
- Update siteurl and home in multisite subsites to https
- WordPress multi-domain with multiple sites with multiple languages
- Get variable from previous blog while using switch_to_blog
- Domain level problem for multisite?
- How can I import posts into different wordpress multisites at once?
- Redirect www.mainsite.com/subsite/wp-login to www.mainsite.com/wp-login
- WordPress multisite not working
- Activation of new Registered site fails on multisite
- How to login a user with wp_set_auth_cookie on a specific blog within a multisite environment
- How to disable style filtering in post?
- How does adding custom meta to signup form work?
- Can’t un-archive site after upgrading to WordPress 3.8
- How to handle responsive and non responsive websites in one WordPress Theme?
- Create a Network of Different websites with wordpress
- Cookies in Multisite network where sites have their own domain name?
- Swap domains of two sites with each other in multisite
- Many big issues in the website, WP_Debug not showing
- different image for mobile template block theme