WP hooks navigation: Home/browse • Actions index • Filters index
To save our bandwidth, we show only a snippet of code around each occurence of the hook. View complete file in SVN (without highlighting).
The best way to understand what a hook does is to look at where it occurs in the source code.
do_action( "hook_name" )apply_filters( "hook_name", "what_to_filter" ).Remember, this hook may occur in more than one file. Moreover, the hook's context may change from version to version.
| Line | Code |
|---|---|
| 139 | /** |
| 140 | * Filter whether the given user can be authenticated with the provided $password. |
| 141 | * |
| 142 | * @since 2.5.0 |
| 143 | * |
| 144 | * @param WP_User|WP_Error $user WP_User or WP_Error object if a previous |
| 145 | * callback failed authentication. |
| 146 | * @param string $password Password to check against the user. |
| 147 | */ |
| 148 | $user = apply_filters( 'wp_authenticate_user', $user, $password ); |
| 149 | if ( is_wp_error($user) ) |
| 150 | return $user; |
| 151 | |
| 152 | if ( !wp_check_password($password, $user->user_pass, $user->ID) ) |
| 153 | return new WP_Error( 'incorrect_password', sprintf( __( '<strong>ERROR</strong>: The password you entered for the username <strong>%1$s</strong> is incorrect. <a href="%2$s">Lost your password?</a>' ), |
| 154 | $username, wp_lostpassword_url() ) ); |
| 155 | |
| 156 | return $user; |
| 157 | } |