Forked from marcbovet/WCVendors-Get-Vendor-Bookable-Products
Created
May 29, 2017 16:49
-
-
Save fervous/468c430ad079dabfc390e017eea5cb85 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//WP Query to get all bookable products of a vendor | |
$args = array( | |
'post_type' => 'product', | |
'author' => $vendor, | |
'meta_query' => array( | |
array( | |
'key' => '_wc_booking_availability', | |
'compare' => 'EXISTS', | |
), | |
) | |
); | |
$the_query = new WP_Query($args); | |
while ($the_query->have_posts()) : | |
$the_query->the_post(); | |
endwhile; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment