WP_Session_Tokens::verify() WordPress Method

This function verifies the given token. If the token is valid, it returns the user associated with the token. Otherwise, it returns false.

WP_Session_Tokens::verify( string $token ) #

Validates the given session token for authenticity and validity.


Description

Checks that the given token is present and hasn’t expired.


Top ↑

Parameters

$token

(string)(Required)Token to verify.


Top ↑

Return

(bool) Whether the token is valid for the user.


Top ↑

Source

File: wp-includes/class-wp-session-tokens.php

	final public function verify( $token ) {
		$verifier = $this->hash_token( $token );
		return (bool) $this->get_session( $verifier );
	}


Top ↑

Changelog

Changelog
VersionDescription
4.0.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.