set_auth_cookie
Fires immediately before the authentication cookie is set.
Description
do_action( 'set_auth_cookie', (string) $auth_cookie, (int) $expire, (int) $expiration, (int) $user_id, (string) $scheme );
Parameters (5)
- 0. $auth_cookie (string)
- Authentication cookie.
- 1. $expire (int)
- The time the login grace period expires as a UNIX timestamp. Default is 12 hours past the cookie's expiration time.
- 2. $expiration (int)
- The time when the authentication cookie expires as a UNIX timestamp. Default is 14 days from now.
- 3. $user_id (int)
- The user id.
- 4. $scheme (string)
- Authentication scheme. Values include auth,, secure_auth., or logged_in.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme );
- The following example is for adding a hook callback.
- // define the set_auth_cookie callback
- function action_set_auth_cookie( $auth_cookie, $expire, $expiration, $user_id, $scheme ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'set_auth_cookie', 'action_set_auth_cookie', 10, 5 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'set_auth_cookie', 'action_set_auth_cookie', 10, 5 );
Defined (1)
The action is defined in the following location(s).
- /wp-includes/pluggable.php
- do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme );