allowed_tags

函数
allowed_tags ( No parameters )
返回值
  • (string) HTML allowed tags entity encoded.
定义位置
相关方法
get_allowed_themesadd_allowed_optionswp_allowed_protocolsbalancetagsget_allowed_http_origins
引入
1.0.1
弃用
-

allowed_tags: 这是一个WordPress的函数,它返回一个允许的HTML标签和属性数组,用于wp_kses函数。

以HTML格式显示所有允许的标签和属性。

这对在评论区显示哪些元素和属性是支持的很有用。以及任何想要显示它的插件。

function allowed_tags() {
	global $allowedtags;
	$allowed = '';
	foreach ( (array) $allowedtags as $tag => $attributes ) {
		$allowed .= '<' . $tag;
		if ( 0 < count( $attributes ) ) {
			foreach ( $attributes as $attribute => $limits ) {
				$allowed .= ' ' . $attribute . '=""';
			}
		}
		$allowed .= '> ';
	}
	return htmlentities( $allowed );
}

常见问题

FAQs
查看更多 >
闪电侠

(工作日 10:00 - 18:30 为您服务)

2026-01-29 11:09:38

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: