Pippins Plugins
  • Email
  • Facebook
  • Feedburner
  • Github
  • Google
  • Twitter
  • Vimeo
  • Youtube
  • Rss
  • About
  • News
  • Join the Site
    • Member Benefits
    • Member Plugins
    • Email Notifications
  • Plugin Store
    • Affiliate Area
    • Checkout
  • Plugins
    • Plugin Portfolio
      • Plugin Portfolio – List View
    • Free
    • Premium
    • Member Plugins
    • Coding Standards
    • Get Plugin Support
  • Tutorials
    • Series
      • Plugin Development 101
      • Creating a User Follow System Plugin
      • Customizing Restrict Content Pro
      • Displaying Content with Easy Content Types
      • Writing Your First WordPress Plugins, Basic to Advanced
      • Working with Widgets
      • User Submitted Image Galleries
      • Plugin Thoughts
      • Integrating Stripe.com with WordPress
      • WordPress Rewrite API
    • Member Exclusive
      • Free Members
      • Subscriber Only
    • Difficulty
      • Beginner
      • Intermediate
      • Advanced
    • Action and Filter Hooks
    • Ajax
    • Custom Post Types
    • External APIs
    • Short Codes
    • Taxonomies
    • Video Tutorials
    • Widget Tutorials
    • WordPress Admin / Dashboard
    • Working with jQuery
    • WordPress Database
    • Writing Plugins
    • Tag Index
  • Reviews
  • Support Forum
  • Contact
    • Support the Site
    • Request Code Review
    • Plugin Support

Add Contextual Help Screens to the WordPress 3.3 Help Tab

Posted on November 5, 2011 by Pippin in Free Members, Intermediate, Member Restricted, Tutorials, WordPress Admin / Dashboard, Writing Plugins 20 Comments
Home» Member Restricted » Free Members » Add Contextual Help Screens to the WordPress 3.3 Help Tab
Tweet
Love It - 0

WordPress 3.3 has a really nice new Help menu that can be used by plugin and theme developers to show a lot of helpful information to the users. It’s very similar to the Contextual Help Tab, but allows much more information to displayed in a more organized fashion. Instead of all content being displayed in a single pane, the new 3.3 help menu allows you to separate your help information into multiple tabs.


Note, in the official 3.3 release, the Help button has been removed from the toolbar, and has been restored to the Help tab in the top right.

Adding tabs to the WordPress 3.3 Help menu is not difficult, but works a little differently than the < 3.3 Contextual Help Tab, and is not backwards-compatible. Any helps tabs you have set up for WP 3.2.1 or earlier, will not show up in WP 3.3 (unless you used the add_contextual_help(), and nor will Help menu tabs setup in WP 3.3 show up in WP 3.2.1 or earlier. So you have to make sure that you go the extra mile and make your plugin help information accessible to users of WordPress 3.3 and earlier.

You must be logged in to view the rest of this content. Register or login from the sidebar.

Tweet Follow @pippinsplugins
3.3, add_help_tab, contextual help, help tab, toolbar

20 comments on “Add Contextual Help Screens to the WordPress 3.3 Help Tab”

  1. WPexplorer says:
    November 10, 2011 at 2:00 pm

    This is really awesome man.

    Reply
  2. WPexplorer says:
    November 10, 2011 at 2:02 pm

    I just noticed you localized it as well . :D

    Reply
    • Pippin says:
      November 10, 2011 at 2:08 pm

      Thanks, and yes I did ;)

  3. shawnsandy says:
    December 14, 2011 at 6:10 am

    2 things
    1 – wouldn’t using a callback function be more efficient that the conditional functions
    2- My help tabs aren’t on the menu bar???

    thanks
    -shawn

    Reply
    • Pippin says:
      December 14, 2011 at 9:39 am

      1. I don’t know if it would be more efficient, but cleaner maybe.

      2. WP 3.3 made some last minute changes to the menu bar, so the method might have broken this. I will investigate today and find out.

    • Pippin says:
      December 14, 2011 at 1:09 pm

      Ok, so I’ve just tested this out and it turns out that the official 3.3 release changed how it works a little. The functions are still the same, but instead of creating a new menu item in the toolbar, the help menus are added to the Help tab in the top right. Check out the new screenshot at the top.

    • shawnsandy says:
      December 14, 2011 at 4:22 pm

      Thx.. Preferred the way it looked in beta…

    • Pippin says:
      December 14, 2011 at 4:34 pm

      Yeah, me too. I liked it a lot better.

  4. deckerweb says:
    December 20, 2011 at 12:58 pm

    Thank you Pippin for this, had it implemented in my plugin already and will be out with the next update.

    Still, I have one more question:
    How could hide the old contextal help from prior WP 3.3 when user uses my plugin with WP 3.3? — Reason: I want a bit of backwards compatibility for some time for my plugin. The behavior is that both help systems work great but in 3.3 it adds the old helb as the last tab always – how could I hide this?
    I tried something like that, but it doesn’t work – what I am doing wront?
    if ( !empty( $old_help ) ) {

    $screen->add_help_tab( array(

    'id' => '',

    'title' => '',

    'content' => 0,

    ) );

    }

    Reply
    • Pippin says:
      December 20, 2011 at 1:05 pm

      I think the easiest way would be to setup the help tabs in two different functions (as you probably have), and then use a version compare conditional around the add_action(‘admin_menu’, ‘your_help_tab_function’). So if WP is v3.3, load one help tab set, but if it is less than 3.3, load the other help tab set.

      Make sense?

    • deckerweb says:
      December 20, 2011 at 2:30 pm

      Yes, makes sense, Pippin!

      I’ve tried to implement this, but does not work yet – I assume it’s because of the fall-back functionality they’ve implemented in 3.3 — for this see file screen.php in /wp-admin/includes/ from line 644 onwards.

      Here’s my code so far:
      in the 3.3 help function:
      if ( version_compare( $wp_version, '3.3', 'add_help_tab( array(

      'id' => '',

      'title' => '',

      'content' => 0,

      ) );

      }

      and in the old 3.2 help system:
      if ( version_compare( $wp_version, '3.2.1', '>' ) && isset( $_GET['page'] ) && $_GET['page'] == 'gle-layout-extras' ) {

      add_action( 'contextual_help', 'ddw_genesis_layout_extras_contextual_help', 10, 3 );

      }

      I assume that WP detects that is still some old help there (see the mentioned screen.php above) and displays it no matter what I restrict — I couldn’t it get to work with some filtering…

      If that doesn’t work at all it’s not a big deal – I just release it that way in short before next major version of WP I might drop the backwards thing either way.

      -Thanx, Dave :)

    • Pippin says:
      December 20, 2011 at 4:29 pm

      Can you show me the complete code via a pastebin?

  5. lepardman says:
    December 21, 2011 at 4:23 am

    Awesome man!
    Just wondering, if I want to add this on a custom post type screen, how do I set the global variable (global $pippin_options_page; in your example)? Im just using the register_post_type function. Is it possible? I’ve tested a little and get_current_screen() doesn’t seem to work either without using add_options_page().

    I’ve tried stuff like $my_options_page = ‘edit.php?post_type=my-cpt’; without any luck.
    Would be sweet if anyone knows how to do it. Thanks!

    Reply
    • Pippin says:
      December 21, 2011 at 9:06 am

      I’m not sure the exact screen ID you will need to use, but you can find it by putting this in your functions.php then loading the edit page for that post type.

      1
      2
      3
      4
      5
      
      function check_current_screen() {
        $current_screen = get_current_screen();
        print_r( $current_screen );
      }
      add_action('admin_head', 'check_current_screen');
    • lepardman says:
      December 22, 2011 at 8:31 am

      I got [id] => edit-my-cpt and tried both to set $pippin_options_page = ‘edit-my-cpt’; and $pippin_options_page = $current_screen->id; followed by the rest of your example code without success. I think the action load-(page) doesn’t like that very much :)

    • Pippin says:
      December 22, 2011 at 9:15 am

      Hmm, I’ll try and see if I can test it

    • adrian says:
      December 23, 2011 at 2:46 pm

      Yeah I’d love an answer to this too, I never understood the load action when it comes to custom post types =/

    • adrian says:
      December 23, 2011 at 3:43 pm

      I gave up and just did it like this (my custom post type is called “portfolio”):

      $screen = get_current_screen();
      if ($screen->id == ‘portfolio’) {
      // all that cool stuff from before
      }

    • Pippin says:
      December 23, 2011 at 4:07 pm

      Yeah, that should work. I’m going to try and look into the “load-” hook more.

    • Pippin says:
      December 27, 2011 at 11:15 am

      Travis Smith, from wpsmith.com just posted a quick tutorial that shows how to add this on a post/page or custom post type: http://wpsmith.net/2011/wp/adding-contextual-help-tab-to-editadd-new-postpage/?utm_source=feedburner&utm_medium=twitter&utm_campaign=Feed%3A+WPSmith+%28WP+Smith%29

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

  • Login

Lost your password?

Please enter your username or e-mail address. You will receive a new password via e-mail.

  • Facebook Become a Fan Like

  • Twitter Subscribe on Twitter Follow

  • YouTube Follow my Videos Subscribe

  • RSS Feed Subscribe with RSS Subscribe

Easy Digital Downloads

Most Loved

  • Love It Pro for WordPress
  • Write a “Love It” Plugin with Ajax to Let Users Love Their Favorite Posts / Pages
  • Simple Notices Pro Plugin for WordPress
  • User Bookmarks for WordPress
  • Front End Registration and Login Forms Plugin

Similar Plugins and Posts

  • Review: Saola – Custom Contextual Help for Every Admin Page
  • Modify the Contextual Help Tab on Any WordPress Admin Page
  • Add Contextual Help to the “Help Tab” for your Plugin

Latest Premium Content

  • Plugin Development 101 – Introduction to Adding Dashboard Menus
  • Plugin Development 101 – Intro to Loading Scripts and Styles
  • User Follow System – Part 5
  • Plugin Development 101 – Intro to Short Codes
  • Plugin Development 101 – Registering a Custom Post Type
  • Plugin Development 101 – Intro to Actions

Latest Tutorials

  • Submitting Your First Pull Request to a WordPress Plugin on Github (1)

    Github is an extremely popular tool for managing WordPress plugins, and one...

  • Plugin Development 101 – Introduction to Adding Dashboard Menus (1)

    Adding new menus, both top level and sub level, to the WordPress Dashboard is a really common task for plugins...

  • Plugin Development 101 – Intro to Loading Scripts and Styles (16)

    In this part of Plugin...

Enter your email to receive automated updates when new posts are published

Latest Tweets

  • @jasonbobich hmm, interestinf
    May 19, 2013
  • @jasonbobich I haven&#039;t recently
    May 19, 2013
  • @strickland lol I passed out for two hours, so who knows
    May 19, 2013

Topics

add_options_page attachments featured register_setting contextual help hook meta box Sugar Event Calendar add_shortcode Tom McFarlin get_user_meta the_content wp_enqueue_script Related posts plugin do_action mail chimp image login forms authors short codes attachment apply_filters post types bbpress recent posts comments taxonomies short code custom post type images gallery Ajax Stripe taxonomy jquery widgets users add_filter easy content types add_action widget restrict content pro easy digital downloads

Weekly Newsletter

Useful Links

  • Join the Site
  • Plugin Store
  • Affiliate Area
  • Tag Index
  • Support the Site
  • Suggest a Tutorial
  • Random Post
  • Contact

Monthly Archives

(c) 2011 Pippin's Plugins