我有下面这段代码,它来自WordPress的核心文件/wp-admin/includes/class-wp-posts-list-table.phpPHP编码字符串作为HTML
printf(
'<a class="row-title" href="%s" aria-label="%s">%s%s</a>',
get_edit_post_link($post->ID),
/* translators: %s: post title */
esc_attr(sprintf(__('“%s” (Edit)'), $title)),
$pad,
$title
);
在我的情况,可变$标题包含iconfont HTML即
<i class="fa fa-heart"></i>
的PHP代码都让网络浏览器中显示HTML字符的字符串,而不是我追求的是显示为HTML和渲染日e字体真棒图标。
伊夫试图
htmlentities()
html_entity_decode()
htmlspecialchars()
包装$的标题可以有人帮忙感谢名单
你试过了吗? 'htmlentities($ title,ENT_HTML5);' –