Please or Register to create posts and topics.

How to change the word Guest to Member?

Forum topics and replies by guests are attributed to the word “Guest.” I’d like to change that to “Members.” How can I do that?

Hello jpschwartz,

you can have a look at the following WordPress-extensions which allows you to change outputs to a custom string without modifying/adding code:

Say what?

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!

I’ve looked into the plugin, but I’d be more comfortable with a script to put into functions.php in my child template. Can you suggest one?

Thanks,

Jim

You can try the following code:

add_filter('ngettext', 'change_ntranslations', 20, 5);
add_filter('gettext', 'change_translations', 20, 3);

function change_translations($translated_text, $untranslated_text, $domain) {
  if ($domain === 'asgaros-forum') {
    switch ($translated_text) {
      case 'Guest':
        $translated_text = 'Member';
      break;
    }
  }

  return $translated_text;
}

function change_ntranslations($translation, $single, $plural, $number, $domain) {
  if ($domain === 'asgaros-forum') {
    $translation = change_translations($translation, '', 'asgaros-forum');
  }

  return $translation;
}

 

If you want to support the development of Asgaros Forum, you can leave a good review or donate. Thank you very much!