From ae49162491c20cbb60c7dd4418c12a31ce11be98 Mon Sep 17 00:00:00 2001 From: Andrew Ozz Date: Sat, 18 Jan 2014 22:19:07 +0000 Subject: [PATCH] TinyMCE: fix 3.x callbacks added with init.setup as they run before the compat3x plugin is loaded. Ideally this will be fixed internally in TinyMCE, see #24067. git-svn-id: https://develop.svn.wordpress.org/trunk@26982 602fd350-edb4-49c9-b593-d223f7449a82 --- src/wp-includes/class-wp-editor.php | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/wp-includes/class-wp-editor.php b/src/wp-includes/class-wp-editor.php index febd8be1aa..cd557d4e4e 100644 --- a/src/wp-includes/class-wp-editor.php +++ b/src/wp-includes/class-wp-editor.php @@ -447,6 +447,12 @@ final class _WP_Editors { $mceInit['toolbar4'] = ''; } + // Fix 3.x callbacks added with init.setup + if ( ! empty( $mceInit['setup'] ) ) { + $func = $mceInit['setup']; + $mceInit['setup'] = "function( editor ) { editor.on( 'PreInit', function(){ ($func).call( this, editor ); }); }"; + } + self::$mce_settings[$editor_id] = $mceInit; } // end if self::$this_tinymce }