[wp-hackers] no hooks to current_user_can with an item id ?
Malaiac
malaiac at gmail.com
Thu Apr 30 13:58:23 GMT 2009
<I may be wrong>
is there any way to hook on capabilities check with an post id ?
current_user_can('edit_<item_type>',$item->id);
> $current_user->has_cap($args);
> $caps = call_user_func_array( 'map_meta_cap', $args ); << inside map meta cap would be a nice place to change,
FROM (wp-includes/capabilities.php , around line 903) :
default:
// If no meta caps match, return the original cap.
$caps[] = $cap;
TO :
default:
$caps = apply_filters("map_meta_cap_$cap",$args);
// If no meta caps match, return the original cap.
$caps[] = $cap;
> then a boolean true false is returned, without filtering.
Any way I could hook somewhere ?
(btw, the cap is 'edit_link', I'm trying to add rights granularity to
link edition)
Malaiac
More information about the wp-hackers
mailing list