attribute_escape

函式
attribute_escape ( $text )
引數
  • (string) $text
    Required:
返回值
  • (string)
相關
  • esc_attr()
定義位置
相關方法
like_escapetag_escapelanguage_attributesjs_escapepage_attributes_meta_box
引入
2.0.6
棄用
2.8.0

attribute_escape: 這個函式用於轉義HTML屬性以防止XSS(跨站指令碼)攻擊。它有一個引數,即要轉義的屬性。

對HTML屬性進行迴避。

function attribute_escape( $text ) {
	_deprecated_function( __FUNCTION__, '2.8.0', 'esc_attr()' );
	return esc_attr( $text );
}

常見問題

FAQs
檢視更多 >