Warning: This function has been deprecated. Use format_for_editor() instead.
wp_richedit_pre( string $text )
Formats text for the rich text editor.
Description Description
The ‘richedit_pre’ filter is applied here. If $text
is empty the filter will be applied to an empty string.
See also See also
Parameters Parameters
- $text
-
(string) (Required) The text to be formatted.
Return Return
(string) The formatted text after filter is applied.
Source Source
File: wp-includes/deprecated.php
3583 3584 3585 3586 3587 3588 3589 3590 3591 3592 3593 3594 3595 3596 3597 3598 3599 3600 3601 3602 3603 3604 3605 3606 3607 3608 3609 3610 3611 | function wp_richedit_pre( $text ) { _deprecated_function( __FUNCTION__ , '4.3.0' , 'format_for_editor()' ); if ( empty ( $text ) ) { /** * Filters text returned for the rich text editor. * * This filter is first evaluated, and the value returned, if an empty string * is passed to wp_richedit_pre(). If an empty string is passed, it results * in a break tag and line feed. * * If a non-empty string is passed, the filter is evaluated on the wp_richedit_pre() * return after being formatted. * * @since 2.0.0 * @deprecated 4.3.0 * * @param string $output Text for the rich text editor. */ return apply_filters( 'richedit_pre' , '' ); } $output = convert_chars( $text ); $output = wpautop( $output ); $output = htmlspecialchars( $output , ENT_NOQUOTES, get_option( 'blog_charset' ) ); /** This filter is documented in wp-includes/deprecated.php */ return apply_filters( 'richedit_pre' , $output ); } |
Expand full source code Collapse full source code View on Trac View on GitHub
Changelog Changelog
Version | Description |
---|---|
4.3.0 | Use format_for_editor() |
2.0.0 | Introduced. |