Make WordPress Core

Opened 10 years ago

Closed 10 years ago

Last modified 10 years ago

#29657 closed enhancement (worksforme)

Apply Filters in Login Form Usename Field Label

Reported by: manishkrag's profile manishkrag Owned by:
Milestone: Priority: normal
Severity: normal Version: 4.0
Component: Login and Registration Keywords:
Focuses: administration Cc:

Description

I have worked on several WP project and almost in every project my clients requirement was to change the label of login form username field. But as it is hard coded in wp-login.php file it is not possible to do this change without
modifying the same file.

So I think it would be great if you guys can add a filter there.

In such cases we have to do the same changes in WP user profile edit form and registration form as well.

Change History (3)

#1 @SergeyBiryukov
10 years ago

You can change any string via gettext filter:

function change_username_label_29657( $text, $original_text, $domain ) {
	if ( 'Username' === $original_text && 'default' === $domain ) {
		$text = 'Your username';
	}

	return $text;
}
add_filter( 'gettext', 'change_username_label_29657', 10, 3 );
Last edited 10 years ago by SergeyBiryukov (previous) (diff)

#2 @manishkrag
10 years ago

  • Resolution set to worksforme
  • Status changed from new to closed

Just checked 10n.php flie.
It is awesome.

#3 @SergeyBiryukov
10 years ago

  • Milestone Awaiting Review deleted
Note: See TracTickets for help on using tickets.