Make WordPress Core

Opened 13 years ago

Closed 13 years ago

#19648 closed defect (bug) (fixed)

mce_external_languages/plugins prints twice

Reported by: cyapow's profile Cyapow Owned by: duck_'s profile duck_
Milestone: 3.4 Priority: normal
Severity: normal Version: 3.3
Component: TinyMCE Keywords: has-patch
Focuses: Cc:

Description

When adding a language using the 'mce_external_languages' filter the contents get printed for each external plugin loaded.

to fix wp-includes/class.wp-editor.php line 210 add

self::$ext_plugins .= $ext_plugins;

same file line 212 add

$ext_plugins = '';

(first one goes before the foreach loop and the second goes at the beginning of the loop)

Attachments (2)

19648.patch (538 bytes) - added by SergeyBiryukov 13 years ago.
class-wp-editor.php.patch (1.6 KB) - added by azaozz 13 years ago.
Almost the same as 20030.diff and 19648.patch but keep self::$ext_plugins .= $ext_plugins; in the code block that runs only once per load.

Download all attachments as: .zip

Change History (6)

#1 @SergeyBiryukov
13 years ago

  • Keywords has-patch added

#2 @SergeyBiryukov
13 years ago

  • Milestone changed from Awaiting Review to 3.4

#3 @duck_
13 years ago

  • Summary changed from mce_external_languages prints twice to mce_external_languages/plugins prints twice

Also: #20030 and 20030.diff

Bug can be replicated for external plugins with:

function trac20030_mce_external_plugins( $plugins ) {
   $plugins['myplugin1'] = WP_PLUGIN_URL . '/myplugin1.js';
   $plugins['myplugin2'] = WP_PLUGIN_URL . '/myplugin2.js';
   return $plugins;
}
add_filter( 'mce_external_plugins', 'trac20030_mce_external_plugins' );

@azaozz
13 years ago

Almost the same as 20030.diff and 19648.patch but keep self::$ext_plugins .= $ext_plugins; in the code block that runs only once per load.

#4 @duck_
13 years ago

  • Owner set to duck_
  • Resolution set to fixed
  • Status changed from new to closed

In [19913]:

Stop WP_Editor from outputting TinyMCE external plugins/languages multiple times. Props Cyapow. Fixes #19648.

Note: See TracTickets for help on using tickets.