Skip to content

Instantly share code, notes, and snippets.

@certainlyakey
Created March 16, 2018 10:01
Show Gist options
  • Save certainlyakey/5fd8a1b6c52c9adce897772d6c04bb21 to your computer and use it in GitHub Desktop.
Save certainlyakey/5fd8a1b6c52c9adce897772d6c04bb21 to your computer and use it in GitHub Desktop.
Remove unwanted buttons from TinyMCE editor (Wordpress)
<?php
function tiny_mce_remove_unused_buttons_row_1($buttons) {
$remove = array('wp_more', 'aligncenter', 'alignleft', 'alignright');
return array_diff($buttons,$remove);
}
add_filter('mce_buttons','tiny_mce_remove_unused_buttons_row_1');
function tiny_mce_remove_unused_buttons_row_2($buttons) {
$remove = array('forecolor');
return array_diff($buttons,$remove);
}
add_filter('mce_buttons_2','tiny_mce_remove_unused_buttons_row_2');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment