Remove blockquote button from tinymce toolbar

This commit is contained in:
IanDelMar 2021-07-30 12:36:26 +02:00
parent 4fdcd102f1
commit f151abf8d3
1 changed files with 24 additions and 0 deletions

View File

@ -83,3 +83,27 @@ if ( ! function_exists( 'understrap_tiny_mce_before_init' ) ) {
return $settings;
}
}
add_filter( 'mce_buttons', 'understrap_tiny_mce_blockquote_button' );
if ( ! function_exists( 'understrap_tiny_mce_blockquote_button' ) ) {
/**
* Removes the blockquote button from the TinyMCE toolbar.
*
* We provide the blockquote via the style formats. Using the style formats
* blockquote receives the proper Bootstrap classes.
*
* @see understrap_tiny_mce_before_init()
*
* @param array $buttons TinyMCE buttons array.
* @return array TinyMCE buttons array without the blockquote button.
*/
function understrap_tiny_mce_blockquote_button( $buttons ) {
foreach ( $buttons as $key => $button ) {
if ( 'blockquote' === $button ) {
unset( $buttons[ $key ] );
}
}
return $buttons;
}
}