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 |
---|---|
426 |
|
427 | if ( user_can_richedit() ) { |
428 | add_filter( 'the_editor_content', 'format_for_editor', 10, 2 ); |
429 | $default_editor = 'tinymce'; |
430 | } else { |
431 | $default_editor = 'html'; |
432 | } |
433 |
|
434 | /** This filter is documented in wp-includes/class-wp-editor.php */ |
435 | $text = apply_filters( 'the_editor_content', $instance['text'], $default_editor ); |
436 |
|
437 | // Reset filter addition. |
438 | if ( user_can_richedit() ) { |
439 | remove_filter( 'the_editor_content', 'format_for_editor' ); |
440 | } |
441 |
|
442 | // Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing. |
443 | $escaped_text = preg_replace( '#</textarea#i', '</textarea', $text ); |
444 |
|