Problem: I would like to hide the Toolset toolbar buttons above WYSIWYG editor panels in wp-admin for certain User roles.
Solution: You can use the following code snippet to manage the visibility of these buttons in wp-admin:
function tssupp_remove_admin_toolset_buttons(){ $user = wp_get_current_user(); if ( is_admin() && !in_array( 'administrator', (array) $user->roles ) ) { add_filter( 'toolset_editor_add_form_buttons', '__return_false' ); } } add_action( 'admin_init','tssupp_remove_admin_toolset_buttons', 9 );
Only administrators will see these buttons, but you can adjust the code to support other roles as well.
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)
This topic contains 3 replies, has 2 voices.
Last updated by 3 years, 10 months ago.
Assisted by: Christian Cox.