开发者

MYSQL Query for listing wordpress users based based on usermeta data

开发者 https://www.devze.com 2023-02-02 00:47 出处:网络
I am trying to display all users that have a meta d开发者_开发知识库ata of with a specific value.

I am trying to display all users that have a meta d开发者_开发知识库ata of with a specific value.

So in my case, I have a custom user meta data field called isblogger, with the options yes or no. So I would like to list users that have the isblogger value as yes.

Currently here is the code I have that is dispaying all users

global $wpdb;

$authors = $wpdb->get_results("SELECT ID, user_nicename FROM $wpdb->users"); foreach($authors as $author) { ?>

list name etc...

Any help on this would be fantastic and much appreciated.


You have to add Where condition isblogger='yes'

0

精彩评论

暂无评论...
验证码 换一张
取 消