Is it possible to intercept calls to current_user_can() ?
Example:
current_user_can('rate', $post_id)
There’s no “rate” capability registered, but could I somehow hook into that function and do my own checks, without having to register a role capability?
Yes, just filter
'user_has_cap'
. You get an array with the current capabilities that you can change without touching the database.Sample Code
Test
Handle super-admins