WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I want to validate this deprecated function:

add_filter('user_has_cap', array(&$this, 'filter_user_has_cap'), 10, 3);

It needs to use roles or capatibilies, so I guess 10 is the admin level, so I could use "edit_pages":

add_filter('user_has_cap', array(&$this, 'filter_user_has_cap'), 'edit_pages', 3);

But what is argument "3"?

Thank you Oliver

share|improve this question
Just FYI, the 10 is the filter priority, and is an argument to add_filter(), not to the callback. – Chip Bennett Aug 11 '11 at 16:59
up vote 1 down vote accepted

First of all, it's not the add_filter() call that you're supposed to be modifying, but the callback: 'filter_user_has_cap', i.e. go to where that method is defined and change the user level to 'edit_pages'.

Fixing deprecated notices is easier with the Log Deprecated Notices plugin.

share|improve this answer
Nice plugin, thanks a bunch! – mashup Aug 11 '11 at 16:37

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.