On this page
wp_richedit_pre( string $text ): string
This function has been deprecated. Use format_for_editor() instead.
Formats text for the rich text editor.
Description
The ‘richedit_pre’ filter is applied here. If $text is empty the filter will be applied to an empty string.
See also
Parameters
$textstring Required-
The text to be formatted.
Return
string The formatted text after filter is applied.
Source
File: wp-includes/deprecated.php. View all references
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 );
}
Hooks
- apply_filters( 'richedit_pre',
string $output ) -
Filters text returned for the rich text editor.
Related
Uses
| Uses | Description |
|---|---|
| convert_chars() wp-includes/formatting.php | Converts lone & characters into |
| wpautop() wp-includes/formatting.php | Replaces double line breaks with paragraph elements. |
| _deprecated_function() wp-includes/functions.php | Marks a function as deprecated and inform when it has been used. |
| apply_filters() wp-includes/plugin.php | Calls the callback functions that have been added to a filter hook. |
| get_option() wp-includes/option.php | Retrieves an option value based on an option name. |
Changelog
| Version | Description |
|---|---|
| 4.3.0 | Use format_for_editor() |
| 2.0.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/functions/wp_richedit_pre