Skip to content

Instantly share code, notes, and snippets.

@evrpress
Last active February 27, 2017 09:59
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 evrpress/1e819796d90fec2305d91f96f745fa82 to your computer and use it in GitHub Desktop.
Save evrpress/1e819796d90fec2305d91f96f745fa82 to your computer and use it in GitHub Desktop.
add body class if current user is subscriber
add_filter( 'body_class', 'add_class_if_subscriber' );
function add_class_if_subscriber( $classes ) {
$user_ID = get_current_user_id();
$subscriber = mailster('subscribers')->get_by_wpid($user_ID);
if($subscriber){
$classes[] = 'is-mailster-subscriber';
}
return $classes;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment