wp_pre_kses_less_than_callback

函式
wp_pre_kses_less_than_callback ( $matches )
引數
  • (string[]) $matches Populated by matches to preg_replace.
    Required:
返回值
  • (string) The text returned after esc_html if needed.
定義位置
相關方法
wp_pre_kses_less_thanwp_rel_callbackwp_rel_nofollow_callbackwp_targeted_link_rel_callbackwp_mediaelement_fallback
引入
2.3.0
棄用
-

wp_pre_kses_less_than_callback: 這個過濾器是用來過濾小於符號(<)的,在它被淨化之前使用一個自定義的回撥函式。它用於確保該符號在HTML輸出中的安全使用。 preg_replace使用的回撥函式。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
function wp_pre_kses_less_than_callback( $matches ) {
if ( false === strpos( $matches[0],>) ) {
return esc_html( $matches[0] );
}
return $matches[0];
}
function wp_pre_kses_less_than_callback( $matches ) { if ( false === strpos( $matches[0], ‘>’ ) ) { return esc_html( $matches[0] ); } return $matches[0]; }
function wp_pre_kses_less_than_callback( $matches ) {
	if ( false === strpos( $matches[0], ‘>’ ) ) {
		return esc_html( $matches[0] );
	}
	return $matches[0];
}

常見問題

FAQs
檢視更多 >