Capability check instead of a role check
-
Hi, shouldn’t this be a capability check instead of a role check:
/** * Show settings menu */ public function wpmm_item_settings_load(){ if(! current_user_can('administrator')) { return; }
to make it easier for custom roles to access it?
See also e.g. https://developer.www.ads-software.com/reference/functions/current_user_can/
While checking against particular roles in place of a capability is supported in part, this practice is discouraged as it may produce unreliable results.
Thanks
Viewing 10 replies - 1 through 10 (of 10 total)
Viewing 10 replies - 1 through 10 (of 10 total)
- The topic ‘Capability check instead of a role check’ is closed to new replies.