Skip to content

Instantly share code, notes, and snippets.

@johnpbloch
Created August 13, 2013 21:33
Show Gist options
  • Save johnpbloch/6225918 to your computer and use it in GitHub Desktop.
Save johnpbloch/6225918 to your computer and use it in GitHub Desktop.
Add a contextual help tab to the screen
<?php
add_action('current_screen', 'jpb_current_screen');
/**
* @param WP_Screen $screen The current screen object
*/
function jpb_current_screen($screen){
if($screen->post_type === 'my_custom_post_type'){
$screen->add_help_tab(array(
'id' => 'unique_id',
'title' => 'Human Readable Title',
'content' => "<p>This is the help text</p>
<p>It's just HTML, so you can do anything you want with it</p>",
));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment