I’ve seen various tutorials on how to modify the menu items of a WordPress Site’s admin, but I’m trying to find a tutorial or way on how to modify the actual admin page labels. Here’s what I mean:
When you are in the 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 Answers
You can modify the labels using gettext
filter hook ex:
add_filter( 'gettext', 'theme_change_label_names');
function theme_change_label_names($translated_text){
if (is_admin()){
switch ( $translated_text ) {
case 'Site Title' :
$translated_text = __( 'New Site Title label', 'theme_text_domain' );
break;
case 'Tagline' :
$translated_text = __( 'new Tagline label', 'theme_text_domain' );
break;
}
}
return $translated_text;
}