Skip Navigation

[Resolved] Disable the plugin for non admin WP users ?

This thread is resolved. Here is a description of the problem and solution.

Problem: I would like to remove the Toolset menu from wp-admin for non-administrator Users.

Solution: Add the following code to your child theme's functions.php file:

add_action( 'admin_menu', 'my_remove_menu_pages', 99 );
 
function my_remove_menu_pages() {
 
remove_menu_page('wpcf');
 
}
This support ticket is created 6 years, 8 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

Tagged: 

This topic contains 5 replies, has 2 voices.

Last updated by michaelS-48 6 years, 8 months ago.

Assisted by: Christian Cox.

Author
Posts
#737092

When I installed the plugin and activated it, It also activate the plugin for non admin users. An Editor when logs in to the site can use Types. How do I restrict the plugin only to admins ? Or yet ony to certain user types ?

Thanks

#737630

Hi, you can use Types Access to manage individual User role capabilities, or you can place this custom code in your child theme's functions.php file:

add_action( 'admin_menu', 'my_remove_menu_pages', 99 );

function my_remove_menu_pages() {

remove_menu_page('wpcf');

}
#743120
User Role.PNG
WP Screen Capture.PNG

Hi Christian

I placed the custom in the functions.php code of my chil theme but didn't seem it worked. I have a user "garen05" as Author Role , but when logs in , still sees the Toolset menu. Please see attached.

Thanks,
- Garen

#744493

Okay thanks, I see you're working on a Multisite Installation. Let me get some additional information about that setup and confirm the best approach. Please stand by and I will update you shortly.

#744777

Okay this isn't normal, an Author does not usually have access to the Toolset menu. Can you try the following troubleshooting steps for me?
- Temporarily deactivate all plugins except Types
- Temporarily comment out all the other non-essential code in your functions.php file
- Log out and log back in as the Author
- Is the Author an active User in another site in this Multisite network?

#779796

I have a Members plugin that was messing up the Author capabilities.

Thanks