- This topic has 3 replies, 2 voices, and was last updated 6 years, 1 month ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
These forums are now closed and remain for historical purposes.
None of the content applies to the new version 3. For support, get in touch via our contact form.
Forums › Forums › Search & Filter Pro › Post Meta compared to TODAY's date dynamic variable
When creating a search form you can access the Tab called “Post Meta”. Here I can select a variable to pre-filter my results. I have a custom post type with a variable of “research_enddate” that I select for the first item, I can select datetime, I can select > (greater than) and then I have an empty text field to fill in.
I need this to be a variable of today’s date.
$today = date("Ymd");
Because if the deadline has expired for this post, I’m not wanting it to show up in the listings.
Anything I can do to accomplish this?
You can only do this in that tab if the field is a date field:
https://www.screencast.com/t/XYxesJWq
It might also have to be formatted in the YYYYMMDD format (in some plugins, like ACF, this is sown as Ymd)
Otherwise you can add the filter condition you want using PHP and this function:
https://searchandfilter.com/documentation/action-filter-reference/#edit-query-arguments
(edited to give correct link screenshot)