Skip Navigation

[Resolved] Remove “Username or ” from built-in login view

This thread is resolved. Here is a description of the problem and solution.

Problem:

We are building a site with a guest / subscriber model. Copying almost exactly the toolset documentation. Since this is a simple site, we don't want to require the user to enter a username, just their email. It's easy enough not to ask the user for an email and the site autogenerates a username. Fine.

However, the built-in Login Form has the phrase "Username or Email". How can I get rid of the "Username or " text and simply have "Email"

Solution:

Yes, it is possible within Views filter hook "login_form_defaults", for example, you can add below codes into your theme/functions.php:

add_filter('login_form_defaults', 'my_func2');
function my_func2($defaults ){
    $defaults['label_username'] = __( 'Email' );
    return $defaults;
}

Relevant Documentation:

This support ticket is created 6 years, 8 months ago. 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
- 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 9:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Hong_Kong (GMT+08:00)

This topic contains 3 replies, has 2 voices.

Last updated by Luo Yang 6 years, 7 months ago.

Assisted by: Luo Yang.

Author
Posts
#624370

Tell us what you are trying to do?

We are building a site with a guest / subscriber model. Copying almost exactly the toolset documentation. Since this is a simple site, we don't want to require the user to enter a username, just their email. It's easy enough not to ask the user for an email and the site autogenerates a username. Fine.

However, the built-in Login Form has the phrase "Username or Email". How can I get rid of the "Username or " text and simply have "Email"

Thanks!!!!!

Is there any documentation that you are following?
Toolset example - https://toolset.com/documentation/user-guides/cred-training-course/part-7-building-account-page-login-form/

Is there a similar example that we can see?

What is the link to your site?
hidden link

#624485

Hello,

Yes, it is possible within Views filter hook "login_form_defaults", for example, you can add below codes into your theme/functions.php:


add_filter('login_form_defaults', 'my_func2');
function my_func2($defaults ){
	$defaults['label_username'] = __( 'Email' );
	return $defaults;
}

And test again

#625728

awesome!

#626043

You are welcome