WP Manifestindependent plugin directory
manifest / content / jet-smart-filters-advanced-date-filter

JetSmartFilters - Advanced date filter

Allow to filter by multiple meta fields with date range filters

★ 4stars

Install

Download source zip No release zip yet

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.zip
No built-in updater. New versions won't appear under Dashboard → Updates. Install new releases yourself, or let Git Updater track the repository.

How to use the plugin

  1. Create Date range filter
  2. Select Meta Date in the Filter by option
  3. Set this into Query Variable option - 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. any and each types supports any number of passed fields, inside type 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)

  1. Create Date range filter
  2. Select Meta Date in the Filter by option
  3. Set this into Query Variable option - 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. any and each types supports any number of passed fields, inside type 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