Login and Registration: Add a new filter for the lost password link.

On the login page, the "Register" link for new users has been filterable for some time.  This change adds the ability to filter the "Lost your password?" link as well.

Props wparslan, audrasjb, rafiahmedd, SergeyBiryukov, antonvlasenko, hellofromTonya.
Fixes #55388.
Built from https://develop.svn.wordpress.org/trunk@54206


git-svn-id: http://core.svn.wordpress.org/trunk@53765 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
davidbaumwald 2022-09-19 17:09:08 +00:00
parent f277e8c168
commit 0da06515aa
2 changed files with 22 additions and 4 deletions

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '6.1-alpha-54205';
$wp_version = '6.1-alpha-54206';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.

View File

@ -1103,8 +1103,16 @@ switch ( $action ) {
<p id="nav">
<a href="<?php echo esc_url( wp_login_url() ); ?>"><?php _e( 'Log in' ); ?></a>
<?php echo esc_html( $login_link_separator ); ?>
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
<?php
echo esc_html( $login_link_separator );
$html_link = sprintf( '<a href="%s">%s</a>', esc_url( wp_lostpassword_url() ), __( 'Lost your password?' ) );
/** This filter is documented in wp-login.php */
echo apply_filters( 'lost_password_html_link', $html_link );
?>
</p>
<?php
@ -1471,8 +1479,18 @@ switch ( $action ) {
echo esc_html( $login_link_separator );
}
$html_link = sprintf( '<a href="%s">%s</a>', esc_url( wp_lostpassword_url() ), __( 'Lost your password?' ) );
/**
* Filters the link that allows the user to retrieve the lost password.
*
* @since 6.1.0
*
* @param string $html_link HTML link to the lost password form.
*/
echo apply_filters( 'lost_password_html_link', $html_link );
?>
<a href="<?php echo esc_url( wp_lostpassword_url() ); ?>"><?php _e( 'Lost your password?' ); ?></a>
</p>
<?php
}