Skip to content

Instantly share code, notes, and snippets.

@SiR-DanieL
Created April 5, 2017 14:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SiR-DanieL/3eeced66fb1d7feabeb1d4fbf8fc7ae8 to your computer and use it in GitHub Desktop.
Save SiR-DanieL/3eeced66fb1d7feabeb1d4fbf8fc7ae8 to your computer and use it in GitHub Desktop.
// Get current user ID
$user_id = get_current_user_id();
// Check if the user is member of the plan 'gold'
if ( wc_memberships_is_user_active_member( $user_id, 'gold' ) ) {
echo 'This is a special message only for Gold members!';
} else {
echo 'I\'m sorry, you are not a gold member. There\'s nothing here for you!';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment