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
檢視更多 >