• I am using the following code
    $authors = $wpdb->get_results("SELECT ID, user_nicename from $wpdb->users ORDER BY display_name");
    It is selecting all users including subscribers and customers from WooCommerce.
    How would I select only those people with a role of author, editor or contributor?

    I had a look through the database but couldn’t figure it out. descriptionhttps://codex.wordpress.org/Database_Description#Table:_wp_users

Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Querying database for users’ is closed to new replies.