【发布时间】:2019-05-30 14:57:23
【问题描述】:
我需要用粗体显示“Located:”这个词,但不知道在哪里放置标签,这样它们就不会打印或破坏代码。
在此处阅读其他主题,将粗体标签放在位置:但它们只是打印。尝试移动标签,但它破坏了代码。
/* translators: used between list items, there is a space after the comma
*/
$tags_list = get_the_tag_list( '', esc_html__( ', ', 'vogue' ) );
if ( $tags_list ) {
printf( '<br /><br /><span class="tags-links">' . esc_html__( '<b>Located:</b> %1$s', 'vogue' ) . '</span>', $tags_list ); // WPCS: XSS OK
}
【问题讨论】:
-
将整个定位的部分移出esc_html,这样唯一通过esc_html运行的就是
%1$s
标签: php html wordpress escaping