返回介绍

wp_richedit_pre()

发布于 2017-09-11 12:46:53 字数 2412 浏览 1059 评论 0 收藏 0

Warning: This function has been deprecated.

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.


参数

$text

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


返回值

(string) The formatted text after filter is applied.


源代码

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

更新日志

Versiondescription
4.3.0This function has been deprecated.
2.0.0Introduced.

相关函数

Uses

  • wp-includes/deprecated.php: richedit_pre
  • wp-includes/formatting.php: convert_chars()
  • wp-includes/formatting.php: wpautop()
  • wp-includes/functions.php: _deprecated_function()
  • wp-includes/plugin.php: apply_filters()
  • wp-includes/option.php: get_option()
  • Show 1 more use Hide more uses

User Contributed Notes

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
    我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
    原文