WP_User_Meta_Session_Tokens::get_session()protectedWP 4.0.0

Retrieves a session based on its verifier (token hash).

Method of the class: WP_User_Meta_Session_Tokens{}

No Hooks.

Return

Array|null. The session, or null if it does not exist

Usage

// protected - for code of main (parent) or child class
$result = $this->get_session( $verifier );
$verifier(string) (required)
Verifier for the session to retrieve.

Changelog

Since 4.0.0 Introduced.

WP_User_Meta_Session_Tokens::get_session() code WP 6.1.1

protected function get_session( $verifier ) {
	$sessions = $this->get_sessions();

	if ( isset( $sessions[ $verifier ] ) ) {
		return $sessions[ $verifier ];
	}

	return null;
}