Solved this with the following code:
<?php
$blog_id = 1; //set the blog id to the main site id
switch_to_blog( $blog_id );
$user_id = get_current_user_id();
$group = Groups_Group::read_by_name( 'Premium' );
if ( Groups_User_Group::read( $user_id, $group->group_id ) ) {
echo 'PREMIUM!!';
} else {
echo 'Not premium';
}
restore_current_blog();
?>
Related Posts:
- Making my plugin multi-site compatible
- How do I add a widget programmatically to a newly created site (WPMU) within a plugin?
- WordPress network: set themes and plugins for new blog
- What is the function to get plugin base url in multisite?
- Having separate plugins and themes folder for multi-site setup
- Is it possible to set up multistore in Woocommerce? [closed]
- How to define WordPress plugin shortcode globally for multisite?
- How to add class in plugin only for network site?
- How to write a plugin to add users to a mail list
- Redirect to another page using contact form 7? [closed]
- Certain functions are undefined when called form mu-plugins
- WordPress Multisite: Programmatically Activate / Deactivate a Plugin of a Specific Blog
- How to remove a CPT Menu from the Root Admin only
- How to get values from network settings panel?
- Activation flow of a plugin in a multisite environment
- WP Forms not displaying,becomming an fatal error
- Fatal error: require_once(): Failed opening required
- How to capture hidden values with Gravity Forms
- Creating one user access account for all the multiple sites
- Why my multisite is this slow? (stats inside)
- Coming soon pages with rest of site in maintenance mode
- Force Network Activated Plugin to Run After Site Level Plugins
- How to set the default options on an existing plugin in a WP MU new user install
- Active Plugins for current blog in WP Multisite Network? [duplicate]
- Add custom fields in the new and edit the site forms without touching the WP core
- How to implement WordPress plugin update that modifies the database?
- wp.media update options and force render on uploader
- WordPress Plugin Development In MVC Architecture, How?
- WordPress Plugin Development from Scratch. How? [closed]
- Customize plugin update “new version is available” text
- How to run Two WordPress blogs with different themes and with single database and same content
- “Donate to this plugin” for WordPress.org Plugin Authors
- How to handel multiple checkbox field in the admin settings page with Settings API
- Update Multiple Post Meta for the Same Post In One call?
- How to show custom message once on plugin activation?
- How do I configure WordPress to talk to a Microsoft SQL Server database?
- How to load a new template page according to a particular URL?
- Plugin translations problem
- How ( and mostly at what time ) can i prevent the alternate cron from running?
- PDF download – use wordpress functions
- Multiple Domains with Single WordPress Install
- API to filter new user registration $POST data?
- Multisite mu-plugins site-specific directory
- Set cookie then immediantly refresh the page
- How to add an attribute to the body tag with a plugin?
- Override the core function locate_template
- Redirect to a welcome page after updating plugin
- Set user ID at time of wp_create_user
- How to Create a Custom Plugin Permalink
- Portfolio + Blog: multisite or plugin?
- How can I disable the multisite feature of WordPress 3.0?
- How would I go about creating a user ranked post popularity page?
- link bbpress forum discussion to blogposts
- External Domain on WordPress Multisite
- Re use the list table for a custom post type on another page
- Can we have an ‘Update metadata’ button in Image Gallery for all image instances?
- Customised plugin failed to install and activate
- Why is one phpunit test throwing an error on one class when all other classes are similar without error?
- How to get all posts belongs to a user between a certain date
- wp-load.php redeclares classes
- Plugin main file is constantly been fired on every website visit
- Where should custom post types be registered in a plugin?
- output html on post or page from custom plugin [closed]
- License validate function
- Change the number of plugins counted on wp-admin/plugins.php
- plugin uninstall function drop the tables, but shows errors on admin
- How to use template inside plugin shortcode with variables for big HTML code
- WordPress Object Oriented plugin development [closed]
- Way to send multiple values for column to MySQL?
- What’s the right way to implement functions in footer.php
- Do rewrites added with add_rewrite_rule() persist after plugin deletion?
- Display my plugins content based on a pages post_id
- How can i list random author?
- Our plugin tags not appearing in WordPress Plugin Repository
- Make get_permalink() work outside the Loop using filters
- Pluging with content for a specific page or post
- Does WordPress do any internal caching if no plugin installed?
- WordPress Plugin- How to Insert Html&JS code in specific Page and specific Div
- Conditional delete metadata does not works
- Upload Image with a file URL and show dynamically on Frontend
- How can i solve php upgrade problem
- The function called on the wp head hook becomes null
- custom post type get_posts() function not work
- Create multiple posts when a custom post is created
- how override a define
- WordPress plugin blog creation
- Preserving existing functionality converting HTML to WordPress
- submit form data to wordpress existing database table using my plugin
- Prefix of $wpdb does not worked and does not displayed
- Get content and send to 3rd party
- How to make wp multisite subdomain exist search
- Add predefined values to custom post plugin
- WordPress internationalization + domains
- What is the Object for WP_Error Class?
- Ajax in Plugins: returns the whole page
- WordPress 3,5 and Jquery version
- how to search through plugin in wordpress cimy-user-extra-fields?
- Any way to hook into WP after a page displays?
- Meta box not displaying on the plugin page
- public custom posts not showing in my wordpress plugin