/*
* If the stored hash is longer than an MD5,
* presume the new style phpass portable hash.
*/
if ( empty( $wp_hasher ) ) { require_once ABSPATH . WPINC . '/class-phpass.php';
// By default, use the portable hash from phpass.
$wp_hasher =
new PasswordHash( 8, true
);
} $check =
$wp_hasher->
CheckPassword( $password,
$hash );
/** This filter is documented in wp-includes/pluggable.php */
return apply_filters( 'check_password',
$check,
$password,
$hash,
$user_id );
}endif;
if ( !
function_exists( 'wp_generate_password'
) ) :
/**
* Generates a random password drawn from the defined set of characters.
*
* Uses wp_rand() to create passwords with far less predictability
* than similar native PHP functions like `rand()` or `mt_rand()`.
*
* @since 2.5.0
*
* @param int $length Optional. The length of password to generate. Default 12.
* @param bool $special_chars Optional. Whether to include standard special characters.
* Default true.
* @param bool $extra_special_chars Optional. Whether to include other special characters.
* Used when generating secret keys and salts. Default false.
* @return string The random password.
*/