Skip to content

Instantly share code, notes, and snippets.

@jjb
Last active December 25, 2015 03:39
Show Gist options
  • Save jjb/6911556 to your computer and use it in GitHub Desktop.
Save jjb/6911556 to your computer and use it in GitHub Desktop.
<?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