Viewing 1 replies (of 1 total)
  • Plugin Author Marco Chiesi

    (@marcochiesi)

    Hi there,
    I am sorry for the late reply. I investigated on the conflict and I found that your plugin uses unconventional ways to perform its operations.

    First, you should call your mce_buttons and mce_external_plugins filter hook handlers from within a function attached to the admin_init hook (see Codex for details).

    Example:

    function psfb_tinymce_button() {
         if ( current_user_can( 'edit_posts' ) && current_user_can( 'edit_pages' ) ) {
    			add_filter('mce_buttons', 'psfb_register_buttons');
    			add_filter('mce_external_plugins', 'psfb_register_tinymce_javascript');
         }
    }

    Second, you shouldn’t echo any output inside a filter hook, in particular you shouldn’t call psfb_add_tinymce_button() from within ‘psfb_register_tinymce_javascript’. Instead you should hook that one on admin_head or something like that.

    Example:

    add_action( 'admin_head', 'psfb_add_tinymce_button' );

    Third, if you need to pass parameters from PHP to javascript I would suggest to use the wp_localize_script function instead of echoing a script in the head of the page.

    Fourth, for inline styles I would suggest the use of wp_add_inline_style.

Viewing 1 replies (of 1 total)
  • The topic ‘mce_external_plugins filter suppresses output of other plugins’ is closed to new replies.