Skip to content

Instantly share code, notes, and snippets.

@gfargo
Created January 21, 2015 18:05
Show Gist options
  • Select an option

  • Save gfargo/e71e06d320455444603e to your computer and use it in GitHub Desktop.

Select an option

Save gfargo/e71e06d320455444603e to your computer and use it in GitHub Desktop.
Easy function to add help tabs to WP Admin Pages
add_filter( 'contextual_help', 'wptuts_contextual_help', 10, 3 );
function wptuts_contextual_help( $contextual_help, $screen_id, $screen ) {
// Only add to certain screen(s). The add_help_tab function for screen was introduced in WordPress 3.3.
if ( $screen_id == 'market-trends' || ! method_exists( $screen, 'add_help_tab' ) )
return $contextual_help;
$screen->add_help_tab( array(
'id' => 'wptuts-overview-tab',
'title' => __( 'Updating', 'plugin_domain' ),
'content' => '<p>' . __( 'Some help text here', 'plugin_domain' ) . '</p>',
));
return $contextual_help;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment