Notice: has_cap was called with an argument that is deprecated

Discussion in 'General Discussion' started by Jaafar, Mar 28, 2015.

  1. Jaafar

    Jaafar Member

    Joined:
    Mar 24, 2015
    Messages:
    33
    Likes Received:
    2
    I am getting a deprecated error on my wordpress plugin, as soon, as I installed a new plugin, I received this error:
    Notice: has_cap was called with an argument that is deprecated since version 2.0! Usage of user levels by plugins and themes is deprecated. Use roles and capabilities instead
     
  2. Oliver

    Oliver Member

    Joined:
    Mar 24, 2015
    Messages:
    84
    Likes Received:
    2
    Jaafar, you need to disable wp debug…

    go wp-config.php

    then find
    define(‘WP_DEBUG’, true);
    change it to
    define(‘WP_DEBUG’, false);
     
  3. Oliver

    Oliver Member

    Joined:
    Mar 24, 2015
    Messages:
    84
    Likes Received:
    2
    Also, find the plugin that is causing the problem. by deactivating all of them one by one.

    when you find the culprit

    go to your root folder >wp-content>plugins> the culprit plugin
    open the Plugin php file with an editor, Notepad ++

    look for “add_options_page”
    in my case you will see in the same line

    add_options_page(“Quick Adsense Options”, “Quick Adsense”, 8, basename(__FILE__), “ads_admin_page_inc”);

    remove the “8”
    and put ‘activate_plugins’

    so it will be add_options_page(“Quick Adsense Options”, “Quick Adsense”, ‘activate_plugins’, basename(__FILE__), “ads_admin_page_inc”);

    with single colon
     
  4. walker

    walker Visitor
    Visitor

    thanks man.. you saved the day
     

Share This Page

Loading...