Problem:
When you enalbe "Allow Media Upload Button" in a CRED Form, with it also the Toolset, Access and CRED buttons will appear in the TinyMCE instance on the Front End.
How can I remove it, but keep the Media Upload Button?
Solution:
There are a few hooks you can use, in your theme's functions.php:
/** * Remove Toolset buttons on front-end editors * which appear for role author+ when insert * media option set on CRED forms * * The filters work globally, so you will need * to add a test, e.g. for the page where the * CRED form is added */ function remove_toolset_buttons(){ // $post not available with init hook $postID = url_to_postid( $_SERVER['REQUEST_URI'] , '_wpg_def_keyword', true ); if ( 19 == $postID ) { // edit with your own condition // remove the Fields and Views button add_filter( 'toolset_editor_add_form_buttons', '__return_false' ); // remove the CRED button add_filter( 'toolset_cred_button_before_print', '__return_false' ); // remove the Access button for certain roles add_filter( 'toolset_editor_add_access_button', function(){ $roles = array( 'author' ); return $roles; } ); } } add_action( 'init', 'remove_toolset_buttons' );
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.
No supporters are available to work today on Toolset forum. Feel free to create tickets and we will handle it as soon as we are online. Thank you for your understanding.
Sun | Mon | Tue | Wed | Thu | Fri | Sat |
---|---|---|---|---|---|---|
- | - | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 | 14:00 – 20:00 |
- | - | - | - | - | - | - |
Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)
This topic contains 7 replies, has 2 voices.
Last updated by kelvinL-2 7 years, 1 month ago.
Assisted by: Beda.