X-Git-Url: https://scripts.mit.edu/gitweb/autoinstalls/wordpress.git/blobdiff_plain/0459461f9ea42e0b090759ff6fe5f48360bef750..refs/tags/wordpress-4.5:/wp-includes/class-wp-editor.php?ds=sidebyside diff --git a/wp-includes/class-wp-editor.php b/wp-includes/class-wp-editor.php index a6504d4e..bfbc547a 100644 --- a/wp-includes/class-wp-editor.php +++ b/wp-includes/class-wp-editor.php @@ -251,7 +251,7 @@ final class _WP_Editors { '%s' ); - // Prepare the content for the Visual or Text editor + // Prepare the content for the Visual or Text editor, only when TinyMCE is used (back-compat). if ( self::$this_tinymce ) { add_filter( 'the_editor_content', 'format_for_editor', 10, 2 ); } @@ -261,10 +261,17 @@ final class _WP_Editors { * * @since 2.1.0 * - * @param string $content Default editor content. + * @param string $content Default editor content. + * @param string $default_editor The default editor for the current user. + * Either 'html' or 'tinymce'. */ $content = apply_filters( 'the_editor_content', $content, $default_editor ); + // Remove the filter as the next editor on the same page may not need it. + if ( self::$this_tinymce ) { + remove_filter( 'the_editor_content', 'format_for_editor' ); + } + // Back-compat for the `htmledit_pre` and `richedit_pre` filters if ( 'html' === $default_editor && has_filter( 'htmledit_pre' ) ) { // TODO: needs _deprecated_filter(), use _deprecated_function() as substitute for now @@ -772,6 +779,7 @@ final class _WP_Editors { if ( in_array('wplink', self::$plugins, true) || in_array('link', self::$qt_buttons, true) ) { wp_enqueue_script('wplink'); + wp_enqueue_script( 'jquery-ui-autocomplete' ); } if ( self::$old_dfw_compat ) { @@ -1035,6 +1043,9 @@ final class _WP_Editors { 'No alignment' => __( 'No alignment' ), // Tooltip for the 'alignnone' button in the image toolbar 'Remove' => __( 'Remove' ), // Tooltip for the 'remove' button in the image toolbar 'Edit ' => __( 'Edit' ), // Tooltip for the 'edit' button in the image toolbar + 'Paste URL or type to search' => __( 'Paste URL or type to search' ), // Placeholder for the inline link dialog + 'Apply' => __( 'Apply' ), // Tooltip for the 'apply' button in the inline link dialog + 'Link options' => __( 'Link options' ), // Tooltip for the 'link options' button in the inline link dialog // Shortcuts help modal 'Keyboard Shortcuts' => __( 'Keyboard Shortcuts' ), @@ -1057,6 +1068,8 @@ final class _WP_Editors { __( 'When starting a new paragraph with one of these formatting shortcuts followed by a space, the formatting will be applied automatically. Press Backspace or Escape to undo.' ), 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' => __( 'The following formatting shortcuts are replaced when pressing Enter. Press Escape or the Undo button to undo.' ), + 'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' => + __( 'The next group of formatting shortcuts are applied as you type or when you insert them around plain text in the same paragraph. Press Escape or the Undo button to undo.' ), ); /** @@ -1389,37 +1402,36 @@ final class _WP_Editors { * @static */ public static function wp_link_dialog() { - $search_panel_visible = '1' == get_user_setting( 'wplink', '0' ) ? ' search-panel-visible' : ''; - // display: none is required here, see #WP27605 ?> -