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