filtrod 6.8.0
wp_hash_password_algorithm
Opis — z kodu źródłowego
Filters the hashing algorithm to use in the password_hash() and password_needs_rehash() functions.
The default is the value of the PASSWORD_BCRYPT constant which means bcrypt is used.
Important: The only password hashing algorithm that is guaranteed to be available across PHP installations is bcrypt. If you use any other algorithm you must make sure that it is available on the server. The password_algos() function can be used to check which hashing algorithms are available.
The hashing options can be controlled via the {@see 'wp_hash_password_options'} filter.
Other available constants include:
PASSWORD_ARGON2I-PASSWORD_ARGON2ID-PASSWORD_DEFAULTThe values of the algorithm constants are strings in PHP 7.4+ and integers in PHP 7.3 and earlier.
Parametry
| Parametr | Typ | Opis |
|---|---|---|
$algorithm | string | int | The hashing algorithm. Default is the value of the <code>PASSWORD_BCRYPT</code> constant. |
Wywołanie
Rejestracja callbackaphp
// rejestracja funkcji zwrotnej
add_filter( 'wp_hash_password_algorithm', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}
// rejestracja funkcji zwrotnej
add_filter( 'wp_hash_password_algorithm', 'twoja_funkcja' );
function twoja_funkcja($param_1) {
// Twój kod
}Popularne w tej kategorii