Action hook 'lost_password'

in WP Core File wp-login.php at line 875

View Source

lost_password

Action Hook
Description
Fires before the lost password form.

Hook Information

File Location wp-login.php View on GitHub
Hook Type Action
Line Number 875

Hook Parameters

Type Name Description
WP_Error $errors A `WP_Error` object containing any errors generated by using invalid credentials. Note that the error object may not contain any errors.

Usage Examples

Basic Usage
<?php
// Hook into lost_password
add_action('lost_password', 'my_custom_function', 10, 1);

function my_custom_function($errors) {
    // Your custom code here
}

Source Code Context

wp-login.php:875 - How this hook is used in WordPress core
<?php
 870  		 * @since 5.1.0 Added the `$errors` parameter.
 871  		 *
 872  		 * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
 873  		 *                         credentials. Note that the error object may not contain any errors.
 874  		 */
 875  		do_action( 'lost_password', $errors );
 876  
 877  		login_header(
 878  			__( 'Lost Password' ),
 879  			wp_get_admin_notice(
 880  				__( 'Please enter your username or email address. You will receive an email message with instructions on how to reset your password.' ),

PHP Documentation

<?php
/**
		 * Fires before the lost password form.
		 *
		 * @since 1.5.1
		 * @since 5.1.0 Added the `$errors` parameter.
		 *
		 * @param WP_Error $errors A `WP_Error` object containing any errors generated by using invalid
		 *                         credentials. Note that the error object may not contain any errors.
		 */
Quick Info
  • Hook Type: Action
  • Parameters: 1
  • File: wp-login.php
Related Hooks

Related hooks will be displayed here in future updates.