Add More Buttons to Wordpress Editor ~ Western Mass Hosting

Add More Buttons to Wordpress Editor

Add More Buttons to Wordpress Editor

Just a quick one today folks.ย  And this is actually more so I don’t forget it ๐Ÿ™‚

Here is some drop-in code you can add to your theme’s functions.php file that will allow you to add a font size, and font selector to WordPress’s visual editor

// add font type & font size selection option in the WYSIWYG editor
// change mce_buttons_3 to the line number you want to add them to
add_filter( 'mce_buttons_3', function( $buttons ) {
    array_unshift( $buttons, 'fontselect' );
    array_unshift( $buttons, 'fontsizeselect' );
    return $buttons;
} );

And the following will add a few more handy buttons ๐Ÿ™‚

add_filter( "mce_buttons_2", function( $buttons ) {
	array_unshift( $buttons, 'del' );
	array_unshift( $buttons, 'sub' );
	array_unshift( $buttons, 'sup' );
	array_unshift( $buttons, 'cleanup' );
	array_unshift( $buttons, 'styleselect' );
	return $buttons;
} );



Let Us Help

Get You Online

Contact Us Today

Important Cookie Information
Our website uses cookies. By continuing to browse the site you are agreeing to our use of cookies. For more details about cookies and their use, please see our Cookie Policy.