Skip to content
Docs
Get RestroPress

Filter

rpress_get_user_verification_token_secret

Updated
On this page

Filters the secret mixed into user verification tokens.

Runs in rpress_get_user_verification_token(). The default is the configured hash algorithm applied to wp_salt(). The secret is added to the URL as the secret query argument before the token is computed, so it is never included in the emailed link.

Parameters#

ParameterTypeDescription
$secretstringThe default secret derived from wp_salt().

Return value#

string. The secret used when generating and checking tokens.

Example#

function my_verification_token_secret( $secret ) {
	return hash( 'sha256', $secret . wp_salt( 'auth' ) );
}
add_filter( 'rpress_get_user_verification_token_secret', 'my_verification_token_secret' );

Notes#

Tokens are regenerated on validation, so the same filter must return the same value on both requests. Changing it invalidates links already sent.

Source#

Applied in:

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

See also#

Was this page helpful?