Opened 11 months ago

Last modified 10 months ago

#21243 new enhancement

move password hint text to a function

Reported by: convissor Owned by:
Priority: normal Milestone: Awaiting Review
Component: General Version:
Severity: normal Keywords: has-patch
Cc:

Description

The password hint text, noted below, is hard coded in four places:

wp-admin/install.php
wp-admin/user-edit.php
wp-admin/user-new.php
wp-login.php
Hint: The password should be at least seven characters long. To make it stronger, use upper and lower case letters, numbers and symbols like ! " ? $ % ^ & ).

This approach is prone to mistakes when changes are made. In addition, plugins that want to override the text need to use the resource intensive and clumsy gettext filter.

Per nacin and westi, the attached patch moves the text to a function (wp_password_hint()) in wp-includes/user.php and adds a filter (password_hint).

Attachments (2)

wp_password_hint.diff (3.8 KB) - added by convissor 11 months ago.
21243.2.diff (3.8 KB) - added by SergeyBiryukov 10 months ago.

Download all attachments as: .zip

Change History (3)

  • Keywords has-patch added

It would probably make sense to mark the function as private (21243.2.diff), similarly to _wp_get_user_contactmethods().

Note: See TracTickets for help on using tickets.