Support

Account

Home Forums General Issues Remove/filter WSIWYG output – remove HTML tags Reply To: Remove/filter WSIWYG output – remove HTML tags

  • Hi Elliot,

    I’ve just copied the code from you example as below – but the strange thing is that there isn’t any code on line 35 – the file ends on line 33 … I created the functions.php file just for this so it’s the only thing in it?

    Is it because I’ve closed the php tag at the end – I’m sure I read somewhere it can cause problems?

    Entire code of functions.php

    <?php
     
    add_filter( 'acf/fields/wysiwyg/toolbars' , 'my_toolbars'  );
    function my_toolbars( $toolbars )
    {
    	// Uncomment to view format of $toolbars
    	/*
    	echo '< pre >';
    		print_r($toolbars);
    	echo '< /pre >';
    	die;
    	*/
     
    	// Add a new toolbar called "Very Simple"
    	// - this toolbar has only 1 row of buttons
    	$toolbars['Very Simple' ] = array();
    	$toolbars['Very Simple' ][1] = array('bold' , 'italic' , 'underline' );
     
    	// Edit the "Full" toolbar and remove 'code'
    	// - delet from array code from http://stackoverflow.com/questions/7225070/php-array-delete-by-value-not-key
    	if( ($key = array_search('code' , $toolbars['Full' ][2])) !== false )
    	{
    	    unset( $toolbars['Full' ][2][$key] );
    	}
     
    	// remove the 'Basic' toolbar completely
    	//unset( $toolbars['Basic' ] );
     
    	// return $toolbars - IMPORTANT!
    	return $toolbars;
    }
     
    ?>