Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save zarankumar/eb07c792231e32611c66052c4ddb17bc to your computer and use it in GitHub Desktop.
Save zarankumar/eb07c792231e32611c66052c4ddb17bc to your computer and use it in GitHub Desktop.
//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