set_auth_cookie

動作鉤子
do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme, $token )
引數
  • (string) $auth_cookie Authentication cookie value.
    Required:
  • (int) $expire The time the login grace period expires as a UNIX timestamp. Default is 12 hours past the cookie's expiration time.
    Required:
  • (int) $expiration The time when the authentication cookie expires as a UNIX timestamp. Default is 14 days from now.
    Required:
  • (int) $user_id User ID.
    Required:
  • (string) $scheme Authentication scheme. Values include 'auth' or 'secure_auth'.
    Required:
  • (string) $token User's session token to use for this cookie.
    Required:
定義位置
相關勾子
send_auth_cookiessecure_auth_cookieauth_cookieclear_auth_cookieset_comment_cookies
相關方法
wp_set_auth_cookiewp_parse_auth_cookiewp_generate_auth_cookiewp_clear_auth_cookiewp_validate_auth_cookiewp_setcookie
引入
4.9.0
棄用
-

set_auth_cookie 是一個WordPress函式,在使用者登入時為他們設定一個認證cookie: 這個函式被用來保持使用者在兩次訪問網站之間的登入狀態。

在認證cookie被設定之前立即觸發。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme, $token );
do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme, $token );
do_action( 'set_auth_cookie', $auth_cookie, $expire, $expiration, $user_id, $scheme, $token );

常見問題

FAQs
檢視更多 >