I’m not sure if there is an official way to do this in TinyMCE 4.0 or not, I can’t find any references in their docs or on WordPress – below is a PHP method you could use to do this:
function myformatTinyMCE($in)
{
$del_buttons = array('bold', 'italic', 'strikethrough');
$temp = explode(',', $in['toolbar1']);
foreach($del_buttons as $del){
if(($key = array_search($del, $temp)) !== false){
unset($temp[$key]);
}
}
$temp = array_values($temp);
$in['toolbar1'] = implode(',', $temp);
return $in;
}
add_filter('tiny_mce_before_init', 'myformatTinyMCE', 10);
- Split Toolbar String into an Array
- Loop through our Delete array, if the value is in Temp, set the key
- Unset our button from our temp array
- Fix our values
- Convert it back to a string and set it back to Toolbar1