我想在我的博客上使用缅甸Unicode文本。不幸的是,伪Unicode缅甸字体很常见。因此,我正在编写一个插件,它将使用HTML span标记包围所有缅甸短语,并使用css选择适当的字体。
对于内容、评论等,一切都很好。但是,在使用\\u title挂钩添加HTML之后,该HTML会被转义,然后包含在最近的帖子部分中链接标记的title属性中。此外,我在我的管理帖子屏幕上看到帖子名称中的原始HTML标记。
我应该如何着手解决这个问题?我更喜欢在插件中做任何事情,而不是更改主题文件或其他什么。
这是我的代码:
add_filter( \'the_title\', \'addThemSpans\');
function addThemSpans($theTitle) {
// functionality to add span tags to $theTitle so that a title that looks like this...
// LatinTextHere ကကကကက MoreLatinText
// becomes this...
// LatinTextHere <span class="myText">ကကကကက</span> MoreLatinText
// in the final output.
return $theModifiedTitle;
}
现在,最近发布的侧栏小部件中链接的标题属性设置为:LatinTextHere <span class='myText'>ကကကကက</span><span class=\'myText\'>ကကကကက</span> MoreLatinText
这是不对的。