Add Contextual Help Tabs

This snippet let’s you crete contextual help tabs in WordPress admin. Place this on functions.php or in your plugin file. Create as many helps tabs you need by switching the $screen_id.

Uncomment the echo line to see the current page id.

Code Snippet:

function mqw_example_contextual_help( $contextual_help, $screen_id) {
    
   # Uncomment this to see actual screen
   # echo 'Screen ID = '.$screen_id.'<br />';
     
    switch( $screen_id ) {
        case 'toplevel_page_settings_page' :
     // To add a whole tab group
            get_current_screen()->add_help_tab( array(
            'id'        => 'my-help-tab',
            'title'     => __( 'How to get started?' ),
            'content'   => __( 'Put any text here bla bla bla ....' )
            ) );
            
            break;
        case 'mi_plugin_page' :
            //Just to modify text of first tab
            $contextual_help .= '<p>';
            $contextual_help = __( 'Your text here.' );
            $contextual_help .= '</p>';
            break;
    }
    return $contextual_help;
}
add_filter('contextual_help', 'mqw_example_contextual_help', 10, 2);

Posted in Admin area