webgrafia / ginger

Wordpress plugin to make website compliant with EU Cookie Policy, with opt-in feature
18 stars 7 forks source link

Add: filterable capability for admin menu #3

Closed edwinsiebel closed 7 years ago

edwinsiebel commented 7 years ago

Hi,

to be able to enable the cookie and to change the text, one has to have the 'manage_options' capability. So, basically only an administrator can do this.

Our clients don't have this capability, and thus, cannot edit the cookie.

Would it be a nice feature to let the capability be filterable, so one can change this accordingly.

Filter name: ginger_admin_menu_capability

Example: add_filter('ginger_admin_menu_capability', function($capability) { return 'delete_users'; }, 10, 1);