WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )
apply_filters( "hook_name", "what_to_filter" )
.Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
Line | Code |
---|---|
465 |
|
466 | if ( user_can_richedit() ) { |
467 | add_filter( 'the_editor_content', 'format_for_editor', 10, 2 ); |
468 | $default_editor = 'tinymce'; |
469 | } else { |
470 | $default_editor = 'html'; |
471 | } |
472 |
|
473 | /** This filter is documented in wp-includes/class-wp-editor.php */ |
474 | $text = apply_filters( 'the_editor_content', $instance['text'], $default_editor ); |
475 |
|
476 | // Reset filter addition. |
477 | if ( user_can_richedit() ) { |
478 | remove_filter( 'the_editor_content', 'format_for_editor' ); |
479 | } |
480 |
|
481 | // Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing. |
482 | $escaped_text = preg_replace( '#</textarea#i', '</textarea', $text ); |
483 |
|