Install
This is the repository archive. It installs, but the folder name will carry the branch suffix and updates will not flow.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/crocoblock/jet-smart-filters-advanced-date-filter/archive/refs/heads/master.zipHow to use the plugin
- Create
Date rangefilter - Select
Meta Datein theFilter byoption - Set this into
Query Variableoption - advanced_dateeachfield-1__field-2
Where:
advanced_date__- is the reserved word, you always need to use it.- Parameter which defines how to filter the data. Allowed values:
any- if any field inside the range,inside- it adds the item to query results if any of requested field inside the range, or if whole range between this 2 fields, works only if you set filter by 2 dates,each,fields_inside- it adds the item to query results if both post fields are inside the search range,range_inside- adds the item to query results if whole search range is between post fields;
field-1__field-2- double underscore-separated list of fields to search by.anyandeachtypes supports any number of passed fields,insidetype supports only 2 fields.
Examples:
variable: advanced_dateeachstart_date__end_date existing dates: June 2 - June 7, June 9 - June 15, June 5 - June 12, June 1 - June 11 requested range: June 1 - June 9 matched dates: June 2 - June 7
variable: advanced_dateanystart_date__end_date existing dates: June 2 - June 7, June 9 - June 15, June 5 - June 12, June 1 - June 11 requested range: June 2 - June 9 matched dates: June 2 - June 7, June 9 - June 15, June 5 - June 12
variable: advanced_dateinsidestart_date__end_date existing dates: June 2 - June 7, June 9 - June 15, June 5 - June 12, June 1 - June 11 requested range: June 3 - June 8 matched dates: June 2 - June 7, June 5 - June 12, June 1 - June 11
How to use the plugin (legacy instructions, work with AJAX filters mode only)
- Create
Date rangefilter - Select
Meta Datein theFilter byoption - Set this into
Query Variableoption - advanced_date::each::field-1;field-2.
Where:
advanced_date- is the reserved word, you always need to use it.- Parameter which defines how to filter the data. Allowed values:
any- if any field inside the range,inside- it adds the item to query results if any of requested field inside the range, or if whole range between this 2 fields, works only if you set filter by 2 dates,each,fields_inside- it adds the item to query results if both post fields are inside the search range,range_inside- adds the item to query results if whole search range is between post fields;
field-1;field-2- semicolon-separated list of fields to search by.anyandeachtypes supports any number of passed fields,insidetype supports only 2 fields.
Examples:
variable: advanced_date::each::start_date;end_date existing dates: June 2 - June 7, June 9 - June 15, June 5 - June 12, June 1 - June 11 requested range: June 1 - June 9 matched dates: June 2 - June 7
variable: advanced_date::any::start_date;end_date existing dates: June 2 - June 7, June 9 - June 15, June 5 - June 12, June 1 - June 11 requested range: June 2 - June 9 matched dates: June 2 - June 7, June 9 - June 15, June 5 - June 12
variable: advanced_date::inside::start_date;end_date existing dates: June 2 - June 7, June 9 - June 15, June 5 - June 12, June 1 - June 11 requested range: June 3 - June 8 matched dates: June 2 - June 7, June 5 - June 12, June 1 - June 11