Sauter la navigation

[Résolu] Customizing login / password reset form fields labels

This support ticket is created Il y a 6 années. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Marqué : 

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 6 années.

Assisté par: Nigel.

Auteur
Publications
#1184576

It's probably something simple, but I'd need your help anyway on where I can adjust login / resetting password forms labels? (e.g. I want to change "Username or Email" label)

#1185017

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Piotr

As the Toolset custom login forms are built on standard WordPress login forms you can use the login_form_defaults filter to modify the labels, as shown in this code sample (where I add custom labels so that they are suitable for translation):

function tssupp_custom_label( $args ){

  $args['label_username'] = __( 'Custom username label', 'tssupp' );
  $args['label_password'] = __( 'Custom password label', 'tssupp' );
  $args['label_remember'] = __( 'Custom remember label', 'tssupp' );
  $args['label_log_in'] = __( 'Custom log_in label', 'tssupp' );

  return $args;
}
add_filter( 'login_form_defaults', 'tssupp_custom_label' );

See https://developer.wordpress.org/reference/hooks/login_form_defaults/