Change capabilities
-
I tried to change your plugin with an add-on (mu-plugin) so Editors can maintain and add downloads and not just only Administrators. Why do you have this all hard coded set to manage_options and not just edit_posts? I ended up with a code that temporarily gives the Editor manage_options capabilities on pages with sdc_download in the admin url but that is far from ideal.
-
I will add a filter in the next plugin update so you can change admin to editor for managing downloads and options. Thank you for the feedback.
Great support Jeff, thanks a lot!
Hi @nhws,
The next version of the plugin (2.2.2) adds two filter hooks that enable you to specify any capability for managing downloads and plugin settings, respectively. Here is an example of how to use:
// simple download counter change capability for download management
function simple_download_counter_capability($capability) { return 'edit_posts'; }
add_filter('simple_download_counter_capability', 'simple_download_counter_capability');
// simple download counter change capability for plugin settings
function simple_download_counter_capability_settings($capability_settings) { return 'edit_posts'; }
add_filter('simple_download_counter_capability_settings', 'simple_download_counter_capability_settings');Simply change
edit_poststo whatever capability you wish. No other changes are necessary 🙂-
This reply was modified 6 months, 3 weeks ago by
Jeff Starr.
-
This reply was modified 6 months, 3 weeks ago by
Jeff Starr.
-
This reply was modified 6 months, 3 weeks ago by
The topic ‘Change capabilities’ is closed to new replies.