Skip to content

Instantly share code, notes, and snippets.

@iagdotme
Created September 3, 2013 09:03
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 iagdotme/6421404 to your computer and use it in GitHub Desktop.
Save iagdotme/6421404 to your computer and use it in GitHub Desktop.
Remove help and screen context and options
<?php
// Remove help and screen context:
// Remove Help and Screen Options
// http://wordpress.stackexchange.com/questions/73561/how-to-remove-all-widgets-from-dashboard
add_filter( 'contextual_help', 'wpse_25034_remove_dashboard_help_tab', 999, 3 );
add_filter( 'screen_options_show_screen', 'wpse_25034_remove_help_tab' );
function wpse_25034_remove_dashboard_help_tab( $old_help, $screen_id, $screen )
{
if( 'dashboard' != $screen->base )
return $old_help;
$screen->remove_help_tabs();
return $old_help;
}
function wpse_25034_remove_help_tab( $visible )
{
global $current_screen;
if( 'dashboard' == $current_screen->base )
return false;
return $visible;
}
?>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment