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 );
  • Are you the plugin author? – simongcc Apr 14 '20 at 6:22
  • No, I'm not an author just a devloper – Shadow Apr 14 '20 at 6:24
  • Because different plugins have different output logic. There are a few options you may try: (1) see the source code of the plugin, and see how does it output and if there is any action or filer you can use to override. This can save your time. (2) Or you may contact the plugin author for help. That's the best suggestion for your situation. – simongcc Apr 14 '20 at 6:35

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.