WordPress.org

Make WordPress Core

Opened 6 years ago

Closed 6 years ago

#33336 closed enhancement (fixed)

Suggested changes to text string 'Only lowercase letters (a-z) and numbers are allowed'

Reported by: stillingen Owned by: DrewAPicture
Milestone: 4.4 Priority: normal
Severity: normal Version: 4.2.4
Component: Text Changes Keywords: has-patch
Focuses: administration, multisite Cc:

Description

Hi.

The text string 'Only lowercase letters (a-z) and numbers are allowed' does not refer to which field it is related to. This can be a bit confusing for users are filling out fields when creating a new users. I would suggest to change the text so that it refers to the field it is relevant for, e.g: 'Username can only contain lowercase letters(a-z) and numbers, without space'

Code reference;
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/ms-functions.php#L474
https://core.trac.wordpress.org/browser/trunk/src/wp-includes/ms-functions.php#L633

Since the text string both for user and site creation, this would also require a separate text string for site creation, E.g 'Sitename can only contain lowercase letters(a-z) and numbers, without space'

Attachments (5)

3336-R1-UsernameValidationString.diff (1.1 KB) - added by atomicjack 6 years ago.
Changes the validation string for Username to make it obvious for which field it is assigned.
33336-R1-UsernameValidationString.diff (1.1 KB) - added by atomicjack 6 years ago.
Missed a number off of the ticket ID - no actual code change from original patch
33336.diff (1.2 KB) - added by bjornjohansen 6 years ago.
Improved first string, corrected second
33336.2.diff (2.4 KB) - added by DrewAPicture 6 years ago.
Combined
33336.3.diff (2.2 KB) - added by DrewAPicture 6 years ago.

Download all attachments as: .zip

Change History (10)

@atomicjack
6 years ago

Changes the validation string for Username to make it obvious for which field it is assigned.

#1 @atomicjack
6 years ago

  • Keywords has-patch added

@atomicjack
6 years ago

Missed a number off of the ticket ID - no actual code change from original patch

@bjornjohansen
6 years ago

Improved first string, corrected second

This ticket was mentioned in Slack in #core by bjornjohansen. View the logs.


6 years ago

#3 @wonderboymusic
6 years ago

  • Milestone changed from Awaiting Review to 4.4
  • Owner set to DrewAPicture
  • Status changed from new to assigned

I like this, thoughts?

#4 @DrewAPicture
6 years ago

  • Status changed from assigned to accepted

We typically use username as one word, but otherwise, looks good.

@DrewAPicture
6 years ago

Combined

@DrewAPicture
6 years ago

#5 @DrewAPicture
6 years ago

  • Resolution set to fixed
  • Status changed from accepted to closed

In 35142:

Multisite: Improve two error strings specifying allowed characters in usernames and site names.

Also removes two error strings that were likely never being triggered anyway due to the stricter character matching higher up.

Props atomicjack, bjornjohansen, DrewAPicture.
Fixes #33336.

Note: See TracTickets for help on using tickets.