开发者

MYSQL Query for listing wordpress users based based on usermeta data

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜