Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
//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