Skip to content

Instantly share code, notes, and snippets.

@ksemel
Created May 28, 2014 15:57
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 ksemel/2c6702d69614e86c27f2 to your computer and use it in GitHub Desktop.
Save ksemel/2c6702d69614e86c27f2 to your computer and use it in GitHub Desktop.
use get_current_screen() to narrow the scope of a function
function admin_footer(){
$screen = get_current_screen();
if ( isset( $screen->base ) && $screen->base == 'profile' ) {
echo "<script type='text/javascript'>
if( jQuery('#GA_enabled').is(':checked') === false ) {
ShowOrHideQRCode();
}
</script>";
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment