[wp-hackers] using user_has_cap filter

Andrew Nacin anacin at gwhatchet.com
Tue Oct 27 15:17:53 UTC 2009


http://phpxref.ftwr.co.uk/wordpress/wp-includes/capabilities.php.source.html#l697


> $caps is ????
>

The capability being asked for. If it's a meta capability, map_meta_cap
first determines the primitive capability.

$args are the extra arguments - post ID, etc. But what is $args[0], what is
> $args[1], etc. ????
>

It depends on the capability being asked for, so you can determine the
specific situation for which the capability is being requested. The post ID
will be passed by current_user_can if, say, the check is whether the user
can edit or delete a post. But it wouldn't be passed if the check is whether
the user can switch themes.


More information about the wp-hackers mailing list