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

wp_htmledit_pre() WordPress Function

The wp_htmledit_pre() function is used to process text before it is added to the WordPress database. This function is especially useful for making sure that text is properly formatted for display in the WordPress editor.

wp_htmledit_pre( string $output ) #

Formats text for the HTML editor.


Description

Unless $output is empty it will pass through htmlspecialchars before the ‘htmledit_pre’ filter is applied.

Top ↑

See also


Top ↑

Parameters

$output

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


Top ↑

Return

(string) Formatted text after filter applied.


Top ↑

Source

File: wp-includes/deprecated.php

function wp_htmledit_pre($output) {
	_deprecated_function( __FUNCTION__, '4.3.0', 'format_for_editor()' );

	if ( !empty($output) )
		$output = htmlspecialchars($output, ENT_NOQUOTES, get_option( 'blog_charset' ) ); // Convert only '< > &'.

	/**
	 * Filters the text before it is formatted for the HTML editor.
	 *
	 * @since 2.5.0
	 * @deprecated 4.3.0
	 *
	 * @param string $output The HTML-formatted text.
	 */
	return apply_filters( 'htmledit_pre', $output );
}


Top ↑

Changelog

Changelog
VersionDescription
4.3.0Use format_for_editor()
2.5.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