Skip to content
Docs
Get RestroPress

Filter

rpress_validate_user_verification_token

Updated
On this page

Filters whether a user verification URL has a valid token.

Runs at the end of rpress_validate_user_verification_token(). The default value is true only when the token in the URL equals a freshly generated token for the same URL. Return false to reject an otherwise valid link.

Parameters#

ParameterTypeDescription
$retboolWhether the token matched.
$urlstringThe full URL being validated.
$query_argsarrayQuery arguments parsed from the URL.

Return value#

bool. True if the token is valid.

Example#

function my_validate_verification_token( $ret, $url, $query_args ) {
	if ( $ret && empty( $query_args['user_id'] ) ) {
		return false;
	}
	return $ret;
}
add_filter( 'rpress_validate_user_verification_token', 'my_validate_verification_token', 10, 3 );

Notes#

An expired link ends the request before this filter runs.

Source#

Applied in:

  • includes/user-functions.php (line 781), in rpress_validate_user_verification_token()

See also#

Was this page helpful?