描述
示例: 3.6
query_users(args)
功能: 查询用户
参数
args
(Object) (Required)
include
(Array) (Optional)
结果中允许包含的 id/name/email
exclude
(Array) (Optional)
结果中不包含的 id/name/email
keyword
(String) (Optional)
与name、email相似的结果
orderby
(String)(Optional)
排序字段(可选:name/email/url/power/rand,默认:power权限)
order
(String)(Optional)
排序(可选:ASC/DESC,默认:ASC正序)
users_per_page
(Int)(Optional)
每页文章数量(跟随Option设置:posts_per_page,默认:10)
current_page
(Int)(Optional)
当前页码(默认:1)
meta_query
(Object)(Optional)
元数据查询
- relation
(String)(Required)
条件集合关系(可选:AND/OR,默认:AND)
- opts
(Array)(Required)
查询条件
- key
(String)(Required)
元数据字段名
- value
(Int/String/Array)(Required)
比较值
- compare
(String)(Optional)
结果关系(对于Int:=/!=/>/>=/</<=;对于String:=/!=/LIKE/NOT LIKE;对于Array:IN/NOT IN/BETWEEN/NOT BETWEEN)
返回
(Object/Array)
【注】有users_per_page和current_page分页参数时,返回内容包含分页信息。否则直接返回user数组