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)

 

Answer

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 using remove_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:

Tagged with →  
Share →

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>