使用属性以HTML格式显示所有允许的标记。
原型
allowed_tags()
描述
这对于在注释区域中显示支持哪些元素和属性很有用。以及任何想要显示它的插件。
返回值
(string)
HTML允许标签实体编码。
源文件
路径:wp-includes/general-template.php
<?php
...
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 );
}
...
?>
其他
英文文档:https://developer.wordpress.org/reference/functions/allowed_tags/