admin管理员组文章数量:1405165
I have a textarea inside a custom widget that needs to hold some html tags. I've noticed that if I use the esc_html
or esc_attr
or strip_tags
to take the things secure, I will lost all the html I use. How I can keep the html tags in place, I just need to add an <i>
tag and <p>
or <h>
, <a>
tags.
Any suggestion?
I have a textarea inside a custom widget that needs to hold some html tags. I've noticed that if I use the esc_html
or esc_attr
or strip_tags
to take the things secure, I will lost all the html I use. How I can keep the html tags in place, I just need to add an <i>
tag and <p>
or <h>
, <a>
tags.
Any suggestion?
1 Answer
Reset to default 1Use wp_kses_post
instead! It will keep all the tags allowed in a post, you can also use wp_kses
and provide a list of tags and attributes
本文标签: phpSave html content of a widget textarea
版权声明:本文标题:php - Save html content of a widget textarea 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744887575a2630577.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论