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