Last active
December 25, 2015 03:39
-
-
Save jjb/6911556 to your computer and use it in GitHub Desktop.
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
<?php | |
function is_subscriber_or_anonymous() { | |
global $current_user; | |
$current_user = wp_get_current_user(); | |
if ( !($current_user instanceof WP_User) ) | |
true; | |
$roles = $current_user->roles; | |
return in_array("subscriber", $roles); | |
} | |
if (is_subscriber_or_anonymous()) { | |
add_action('wp_footer', 'gauges', 99); | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment