wp_htmledit_pre

函数
wp_htmledit_pre ( $output )
参数
  • (string) $output The text to be formatted.
    Required:
返回值
  • (string) Formatted text after filter applied.
相关
  • format_for_editor()
定义位置
相关方法
wp_richedit_prewp_editorwp_mkdir_pwp_html_splitwp_list_pages
引入
2.5.0
弃用
4.3.0

wp_htmledit_pre: 这是一个过滤钩,用于修改文章编辑器的HTML内容。它接受一个参数,即文章编辑器的HTML内容,并返回修改后的内容。

对HTML编辑器的文本进行格式化。

除非$output为空,否则在{@see ‘htmledit_pre’}过滤器被应用之前,它将通过htmlspecialchars。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
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 );
}
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 ); }
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 );
}

常见问题

FAQs
查看更多 >