WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/22/2015 10:39:01 PM (4 years ago)
Author:
azaozz
Message:

Editor: remove the format_for_editor filter from the_editor_content after it runs as the next editor instance on the same page may not need it.

Props marcochiesi, azaozz.
Fixes #28403.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-editor.php

    r35904 r36062  
    252252            'id="' . $editor_id_attr . '">%s</textarea></div>' );
    253253
    254         // Prepare the content for the Visual or Text editor
     254        // Prepare the content for the Visual or Text editor, only when TinyMCE is used (back-compat).
    255255        if ( self::$this_tinymce ) {
    256256            add_filter( 'the_editor_content', 'format_for_editor', 10, 2 );
     
    267267         */
    268268        $content = apply_filters( 'the_editor_content', $content, $default_editor );
     269
     270        // Remove the filter as the next editor on the same page may not need it.
     271        if ( self::$this_tinymce ) {
     272            remove_filter( 'the_editor_content', 'format_for_editor' );
     273        }
    269274
    270275        // Back-compat for the `htmledit_pre` and `richedit_pre` filters
Note: See TracChangeset for help on using the changeset viewer.