How to remove the contextual help and its tab completely from WordPress v3.3.2? The add_filter for contextual help that used to work like wonder on older version no longer work now.
Update: (trimmed solution from Chip Bennett)
function wpse50787_remove_contextual_help() {
$screen = get_current_screen();
$screen->remove_help_tabs();
}
add_action( 'admin_head', 'wpse50787_remove_contextual_help' );
Since WordPress 3.3, contextual help tabs are added via the Screen object, using
add_help_tab()
. The basic structure is as follows:If you know the
$id
of a specific help tab, you can remove it usingremove_help_tab()
:If you want to remove all help tabs from the current screen, use
remove_help_tabs()
:You just need to wrap that in a callback hooked into
admin_head
, and you’re good to go:Some of these functions aren’t well-documented in the Codex yet. Try source directly; they are defined in
/wp-admin/includes/screen.php
.Caveat
As-written, these functions will act globally. Most users will want to target a Theme- or Plugin-specific page for doing something like this. If you want to target a specific Theme’s screens, you’ll need to use the Theme-specific hook, e.g.:
Note that, at this point, you can also hook into the
load
action for your page-specific hook, to execute your contextual help callback:Then, query for that hook in your callback: