Menu Adam R Brown

WP hooks navigation: Home/browseActions indexFilters index

Source View: the_editor_content

To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).

Understanding Source Code

The best way to understand what a hook does is to look at where it occurs in the source code.

Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.

Source View

Line Code
457
458                if ( user_can_richedit() ) {
459                     add_filter( 'the_editor_content', 'format_for_editor', 10, 2 );
460                     $default_editor = 'tinymce';
461                } else {
462                     $default_editor = 'html';
463                }
464
465                /** This filter is documented in wp-includes/class-wp-editor.php */
466                $text = apply_filters( 'the_editor_content', $instance['text'], $default_editor );
467
468                // Reset filter addition.
469                if ( user_can_richedit() ) {
470                     remove_filter( 'the_editor_content', 'format_for_editor' );
471                }
472
473                // Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing.
474                $escaped_text = preg_replace( '#</textarea#i', '&lt;/textarea', $text );
475