1

So this is my first run at a plugin. I built a "Toolbox" plugin for myself that I can add things to as I feel needed. Right now the plugin only has one feature and that is to create a new role named "Client". What it does is makes a hybrid of the Administrator and Editor role. It is so the client cant update something or change the permalink settings, but still can create users (I made it so this role can not create an admin) and other things admins can do.

What I have come into as a problem is if a plugin has settings that are supposed to be for admin only but I want the "Client" to have access too as well. Use Yoast for example, what if this client has SEO knowledge so doesnt want me to do their SEO for them, how can I give them access to the Yoast settings? I know when I include ACF into themes I can use

// Hide ACF field group menu item
add_filter('acf/settings/show_admin', '__return_false');

to hide the Custom Fields menu in the admin panel.

My overall goal is to have a list of checkboxes of my most used plugins (I do my best not to use many) that I can check to give them access. I just dont know what I would need to hook to, to be able to do that.

1

try using

  current_user_can( $capability , $object_id );

Reference: https://codex.wordpress.org/Function_Reference/current_user_can#Usage

  • Thanks, I looked into this and I am not sure how this will work. Yoast for example hooks to the manage_options which I have turned off because this is also what the Settings is under. So I cant change the capability to true because then they can change the settings too. – Vincent Cerone May 18 '17 at 18:21
0

You can use this plugin :

https://wordpress.org/plugins/advanced-access-manager/

it allows you to manage the users roles and permissions, for plugins and even you can define specific pages to be shown for a certain use role.

thanks, Muhammad

  • Thanks, but I am trying to make my own plugin, not use someone else plugin. – Vincent Cerone May 18 '17 at 18:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.