Last active
February 27, 2017 09:59
-
-
Save evrpress/1e819796d90fec2305d91f96f745fa82 to your computer and use it in GitHub Desktop.
add body class if current user is subscriber
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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