Fixed filtering enqueue by post type#38
Merged
jeremyzahner merged 2 commits intogetherbert:devfrom Dec 16, 2016
giwrgos88:dev
Merged
Fixed filtering enqueue by post type#38jeremyzahner merged 2 commits intogetherbert:devfrom giwrgos88:dev
jeremyzahner merged 2 commits intogetherbert:devfrom
giwrgos88:dev
Conversation
Method was always returning true so filtering wasn't working
Herbert/Framework/Enqueue.php
Outdated
| public function filterPostType($attrs, $filterWith) | ||
| { | ||
| return array_search(get_post_type(), $filterWith) !== null; | ||
| return array_search(get_post_type(), $filterWith) !== FALSE ? TRUE : FALSE; |
Contributor
There was a problem hiding this comment.
The ternary operator is useless for booleans.
return array_search(get_post_type(), $filterWith) !== false;
Contributor
There was a problem hiding this comment.
So please remove ? TRUE : FALSE since there is no point in having that.
giwrgos88
commented
Nov 17, 2016
Contributor
Author
giwrgos88
left a comment
There was a problem hiding this comment.
Removed ternary operator
Contributor
|
@giwrgos88 Thanks! |
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.
Method was always returning true so filtering wasn't working