WordPress:Function Reference/get usermeta
来自站长百科
Description
描述
This function returns the value of a specific metakey pertaining to the user whose ID is passed via the userid parameter.
这个函数返回了用户ID的某个metakey,这个用户ID是通过userid参数传递的。
Usage
用法
%%% <?php get_usermeta(userid,'metakey'); ?> %%%
%%% <?php get_usermeta(userid,'metakey'); ?> %%%
Example
例子
This example returns and then displays the last name for user id 9.
这个例子返回并且显示了用户id9的姓。
<?php $user_last = get_usermeta(9,'last_name'); ?> <?php echo('User ID 9's last name: ' . $user_last . '\n'); ?>
<?php $user_last = get_usermeta(9,'last_name'); ?>
<?php echo('User ID 9's last name: ' . $user_last . '\n'); ?>
User ID 9's last name: Jones
User ID 9's last name: Jones