Home › Toolset Professional Support › [Resolved] Hide WYSIWYG control in backend custom post
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 |
---|---|---|---|---|---|---|
- | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | 9:00 – 13:00 | - |
- | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | 14:00 – 18:00 | - |
Supporter timezone: Asia/Karachi (GMT+05:00)
Tagged: Setting up custom fields, Types plugin
Related documentation:
This topic contains 1 reply, has 2 voices.
Last updated by Waqar 3 years, 8 months ago.
Assisted by: Waqar.
Hi,
Thank you for contacting us and I'd be happy to assist.
To hide the font selection dropdown from the WYSIWYG type custom fields, for the users with the "editor" role, you can use the following custom code snippet:
add_action('admin_head', 'custom_styles_hide_editor_font'); function custom_styles_hide_editor_font() { // get current user $current_user = wp_get_current_user(); // get current user's roles $current_user_roles = ( array ) $current_user->roles; // target roles to apply the style for $target_roles = array('editor'); // if current user's role is included in the target roles, add the custom style if (count(array_intersect($current_user_roles, $target_roles)) > 0) { echo '<style>.js-wpt-field.js-wpt-wysiwyg .js-wpt-field-items .mce-widget.mce-btn.mce-listbox.mce-first.mce-btn-has-text {display:none;}</style>'; } }
The above code snippet can be included through either Toolset's custom code feature ( ref: https://toolset.com/documentation/adding-custom-code/using-toolset-to-add-custom-code/ ) or through the active theme's "functions.php" file.
Note: The custom code examples from our forum are shared to get you started in the right direction. You're welcome to adjust them as needed and for more personalized customization assistance, you can consider hiring a professional from our list of recommended contractors:
https://toolset.com/contractors/
regards,
Waqar