Allow terms to match the order in the include parameter#67
Open
glebkema wants to merge 2 commits intoColorlibHQ:masterfrom
Open
Allow terms to match the order in the include parameter#67glebkema wants to merge 2 commits intoColorlibHQ:masterfrom
include parameter#67glebkema wants to merge 2 commits intoColorlibHQ:masterfrom
Conversation
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.
Fix #66
To fix the problem it's necessary to change the behavior of the plugin in two aspects.
1) scporder_get_terms_orderby()
This method is used with the filter
get_terms_orderbyand changes the$orderbyont.term_order.To fix this, it's enough to add one more check:
2) scporder_get_object_terms()
This method is used with two filters
get_termsandwp_get_object_termsand sorts the found terms by theterm_order.This situation is more complicated. To check the
includeoption in an array of arguments, we need to pass the$argsparameter to the function.But this parameter is located at different positions in the mentioned hooks:
In this regard, I propose to add an auxiliary method. Its role is to invoke a neighboring method with another set of arguments:
And use a specific function for each hook: