Skip to content

Instantly share code, notes, and snippets.

@andyknapp
Created June 20, 2013 02:13
Show Gist options
  • Save andyknapp/5819822 to your computer and use it in GitHub Desktop.
Save andyknapp/5819822 to your computer and use it in GitHub Desktop.
WP admin tinyMCE customization
// top row
if(!function_exists('ak_editor_mce_buttons_top')) {
function ak_editor_mce_buttons_top($buttons) {
return array( 'bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'justifyleft', 'justifycenter', 'justifyright', 'spellchecker' );
/* wp defaults
return array(
'bold', 'italic', 'strikethrough', 'separator', 'bullist', 'numlist', 'blockquote', 'separator', 'justifyleft', 'justifycenter', 'justifyright', 'separator',
'link', 'unlink', 'wp_more', 'separator', 'spellchecker', 'fullscreen', 'wp_adv' );
*/
}
add_filter('mce_buttons', 'ak_editor_mce_buttons_top', 0 );
}
// bottom row
if(!function_exists('ak_editor_mce_buttons_bottom')) {
function ak_editor_mce_buttons_bottom($buttons) {
return array( 'undo', 'redo' );
/* wp defaults
return array(
'formatselect', 'underline', 'justifyfull', 'forecolor', 'separator', 'pastetext', 'pasteword', 'removeformat', 'separator', 'media', 'charmap', 'separator',
'outdent', 'indent', 'separator', 'undo', 'redo', 'wp_help' );
*/
}
add_filter('mce_buttons_2', 'ak_editor_mce_buttons_bottom', 0 );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment