Ticket #20822: 20822.patch
| File 20822.patch, 1.5 KB (added by , 12 years ago) |
|---|
-
src/wp-includes/class-wp-editor.php
31 31 $set = wp_parse_args( $settings, array( 32 32 'wpautop' => true, // use wpautop? 33 33 'media_buttons' => true, // show insert/upload button(s) 34 'default_editor' => '', // When both TinyMCE and Quicktags are used, set which editor is shown on loading the page 34 35 'textarea_name' => $editor_id, // set the textarea name to something different, square brackets [] can be used here 35 36 'textarea_rows' => 20, 36 37 'tabindex' => '', … … 100 101 if ( !current_user_can( 'upload_files' ) ) 101 102 $set['media_buttons'] = false; 102 103 103 if ( self::$this_quicktags && self::$this_tinymce ) { 104 $switch_class = 'html-active'; 104 if ( ! self::$this_quicktags && self::$this_tinymce ) { 105 $switch_class = 'tmce-active'; 106 } elseif ( self::$this_quicktags && self::$this_tinymce ) { 107 $default_editor = $set['default_editor'] ? $set['default_editor'] : wp_default_editor(); 105 108 106 // 'html' and 'switch-html' areused for the "Text" editor tab.107 if ( 'html' == wp_default_editor()) {109 // 'html' is used for the "Text" editor tab. 110 if ( 'html' === $default_editor ) { 108 111 add_filter('the_editor_content', 'wp_htmledit_pre'); 112 $switch_class = 'html-active'; 109 113 } else { 110 114 add_filter('the_editor_content', 'wp_richedit_pre'); 111 115 $switch_class = 'tmce-active';