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 |
---|---|
447 |
|
448 | if ( user_can_richedit() ) { |
449 | add_filter( 'the_editor_content', 'format_for_editor', 10, 2 ); |
450 | $default_editor = 'tinymce'; |
451 | } else { |
452 | $default_editor = 'html'; |
453 | } |
454 |
|
455 | /** This filter is documented in wp-includes/class-wp-editor.php */ |
456 | $text = apply_filters( 'the_editor_content', $instance['text'], $default_editor ); |
457 |
|
458 | // Reset filter addition. |
459 | if ( user_can_richedit() ) { |
460 | remove_filter( 'the_editor_content', 'format_for_editor' ); |
461 | } |
462 |
|
463 | // Prevent premature closing of textarea in case format_for_editor() didn't apply or the_editor_content filter did a wrong thing. |
464 | $escaped_text = preg_replace( '#</textarea#i', '</textarea', $text ); |
465 |
|