• The plugin adds a toolbar in the visual editor where you can add the shortcodes. I’m using Modern Events Calendar that shows visual editor in frontend, and the shortcode toolbar is visible for everyone. This shouldn’t be the case, and I can hide it by hardcoding the plugin, but this change should be in the plugin as default.

    Maybe a settings page where you could control the plugin would be good too.

Viewing 1 replies (of 1 total)
  • Plugin Author shazdeh

    (@shazdeh)

    I’m a bit conflicted by this, I personally prefer plugins that are “in the background” and do their thing; less option pages means less clutter in the admin dashboard.

    This is very easy to achieve though without hardcoding the changes which would be problematic for future updates. You can add this to your theme’s functions.php and it hides the TinyMCE button for this plugin:

    
    function custom_disable_widget_shortcode_mce() {
    	if ( class_exists( 'Widget_Shortcode_TinyMCE' ) ) {
    		remove_filter( 'mce_buttons', array( Widget_Shortcode_TinyMCE::get_instance(), 'mce_buttons' ) );
    	}
    }
    add_action( 'init', 'custom_disable_widget_shortcode_mce' );
    

    You can now further customize it and add additional checks, for example use is_admin() to ensure TinyMCE is loading on admin dashboard, or even current_user_can function so the buttons are displayed based on current user’s roles and capabilities.

    Please let me know if I can be of further help.

Viewing 1 replies (of 1 total)
  • The topic ‘Visual editor, hide toolbar in frontend’ is closed to new replies.