sagescrub
sagescrub

Reputation: 549

Query authors/users that have published products

I'd like to know if it is possible to pass some args to WP_User_Query that would allow me to select Authors that have some published WooCommerce products. Something like has_published_posts but for products. Any help would be appreciated!

Upvotes: 0

Views: 82

Answers (1)

Alex Vasilyev
Alex Vasilyev

Reputation: 141

Use the option "has_published_posts"

$user_query = new WP_User_Query( 
    array( 
        'has_published_posts' => array( 'product' ) 
    ) 
);

Upvotes: 1

Related Questions