|
5 | 5 | * @package WordPress |
6 | 6 | * @since 3.3 |
7 | 7 | * |
| 8 | + * NOTE: Do not instantiate this class directly. Please use the wp_editor() function that will include the file |
| 9 | + * and instantiate the class if needed. If you want to extend this class use the 'init' or earlier action to do it |
| 10 | + * and call wp_editor() as usual when you need to output the HTML. |
| 11 | + * |
8 | 12 | * Outputs the HTML and JavaScript for the WordPress editors, TinyMCE and Quicktags. |
9 | 13 | * TinyMCE is loaded separately from other Javascript by using wp-tinymce.php. It outputs concatenated |
10 | 14 | * pre-compressed version of the core and all default plugins. Additional plugins are loaded directly |
@@ -365,15 +369,15 @@ function editor_settings($editor_id, $set) { |
365 | 369 | } |
366 | 370 |
|
367 | 371 | if ( $set['dfw'] ) { |
368 | | - function replace_fullscreen(&$val) { |
369 | | - if ( $val == 'fullscreen' ) |
370 | | - $val = 'wp_fullscreen'; |
371 | | - } |
372 | | - |
373 | | - array_walk($mce_buttons, 'replace_fullscreen'); |
374 | | - array_walk($mce_buttons_2, 'replace_fullscreen'); |
375 | | - array_walk($mce_buttons_3, 'replace_fullscreen'); |
376 | | - array_walk($mce_buttons_4, 'replace_fullscreen'); |
| 372 | + // replace the first 'fullscreen' with 'wp_fullscreen' |
| 373 | + if ( ($key = array_search('fullscreen', $mce_buttons)) !== false ) |
| 374 | + $mce_buttons[$key] = 'wp_fullscreen'; |
| 375 | + elseif ( ($key = array_search('fullscreen', $mce_buttons_2)) !== false ) |
| 376 | + $mce_buttons_2[$key] = 'wp_fullscreen'; |
| 377 | + elseif ( ($key = array_search('fullscreen', $mce_buttons_3)) !== false ) |
| 378 | + $mce_buttons_3[$key] = 'wp_fullscreen'; |
| 379 | + elseif ( ($key = array_search('fullscreen', $mce_buttons_4)) !== false ) |
| 380 | + $mce_buttons_4[$key] = 'wp_fullscreen'; |
377 | 381 | } |
378 | 382 |
|
379 | 383 | $mceInit = array ( |
|
0 commit comments