duracelltomi / gtm4wp

Google Tag Manager plugin for WordPress
https://gtm4wp.com/
GNU General Public License v3.0
147 stars 96 forks source link

Create new WP capability #143

Open duracelltomi opened 5 years ago

duracelltomi commented 5 years ago

Currently, the manage_options capability is required to manage plugin options. It is however possible to create a new capability and require this so that WP admins can assign users a more strict role where certain users can manage GTM4WP options without the need to became admins:

https://developer.wordpress.org/reference/hooks/option_page_capability_option_page/

emreerkan commented 1 year ago

Hi Thomas,

I saw this is waiting for some time and it seems if no one steps up it will wait some more. So I thought at least while waiting we can do something about it. Like using filters for default capability, so developers can hook into it and override the default capability. I created a simple PR and added a code example too.

It's not much. You can easily test it. If I can find some time I'll get a little bit more accustomed to the plugin codebase. Maybe I'll ask for this issue to assigned to me in the future.

Thanks for the plugin and your efforts! Cheers