WordPress Snippet
These funtions do not remove individual tabs. It simply removes the functionality altogether.
<?php | |
/** | |
* Removes the contextual help tab. | |
* | |
* @param array $old_help | |
* @param int $screen_id | |
* @param obj $screen | |
* @return array Returns the amended array of tabs. | |
*/ | |
function ccd_remove_help_tabs( $old_help, $screen_id, $screen ) { | |
$screen->remove_help_tabs(); | |
return $old_help; | |
} | |
add_filter( 'contextual_help', 'ccd_remove_help_tabs', 999, 3 ); | |
/** | |
* Removes screen options tab. | |
* | |
* @param boolean $display_boolean | |
* @param object $wp_screen_object | |
* @return boolean Returns false for the screens in the array. | |
*/ | |
function ccd_remove_screen_options( $display_boolean, $wp_screen_object ) { | |
$blacklist = array( | |
'post.php', | |
'post-new.php', | |
'index.php', | |
'edit.php' | |
); | |
if ( in_array( $GLOBALS['pagenow'], $blacklist ) ) { | |
$wp_screen_object->render_screen_layout(); | |
$wp_screen_object->render_per_page_options(); | |
return false; | |
} | |
return true; | |
} | |
add_filter( 'screen_options_show_screen', 'ccd_remove_screen_options', 10, 2 ); |