关于_e()函数的嵌套转义

时间:2012-09-19 09:05:09

标签: php wordpress escaping translation

这里有关于stackoverflow的第一个问题:我想在php内部转义html然后再次在html php内部并从_e()函数返回一个字符串。我不确定“行话”是否正确。所以情况就是这样:

return '...<span class="strike"></span><a class="read-more" href="'. 
get_permalink($post->ID) . '" title="'.get_the_title($post->ID).'">Read more</a>';

“阅读更多”应替换为

_e( 'Read more', 'mytheme' )

能够翻译这个词。

我尝试了一切。所有帮助表示赞赏。

1 个答案:

答案 0 :(得分:0)

怎么样:

return '...<span class="strike"></span><a class="read-more" href="'. 
get_permalink($post->ID) . '" title="'.get_the_title($post->ID).'">'._e( 'Read more', 'mytheme' ).'</a>';