Ticket #24617: 24617.03.patch
File 24617.03.patch, 1.2 KB (added by , 8 years ago) |
---|
-
src/wp-includes/user.php
2036 2036 */ 2037 2037 do_action( 'retrieve_password', $user->user_login ); 2038 2038 2039 $allow = true; 2040 if ( is_multisite() && is_user_spammy( $user ) ) { 2041 $allow = new WP_Error( 'marked_as_spam', __( 'Your account has been marked as spam.' ) ); 2042 } 2043 2039 2044 /** 2040 2045 * Filter whether to allow a password to be reset. 2041 2046 * 2042 2047 * @since 2.7.0 2043 2048 * 2044 * @param bool $allow Whether to allow the password to be reset. Default true. 2045 * @param int $user_data->ID The ID of the user attempting to reset a password. 2049 * @param bool $allow Whether to allow the password to be reset. Default true. 2050 * @param int $user->ID The ID of the user attempting to reset a password. 2051 * @param WP_User $user The WP_User object of the user attempting to reset a password. 2046 2052 */ 2047 $allow = apply_filters( 'allow_password_reset', true, $user->ID);2053 $allow = apply_filters( 'allow_password_reset', $allow, $user->ID, $user ); 2048 2054 2049 2055 if ( ! $allow ) { 2050 2056 return new WP_Error( 'no_password_reset', __( 'Password reset is not allowed for this user' ) );