Tell us what you are trying to do?
Hi there, I have created a custom post type "event" which has a date field to select date and time.
Now I want to retrieve posts from the post type that are upcoming based on the date field.
In the past using other plugins I did it using the visual query builder in oxygen(check the attached screenshot, the value of the array is [oxygen data="phpfunction" function="date" arguments="Y-m-d"] )
This doesn't work using toolset's date field. It might be because it saves the date in UNIX format ? Like 1675350000 ...can you please advice on how to do this ?
I'm not familiar with Oxygen's visual query builder (looks nice, though), but what you want for the value you are testing the date field key against is the current Unix timestamp, i.e. what is output by the PHP function time(). I expect there would be a way to dynamically provide the value using the time() function, but you may need to check with Oxygen about that. (Maybe [oxygen data="phpfunction" function="time"] ?)
One gotcha to be aware of: Toolset custom fields are stored in wp_postmeta with a key that uses a 'wpcf-' prefix.
So if you have a custom field with a slug of event_start then the meta_key would be 'wpcf-event_start'.
Unfortunately, this didn't work, so what I did was to use Toolset Views to create the query and the loop and then added the views shortcode inside oxygen builder.