Merged
Conversation
This commit is adding `zoninator_advanced_filter_date_default` filter for filtering the default value of the date filter
By allowing developers to pass an array as a date filter, we give them ability to provide custom label and custom value of the field. The custom value, not being parsed by `strtotime`, can be used for custom time limitations when processing the AJAX search requests
Since the code does not need to know how many matching posts are in the database, the no_found_rows should be set to true
Contributor
|
Looks good |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR is adding a new filter for filtering the default value of the date filter and is adding a support for arrays inside the
$date_filtersarray, which in turn allows developers to provide advanced date filtering of the results.Together with the
zoninator_search_argsfilters, developers could limit the search, by default, to past 60 days only, making the queries on the backend more performant, than the default full table scan search.Example implementation of default time filtering limited to past 60 days: