常用函数-set_current_user()

0条评论

常用函数-set_current_user()

说明

插件可替代该函数的功能。若插件未重新定义函数,则使用该函数。

改变目前用户的编号或名称。

在用户编号未知的情况下可以将$id设为0并指定一个名称。

用法

<?php set_current_user( $id, $name ) ?>

参数

$id

(整数 | 空)(必需) 用户编号

默认值:None

$name

(字符串)(可选)用户名

默认值:''

返回的值

(对象)

返回 wp_set_current_user()所返回的值。

示例

注释

修改记录

自2.0.1版本后

源文件

set_current_user()位于 wp-includes/taxonomy.php中。

相关资源

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.