I’m using a custom snippet to try and determine if a listing (service) is available at the time of browsing in order to render a custom badge. However, I’ve dreamt up a secondary part that I’d like to layer on top of this, which would be the ability to filter listings by their ‘Available Now’ status.
Could you please provide guidance on how to add a new filtering option manually (with code), so I can attempt to combine my existing logic check with the new filtering option.
It would also be really nice if HivePress had an ‘available now’ filtering logic built in by default. (I’m not sure whether to post this in general or feature requests.)
Unfortunately, it looks like this might need a complex SQL query due to the combination of multiple criteria. You can check the hook hivepress/v1/models/listing/search, which allows you to modify the search SQL query and add meta/taxonomy filters [since a listing is a post type, it’s basically a standard WP_Query object].