wp_hash_password_algorithm хук-фильтрWP 6.8.0

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 wp_hash_password_options filter.

Other available constants include:

  • PASSWORD_ARGON2I
  • PASSWORD_ARGON2ID
  • PASSWORD_DEFAULT

Использование

add_filter( 'wp_hash_password_algorithm', 'wp_kama_hash_password_algorithm_filter' );

/**
 * Function for `wp_hash_password_algorithm` filter-hook.
 * 
 * @param string $algorithm The hashing algorithm.
 *
 * @return string
 */
function wp_kama_hash_password_algorithm_filter( $algorithm ){

	// filter...
	return $algorithm;
}
$algorithm(строка)
The hashing algorithm.
По умолчанию: value of the PASSWORD_BCRYPT constant

Список изменений

С версии 6.8.0 Введена.

Где вызывается хук

wp_hash_password()
wp_hash_password_algorithm
wp_password_needs_rehash()
wp_hash_password_algorithm
wp-includes/pluggable.php 2683
$algorithm = apply_filters( 'wp_hash_password_algorithm', PASSWORD_BCRYPT );
wp-includes/pluggable.php 2812
$algorithm = apply_filters( 'wp_hash_password_algorithm', PASSWORD_BCRYPT );

Где используется хук в WordPress

Использование не найдено.