|
Removing buttons for certain user roles for the post editor
Started by: andrewR-7
in: Toolset Professional Support
Quick solution available
Problem:
Remove buttons (fields and views, Content Layout Editor, CRED form, Access, Bootstrap buttons) from backend editor for certain user roles.
Solution:
1. Add this code in your theme’s or child theme’s functions.php file:
add_filter( 'mce_buttons_3', 'remove_bootstrap_buttons', 999 );
function remove_bootstrap_buttons($buttons) {
if( current_user_can('editor') || current_user_can('contributor') ) {
return array();
}
else {
return $buttons;
}
}
add_filter( 'mce_buttons', 'remove_toggle_button', 999 );
function remove_toggle_button($buttons) {
if( current_user_can('editor') || current_user_can('contributor') ) {
$remove = array( 'css_components_toolbar_toggle' );
return array_diff( $buttons, $remove );
}
else {
return $buttons;
}
}
function vm_wptypes_remove() {
if( current_user_can('editor') || current_user_can('contributor') ) {
wp_enqueue_style( 'wp-types-special', get_stylesheet_directory_uri() . '/wp-types-special.css' );
}
}
add_action( 'admin_init', 'vm_wptypes_remove' );
==> In above code, I have used 'editor' and 'contributor' level roles as example, you can replace those with your roles as needed. These are in the if conditional statement.
2. Download & extract this file >> and place this css file in the folder in your site:
wp-content/themes/et/ (inside your theme folder)
CSS file:
https://drive.google.com/file/d/0B5EmJQ1qcuyqTU4xZ3paM01ERmc/view?usp=sharing
Relevant Documentation:
Related ticket: https://toolset.com/forums/topic/how-to-remove-fields-and-views-button-above-post-edit-for-non-admin-users/
|
|
2 |
8 |
7 years, 2 months ago
andrewR-7
|
|
Can I limit some specific role to edit specif pages only with Access Control?
Started by: alessandro2
in: Toolset Professional Support
Quick solution available
|
|
2 |
6 |
7 years, 2 months ago
alessandro2
|
|
WPML Group Access permissions have stopped working suddenly
Started by: leonardF
in: Toolset Professional Support
Quick solution available
Problem:
Recent update of WPML plugins and WordPress breaks the Access functionality.
Solution:
Reset or Remove all Access settings then add all the settings again. Also enable the "Publish" option in the Access.
|
|
2 |
5 |
7 years, 2 months ago
leonardF
|
|
Assign normal user as author of a custom post
Started by: martijnH
in: Toolset Professional Support
Quick solution available
|
|
2 |
3 |
7 years, 4 months ago
martijnH
|