## Easily Get a Screen's Hooks

In general those rules suffice in determining the page specific hooks. But when working with them I often find it helps to have an easy reference. To create this easy reference we'll add a panel to the 'help' tab on the top right of every screen which will list the screen's details (screen ID, screen base, and most usefully, the screen's hook suffix). It will also list the screen's specific hooks.

Panels in the help tab were introduced in 3.3, so this will only work for WordPress versions 3.3+. To add the panel we use the contextual_help filter. This is a filter for backwards compatibility purposes, so we don't actually filter anything. Instead we use the WP_Screen::add_help_tab method.

To generate the help content, we take the global \$hook_suffix and append it to the hook stems mentioned above. We also get a list of the screen's details, which are stored as properties of the WP_Screen object.

Which will give us something like the following:

## The Code in Full

You can place the following in your site's utility plug-in, or (if you must), your theme's functions.php. Make sure you rename wptuts_screen_help to something unique to you.