0
votes

When you are in the Wordpress back end and you hover over 'Settings', and click 'General', a page comes up with, of course, the general settings for the site. The labels for each input field are as follows: Site Title, Tagline, Wordpress address (URL), Site address (URL), etc.

I'm looking to add a function to my functions.php for a theme that will allow me to change these labels.

Is this even possible? Or do I just have to hard code it in?

2

2 Answers

2
votes

You could create a custom translation, or just hook into Wordpress's translation functions (using the gettext filter) and supply your own translations:

add_filter('gettext', 'my_gettext', 10, 3);

function my_gettext($translation, $text, $domain) {
  if ($text == 'Site Title') {
    $translation = 'Foo Bar';
  }
  return $translation;
}
0
votes

If you want to change the value of the labels, you could write a function that directly updates the setting in wp_options table. If you want to change the labels, the solution posted by Richard M will work.