Created
February 8, 2018 21:30
-
-
Save themeblvd/29745ee2d0b583bac3398f0b019dce1a to your computer and use it in GitHub Desktop.
Customize TinyMCE of Theme Blvd `editor` type options to be more like the default WP editor. Requies Theme Blvd Framework 2.7.2+.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Customize TinyMCE plugins with Theme Blvd `editor` | |
* type options. | |
*/ | |
function my_editor_tinymce_plugins( $plugins ) { | |
$plugins = array( | |
'charmap', | |
'colorpicker', | |
'hr', | |
'lists', | |
'media', | |
'paste', | |
'tabfocus', | |
'textcolor', | |
'fullscreen', | |
'wordpress', | |
'wpautoresize', | |
'wpeditimage', | |
'wpemoji', | |
'wpgallery', | |
'wplink', | |
'wpdialogs', | |
'wptextpattern', | |
'wpview', | |
'image', | |
); | |
return $plugins; | |
} | |
add_filter( 'themeblvd_editor_tinymce_plugins', 'my_editor_tinymce_plugins' ); | |
/** | |
* Customize TinyMCE buttons with Theme Blvd `editor` | |
* type options. | |
*/ | |
function my_editor_tinymce_toolbar( $buttons ) { | |
// First row of buttons. | |
$buttons['toolbar1'] = array( | |
'formatselect', | |
'bold', | |
'italic', | |
'bullist', | |
'numlist', | |
'blockquote', | |
'alignleft', | |
'aligncenter', | |
'alignright', | |
'link', | |
'wp_more', | |
'spellchecker', | |
'wp_adv', | |
); | |
// Second row of buttons. | |
$buttons['toolbar2'] = array( | |
'strikethrough', | |
'hr', | |
'forecolor', | |
'pastetext', | |
'removeformat', | |
'charmap', | |
'outdent', | |
'indent', | |
'undo', | |
'redo', | |
'wp_help', | |
); | |
return $buttons; | |
} | |
add_filter( 'themeblvd_editor_tinymce_toolbar', 'my_editor_tinymce_toolbar' ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment