WP_User_Meta_Session_Tokens::prepare_session() WordPress Method

The prepare_session() method of the WP_User_Meta_Session_Tokens class is used to prepare a user session for use. This includes creating a new session token if one does not already exist, and initializing the session data.

WP_User_Meta_Session_Tokens::prepare_session( mixed $session ) #

Converts an expiration to an array of session information.


Parameters

$session

(mixed)(Required)Session or expiration.


Top ↑

Return

(array) Session.


Top ↑

Source

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

	protected function prepare_session( $session ) {
		if ( is_int( $session ) ) {
			return array( 'expiration' => $session );
		}

		return $session;
	}

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.