WordPress函数:tag_escape 转义tag名称中的HTML标签

江河/ 01月17日/ WordPress/ 浏览 583

函数原型:


tag_escape( string $tag_name ): string


转义tag名称中的HTML标签


参数说明:


$tag_name 标签名称


返回值:


转义后得标签名称


函数源码:


function tag_escape( $tag_name ) {
	$safe_tag = strtolower( preg_replace( '/[^a-zA-Z0-9_:]/', '', $tag_name ) );
	return apply_filters( 'tag_escape', $safe_tag, $tag_name );
}


包含钩子:


apply_filters( ‘tag_escape’, string $safe_tag, string $tag_name )


发表评论

暂无评论,抢个沙发...

客服 工单