Loading ...
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;
} );