I am filtering the map_meta_cap() function, which is called from $user->has_cap (which is called from current_user_can()). I only want my filter to execute if the current user is an administrator, so I need a conditional in my filter that checks their role.
I can't use current_user_can(), because that invokes my filter, causing an infinite loop.
Is there a reliable way to check whether someone is an administrator without using current_user_can() ?
$current_user
global, remembering to add global scope when inside a function..in_array('administrator', $current_user->roles)
?