Skip to content
Docs
Get RestroPress

Filter

rpress_get_user_verification_token_algorithm

Updated
On this page

Filters the hash algorithm used to derive the verification token secret.

Runs in rpress_get_user_verification_token(). The returned algorithm name is passed to PHP hash() together with wp_salt() to produce the default secret that is later mixed into the token. The token itself is still an md5 of the URL path and query string.

Parameters#

ParameterTypeDescription
$algorithmstringHash algorithm name. Defaults to sha256.

Return value#

string. A hash algorithm name supported by PHP hash().

Example#

function my_verification_token_algorithm( $algorithm ) {
	return 'sha512';
}
add_filter( 'rpress_get_user_verification_token_algorithm', 'my_verification_token_algorithm' );

Notes#

Changing this changes every token, so verification links already sent stop validating. Return only an algorithm that hash() supports.

Source#

Applied in:

  • includes/user-functions.php (line 714), in rpress_get_user_verification_token()

See also#

Was this page helpful?