attach_session_information filter-hookWP 4.0.0

Filters the information attached to the newly created session.

Can be used to attach further information to a session.

Usage

add_filter( 'attach_session_information', 'wp_kama_attach_session_information_filter', 10, 2 );

/**
 * Function for `attach_session_information` filter-hook.
 * 
 * @param array $session Array of extra data.
 * @param int   $user_id User ID.
 *
 * @return array
 */
function wp_kama_attach_session_information_filter( $session, $user_id ){

	// filter...
	return $session;
}
$session(array)
Array of extra data.
$user_id(int)
User ID.

Changelog

Since 4.0.0 Introduced.

Where the hook is called

WP_Session_Tokens::create()
attach_session_information
wp-includes/class-wp-session-tokens.php 133
$session               = apply_filters( 'attach_session_information', array(), $this->user_id );

Where the hook is used in WordPress

Usage not found.