Solved: has_cap was called with an argument that is deprecated since version 2.0

Dec 12, 2012   //   by kdecom   //   plugins, wordpress  //  No Comments

Here is the some basic word press tips and tricks for all the web developer????

I was working on word press plugin and i just installed one plugin after that i am start getting one notice on my word press site:

First of all why i am getting notice displayed on my site :-

define(‘WP_DEBUG’, true);

Its not good to turn it on for production site but its good to turn it on for development site. anyways….

Now the problem that i find is why i am getting that notice….

inside the plugin where it add the admin option page like this

add_options_page(‘XXX’, $XXXX, 9, ‘XXXX’, array(&$this, ‘optionsPage’));

(if someone use same thing with this function called add_menu_page()      it display same error as well so this trick works in both ways)

SO the problem was the 9….

What i did to solve the problem is:-

add_options_page(‘XXX’, $XXXX, ‘upload_files’, ‘XXXX’, array(&$this, ‘optionsPage’));

I hope it helps and save some times.

Leave a comment

css.php