WordPress开发者和主题制作者的搜索引擎



wp_setcookie ›

Since1.5.0
已弃用2.5.0
wp_setcookie ( $username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false )
参数: (6)
  • (string) $username The user's username
    Required: Yes
  • (string) $password Optional. The user's password
    Required: No
    默认: (empty)
  • (bool) $already_md5 Optional. Whether the password has already been through MD5
    Required: No
    默认: false
  • (string) $home Optional. Will be used instead of COOKIEPATH if set
    Required: No
    默认: (empty)
  • (string) $siteurl Optional. Will be used instead of SITECOOKIEPATH if set
    Required: No
    默认: (empty)
  • (bool) $remember Optional. Remember that the user is logged in
    Required: No
    默认: false
查看:
定义在:
文档:

Sets a cookie for a user who just logged in. This function is deprecated.



源码

function wp_setcookie($username, $password = '', $already_md5 = false, $home = '', $siteurl = '', $remember = false) {
	_deprecated_function( __FUNCTION__, '2.5.0', 'wp_set_auth_cookie()' );
	$user = get_user_by('login', $username);
	wp_set_auth_cookie($user->ID, $remember);
}