• Ulrich

    (@grapplerulrich)


    There is a deprecated notice for the capability that is being used in add_menu_page().

    8 is not a valid capability.

    add_menu_page(__('WhatsHelp', 'whatshelp'), __('WhatsHelp', 'whatshelp'), 8, basename(__FILE__), 'whatshelp_settings', plugin_dir_url(__FILE__) . 'img/wh-icon.ico');

    By changing the capability to “manage_options” fixes the PHP notices.
    add_menu_page(__('WhatsHelp', 'whatshelp'), __('WhatsHelp', 'whatshelp'), 'manage_options', basename(__FILE__), 'whatshelp_settings', plugin_dir_url(__FILE__) . 'img/wh-icon.ico');

    https://developer.www.ads-software.com/reference/functions/add_menu_page/

    Thank you for fixing this in the next version.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Hi,

    Just instaleld. Still seeing this notice on the backend.

    Notice: has_cap was called with an argument that is deprecated since version 2.0.0! Usage of user levels is deprecated. Use capabilities instead.

    Would be great to get a snippet to fix this or a plugin update. Thanks.

    Thread Starter Ulrich

    (@grapplerulrich)

    Hi @windygo Could you fix this issue?

    FYI There is no need to release a new version to bump the “Tested up to” text.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Issue with capability’ is closed to new replies.