Merged
Conversation
jarednova
requested changes
Dec 24, 2019
lib/Helper.php
Outdated
| */ | ||
| public static function filter_array( $list, $args, $operator = 'AND' ) { | ||
| if ( ! is_array($args) ) { | ||
| public static function wp_filter_array( $list, $args, $operator = 'AND' ) { |
Member
There was a problem hiding this comment.
Can we change this to wp_list_filter to match the Twig filter name? One less name to manage (and confuse me)
Collaborator
Author
There was a problem hiding this comment.
good idea - pushing the fix in a moment.
Member
|
I'm going to close my associated PRs in favor of this one |
Codecov Report
@@ Coverage Diff @@
## master #2124 +/- ##
=========================================
Coverage ? 95.04%
Complexity ? 1582
=========================================
Files ? 50
Lines ? 3753
Branches ? 0
=========================================
Hits ? 3567
Misses ? 186
Partials ? 0
Continue to review full report at Codecov.
|
jarednova
approved these changes
Jan 1, 2020
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.
Ticket: #2010
Issue
Twig and Timber have filter called
filterand now we have a problem.Solution
Adds new filter called
wp_list_filterand adds backward compatibility and warning to normalfilter.Impact
User's that use the
filterand with string or array as second param will get a warning.Usage Changes
The twig filter works a bit different - https://twig.symfony.com/doc/3.x/filters/filter.html.
Considerations
Testing
Not yet