wp_set_auth_cookie()设置基于User ID身份证明的cookie

目录

描述

This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.

Sets the authentication cookies based User ID.

The $remember parameter increases the time that the cookie will be kept. The default the cookie is kept without remembering is two days. When $remember is set, the cookies will be kept for 14 days or two weeks.

wp_set_auth_cookie() 描述

用法

<?php wp_set_auth_cookie$user_id$remember$secure ?>

wp_set_auth_cookie() 用法

参数

$user_id

(integer) (必填) User ID

默认值: None

$remember

(boolean) (可选) Whether to remember the user or not

默认值: false

$secure

(unknown) (可选)

默认值: ''

wp_set_auth_cookie() 参数

返回值

(void) 

This function does not return a value.

wp_set_auth_cookie() 返回值

注意

  • This function can be replaced via plugins. If plugins do not redefine these functions, then this will be used instead.

wp_set_auth_cookie() 注意

历史

添加于 版本: 2.5

wp_set_auth_cookie() 历史

源文件

wp_set_auth_cookie() 函数的代码位于 wp-includes/pluggable.php.

wp_set_auth_cookie() 源文件