[resolved] Debug warning: add_contextual_help deprecated (7 posts)

  1. kitchin
    Posted 4 years ago #

    If you run eShop 6.2.10 with DEBUG true (in wp-config.php) in WP 3.3 then the admins screens will load up about a dozen repetitions of this warning:

    Notice: add_contextual_help is deprecated since version 3.3! Use get_current_screen()->add_help_tab() instead. in .../wp-includes/functions.php on line 3458

    If you enjoy debug mode then this is annoying. The fix is a tiny bit more the warning indicates, so I made a pretty safe helper function. Two files to patch:


    // add_contextual_help($paged,$help); // deprecated 3.3


    // add_contextual_help($this->pagehook, $help); // deprecated 3.3

    (This is minimal. In my eshop, I actually wrapped them with "if (function_exists()".)

    The new function is here: http://pastebin.com/TshW8KxA
    It's only a few lines, and is formatted as an mu-plugin.
    The least obvious step is
    $screen = convert_to_screen( $screen );

    The name 'my_...' is sort of example code, but it does work.


  2. esmi
    Forum Moderator
    Posted 4 years ago #

    This will be fixed in the next version of eShop.

  3. kitchin
    Posted 4 years ago #


  4. TreeParlor
    Posted 4 years ago #

    Just ran into this myself. I'm not sure where to put the patches in the these two files. Before the <?php or inside it?

    Thanks for the help!

  5. kitchin
    Posted 4 years ago #

    The easiest place to put the pastebin code is in a new must-use plugin. Create a file, say called "my_add_contextual_help.php", in the folder wp-content/mu-plugins/. In the folder does not exist, create it.

    More info about must-use plugins: http://codex.wordpress.org/Must_Use_Plugins

  6. elfin

    Plugin Author

    Posted 4 years ago #

    not needed, I added your code already to the current release, thank you ;)

    oh and check the about page.

  7. TreeParlor
    Posted 4 years ago #

    Saaaawwwweet! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic