WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. kitchin
    Member
    Posted 2 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:

    eshop-admin-functions.php

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

    eshop-settings-class.php

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

    (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.

    http://wordpress.org/extend/plugins/eshop/

  2. esmi
    Forum Moderator
    Posted 2 years ago #

    This will be fixed in the next version of eShop.

  3. kitchin
    Member
    Posted 2 years ago #

    Thanks!

  4. TreeParlor
    Member
    Posted 2 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
    Member
    Posted 2 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
    Moderator
    Plugin Author

    Posted 2 years ago #

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

    oh and check the about page.

  7. TreeParlor
    Member
    Posted 2 years ago #

    Saaaawwwweet! Thanks!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic