首页 WordPress函数大全 get_user_meta()

get_user_meta()

2020-05-02 / 3533阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_user_meta( int $user_id, string $key = '', bool $single = false )

Retrieve user meta field for a user.

描述

参数

$user_id

(int)
(Required)
User ID.

$key

(string)
(Optional)
The meta key to retrieve. By default, returns data for all keys.

Default value: ''

$single

(bool)
(Optional)
Whether to return a single value.

Default value: false

返回

(mixed) Will be an array if $single is false. Will be value of meta data field if $single is true.

大家谈论
    我的见解