• Resolved calypso88

    (@calypso88)


    Hi,
    Is there a way to hide the “add form” button that appears above the wysiwyg editor? I’m using the classic editor plugin. I generally create editor users for my clients and they don’t need the ability to add forms.
    Any help appreciated, thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Williams – WPMU DEV Support

    (@wpmudev-support8)

    Hi @calypso88

    I hope you’re well today!

    There’s currently no option to disable it directly from the plugin but it can be done with a bit of additional custom code:

    <?php 
    
    add_action( 'admin_init', function(){
    	global $wp_filter;
    	$tag 			= 'media_buttons';
    	$hook_method	= 'attach_button';
    	$hook_class 	= 'Forminator_Shortcode_Generator';
    	if ( ! isset( $wp_filter[$tag] ) ) {
    		return;
    	}
    	
    	foreach ( $wp_filter[$tag]->callbacks as $key => $callback_array ) {
    		foreach ( $callback_array as $c_key => $callback ) {
    			if ( substr_compare( $c_key, $hook_method, strlen( $c_key ) - strlen( $hook_method ), strlen( $hook_method ) ) === 0 ) {
    				if ( $callback['function'][0] instanceof $hook_class ){
    					unset( $wp_filter[$tag]->callbacks[$key][$c_key] );
    				}
    			}
    		}
    	}
    }, 11 );

    To add it to the site:

    – create an empty file with a .php extension (e.g. “forminator-remove-editor-button.php”)
    – copy and paste code into it
    – upload it to the “/wp-content/mu-plugins” folder of your site’s WordPress installation

    It should work out of the box.

    Best regards,
    Adam

    Plugin Support Amin – WPMU DEV Support

    (@wpmudev-support2)

    Hello @calypso88 ,

    We haven’t heard from you for a while now, so it looks like you don’t need our assistance anymore.

    Feel free to re-open this ticket if needed.

    Kind regards
    Kasia

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Hide Add Form button’ is closed to new replies.