Forums

How to query all contributor users from DB? (2 posts)

  1. jl2424
    Member
    Posted 2 years ago #

    I need to query all users from the DB who are writing for our blog and therefore belong to the role contributors. Furthermore it would be nice if I could exclude those users who did not make any posts yet. Please note: I need the user IDs.

    Right now my query looks like this (because I do not know how to filter for the role and number of posts):

    $authors = $wpdb->get_results("SELECT ID FROM $wpdb->users");

  2. jl2424
    Member
    Posted 2 years ago #

    Can no one help answering this question? I really do not know how to make it..

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.