Created
September 3, 2013 09:03
-
-
Save iagdotme/6421404 to your computer and use it in GitHub Desktop.
Remove help and screen context and options
This file contains 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 | |
// 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