WordPress功能函数allowed_tags()

WordPress功能函数allowed_tags(),使用属性显示HTML格式的所有允许的标签。

用法:

allowed_tags()

描述

这对于在注释区域中显示很有用,该区域支持哪些元素和属性。以及任何想要显示它的插件。

返回

(string)HTML允许标签实体编码。

来源

文件: wp-includes/general-template.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 );

}

更新日志:
WordPress功能函数allowed_tags() (https://www.wp-admin.cn/) WordPress开发教程 第1张
用户贡献的笔记

(由Nilambar Sharma于5年前贡献)

显示允许的HTML标签

$allowed_html_tags = allowed_tags();

echo $allowed_html_tags;

输出:

<a href=”” title=””> <abbr title=””> <acronym title=””> <b> <blockquote cite=””> <cite> <code> <del datetime=””> <em> <i> <q cite=””> <s> <strike> <strong>

相关推荐

发表回复

房先生
我们将24小时内回复。
2024-05-11 05:20:33
您好,有任何疑问请与我们联系!
您的工单我们已经收到,我们将会尽快跟您联系!
[QQ客服]
2781198
加我微信
[电话联系]
13585372227
[电子邮件]
chaoneo@163.com
取消

选择聊天工具: