Warning: This function has been deprecated. Use format_for_editor() instead.

wp_richedit_pre() WordPress Function

The wp_richedit_pre() function allows you to add rich formatting to your posts and pages. This function takes two parameters: the first is the content you want to format, and the second is an array of options. The array of options can include specifying the type of formatting you want to use, such as bold, italic, or underlined. You can also specify the size and color of your text.

wp_richedit_pre( string $text ) #

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.

Top ↑

See also


Top ↑

Parameters

$text

(string)(Required)The text to be formatted.


Top ↑

Return

(string) The formatted text after filter is applied.


Top ↑

Source

File: wp-includes/deprecated.php

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 );
}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Use format_for_editor()
2.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.

Show More