How to control contextual help section by code?

You could also trigger/simulate the help button being clicked by binding to the ready event. Pre jQuery 1.7 <script type=”text/javascript”> jQuery(document).bind( ‘ready’, function() { jQuery(‘a#contextual-help-link’).trigger(‘click’); }); </script> jQuery 1.7+ (bind deprecated as of 1.7) <script type=”text/javascript”> jQuery(document).on( ‘ready’, function() { jQuery(‘a#contextual-help-link’).trigger(‘click’); }); </script> The difference here is that you’ll see the help section slide down … Read more

Help Tabs with: add_help_tab() callback – How does the argument work?

Ok. The answer is NOT simple, but after some try and error, reading core, etc. I found out what the problem is: The callback (which should be used instead of the content) accepts two arguments: $current_screen and $tab. Here’s what $tab looks like, when dumped for a single tab. Array ( Help Tabs with: add_help_tab() … Read more

Edit dashboard’s help tab

The documentation in the Codex seems outdated. Use the following code (see comments): // Priority 5 allows the removal of default tabs and insertion of other plugin’s tabs add_filter( ‘contextual_help’, ‘wpse_77308_products_help’, 5, 3 ); function wpse_77308_products_help( $old_help, $screen_id, $screen ) { // Not our screen, exit earlier // Adjust for your correct screen_id, see plugin … Read more

How to add a help tab to all admin pages – including plugin pages

This is how you can add help tabs to all admin pages—no matter if there already are any, or not: add_action(‘in_admin_header’, ‘wpse_124979_add_help_tabs’); function wpse_124979_add_help_tabs() { if ($screen = get_current_screen()) { $help_tabs = $screen->get_help_tabs(); $screen->remove_help_tabs(); $screen->add_help_tab(array( ‘id’ => ‘my_help_tab’, ‘title’ => ‘My Help’, ‘content’ => ‘<p>My help content…</p>’, )); if (count($help_tabs)) foreach ($help_tabs as $help_tab) $screen->add_help_tab($help_tab); … Read more

Click link on plugin/theme page and open the contextual help on a specific tab

Maybe the Q is bordering the off-topic, but IMO interesting in WordPress context. I’ve tested this directly in FireBug, in the Dashboard page (wp-admin/index.php). var $ =jQuery.noConflict(); // Remove ‘active’ class from all link tabs $(‘li[id^=”tab-link-“]’).each(function(){ $(this).removeClass(‘active’); }); // Hide all panels $(‘div[id^=”tab-panel-“]’).each(function(){ $(this).css(‘display’,’none’); }); // Set our desired link/panel $(‘#tab-link-help-content’).addClass(‘active’); $(‘#tab-panel-help-content’).css(‘display’,’block’); // Force click … Read more

Adding Help Tabs To Custom Post Types

Use this code for solve your Problem. function custom_help() { global $post_ID; $screen = get_current_screen(); if( isset($_GET[‘post_type’]) ) $post_type = $_GET[‘post_type’]; else $post_type = get_post_type( $post_ID ); if( $post_type == ‘listing’ ) : $screen->add_help_tab( array( ‘id’ => ‘you_custom_id’, // unique id for the tab ‘title’ => ‘Custom Help’, // unique visible title for the tab … Read more

How to remove contextual help on WP 3.3.2?

Since WordPress 3.3, contextual help tabs are added via the Screen object, using add_help_tab(). The basic structure is as follows: <?php $screen = get_current_screen(); $screen->add_help_tab( array( ‘id’ => ‘sfc-base’, ‘title’ => __(‘Connecting to Facebook’, ‘sfc’), ‘content’ => “HTML for help content”, ) ); ?> If you know the $id of a specific help tab, you … Read more

How to remove help tabs?

You need to use the contextual_help help filter. add_filter( ‘contextual_help’, ‘wpse50723_remove_help’, 999, 3 ); function wpse50723_remove_help($old_help, $screen_id, $screen){ $screen->remove_help_tabs(); return $old_help; } The filter is for the old context help (pre 3.3). (I’m not sure it matters what is returned…?). In any case the filter should be called late (hence 999) because plug-ins could add … Read more