Skip to content

Instantly share code, notes, and snippets.

@woogist
Created July 23, 2015 08:45
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 woogist/3e840cfffec735353a97 to your computer and use it in GitHub Desktop.
Save woogist/3e840cfffec735353a97 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