Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I want to unregister a custom tinymce plugin in one of my child themes. The custom tinymce plugin uses basically:

http://codex.wordpress.org/Plugin_API/Filter_Reference/mce_external_plugins

excerpt:

add_filter( "mce_external_plugins", "foo_add_buttons" );
add_filter( 'mce_buttons', 'foo_register_buttons' );

What is the best way to remove this such that performance is the best? The two options I came up with are:

  1. remove_filter("mce_external_plugins"); & remove_filter( 'mce_buttons', 'foo_register_buttons' );?
  2. add_filter('tiny_mce_before_init', 'disable_mce_buttons'); and simply remove the buttons that the parent theme adds?
share|improve this question

2 Answers 2

Option 2 was the only one that worked correctly.

function disable_mce_buttons($settings){

    $settings['external_plugins'] = '';
    $settings['toolbar3'] = '';
    return $settings;
}
add_filter('tiny_mce_before_init', 'disable_mce_buttons');
share|improve this answer

Option 1 should work if you run the remove_filter on a hook.

function wpa_145664(){
  remove_filter("mce_external_plugins");
  remove_filter( 'mce_buttons', 'foo_register_buttons' );
}
add_action('admin_init', 'wpa_145664');
share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.