The function current_user_can_for_blog()
seems to be what you are looking for. With your example above, this solution should work:
$blog_id = 1; //set the blog id to the main site id
if (current_user_can_for_blog($blog_id, "access_mainsite_s2member_level1")){
the_content();
}
Related Posts:
- 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?
- Restrict the user access in multi site for non-assigned blogs
- 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
- One Site as a part of Multisite to be hidden (Un-published) from Public?
- 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
- 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
- Multisite Login Access Restrictions
- How to disable a network enabled plugin for just one site?
- Plugin for editing options on multisite?
- wp-activate.php causing white screen of death
- Change wordpress Multisite default site from side id 1 to side id 2
- How can I have network sites not use year/month folders by default?
- Multisite: Develop locally using production images with .htaccess
- How to prevent hotlinking with htaccess in WordPress and why most common use about it doesn’t work?
- Why can’t a WordPress network (multisite) in it’s own folder use subdomains?
- Display custom homepage text based on domain
- Add new domain to ‘My Sites’ using network admin
- How do I set a default theme in multisite network
- WordPress Multisite Login Access
- Switch_to_blog() outside wordpress
- Jetpack Blog Subscriptions on Multisite [closed]
- Multisite use language code as subdirectory
- How to remove the Tools menu item from the WP-Admin menu
- Using $wpdb Class to Pull Recent Comments Across a Network
- Default content for a new site in multi site
- WordPress (+WPMU) Import/Export ALL settings?
- wordpress htaccess is hijacking my .mp4 files
- Is there a way to separate a site inside a network (multisite) into its own wp site?
- Has WP and MU fully merged?
- Why is ‘is_multisite’ returning true when it’s a single install?
- Migrate a WP website from a single-server single-domain to a multi-server multi-domain installation
- Forcing SSL Protocol for Multisite Subdomain Child Sites + cPanel Configuration
- Website DR using Multisite
- Multisite Network menu links not updating
- current_user_can() always returns true if user is super admin
- multisite hook for Add Existing User
- Displaying a message upon user registration
- What sites are you registered to when joining a multisite?
- How to redirect one page on the subdomain
- ReWriteRules and WordPress Multi-Sites with Sub Directories
- Is the Multi site functionality a viable option for Country and Language targeting?
- WordPress: how to change URL for individual MultiSites?
- Change main site in multisite install?
- Enable “My blogs” in a custom installation
- HTTPS Warning and Certificate Error when Updating Network
- Multisite, with virtual root
- Complex WordPress Website
- Create sub-domain for multisite and multi languages?
- How to retrieve Post Excerpt from a different site in the Network
- how to have __() translating in languages different from admin?
- How to temporarily redirect front page of a network to one of the sites/blogs?
- Multisite: Redirect to appropriate domain if subdomain doesn’t exist
- How to change a user role after registering in multisite?
- Multisite questions
- how to control display switch_to_blog( $subsite->blog_id ); $tags = wp_tag_cloud
- WordPress multisite with domains and subdomains
- Sort posts according to date
- Creating a multilingual multisite
- the_content not working on one of two Multisite sites
- How to automatically create an index of child sites at the root url for a multisite installation?
- Does switch_to_blog support array or other ways to show all posts on a network install?
- How to make subdomain and muti-site but wordpress isn’t in root?
- Show buddypress profile fields in a multsite blog [closed]
- Add www to the Root Site in WP Multisite Network
- Multisite problem with unexisting paths to CSS etc
- How to disable Gutenberg editor from Multisite Admin panel?
- How to allow mixed case characters in multisite site name?
- Separated Theme file on multi site network in subdomain
- User not staying logged into one of sub sites in multisite after SSL
- register_setting() for single site vs update_site_option() for mu
- Allow users to register on multisite through WooCommerce using the same email address
- How To Change the URL of a WordPress Multisite
- Sending SMTP mail using a server with self-signed SSL
- Site w/ Addon Domain doesn’t show CSS
- WordPress MU – Creating a site takes ages
- Default sub-pages on WordPress Multisite
- WordPress Multisite – Questions about select all posts from all network sites
- Multi site and media uploader
- Comment reporting for Multisite
- How to display the most popular posts of all the blogs in a mu setup? [duplicate]
- WordPress MS wp-admin/includes/post.php error with shortcode generator
- Subdomain add comment redirect to 404 not found page iis server
- All links to images are broken in a subdomain multi site environment
- different image for mobile template block theme