最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Replace plugin HTML to single text using hooks

programmeradmin3浏览0评论

I have a plugin that has HTML div that displays like /<div class="llms-setting-group "><p class="llms-label">General Settings(?s).*<\/table><\/div>/ now I want to replace this to simple hello users. I tried with gettext but I have no success in it. Here is code block that I have used:

function my_text_strings( $translated_text, $text, $domain ) {

if ( $translated_text == '/<div class="llms-setting-group "><p class="llms-label">General Settings(?s).*<\/table><\/div>/') {
$translated_text = 'Hello Users!';
}

return $translated_text;
}
add_filter( 'gettext', 'my_text_strings', 20, 3 );
发布评论

评论列表(0)

  1. 暂无评论