Forked from marcbovet/WCVendors-Get-Vendor-Bookable-Products
Created
September 18, 2017 15:01
-
-
Save zarankumar/eb07c792231e32611c66052c4ddb17bc 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