format_for_editor
Filters the text after it is formatted for the editor.
Использование
add_filter( 'format_for_editor', 'wp_kama_format_for_editor_filter', 10, 2 ); /** * Function for `format_for_editor` filter-hook. * * @param string $text The formatted text. * @param string $default_editor The default editor for the current user. It is usually either 'html' or 'tinymce'. * * @return string */ function wp_kama_format_for_editor_filter( $text, $default_editor ){ // filter... return $text; }
- $text(строка)
- The formatted text.
- $default_editor(строка)
- The default editor for the current user. It is usually either 'html' or 'tinymce'.
Список изменений
С версии 4.3.0 | Введена. |
Где вызывается хук
format_for_editor
wp-includes/formatting.php 4399
return apply_filters( 'format_for_editor', $text, $default_editor );