Conversation
- Allow the user to stop eager loading by returning `null` or `false` via timber_post_get_meta_pre filter. - Allow the user to choose what to eager load by returning an array of k/v meta
- Test for 'short circuit' where no meta should be eager loaded - Test for custom list of eager-loaded post meta
Codecov Report
@@ Coverage Diff @@
## master #2014 +/- ##
============================================
+ Coverage 94.98% 94.99% +<.01%
- Complexity 1566 1567 +1
============================================
Files 49 49
Lines 3692 3694 +2
============================================
+ Hits 3507 3509 +2
Misses 185 185
Continue to review full report at Codecov.
|
jarednova
previously approved these changes
May 30, 2019
Member
jarednova
left a comment
There was a problem hiding this comment.
Yup, this seems to do it! Just 🤞 that we're not gonna see a big merge conflict here with 2.0
jarednova
approved these changes
May 31, 2019
Member
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: #2012
Issue
In #2012 @aj-adl proposed a way to skip Timber from fetching meta values through
get_post_meta()via thetimber_post_get_meta_prefilter. Turns out that in 2.x, I added pretty much the same behavior, just with a new filter:timber/lib/Post.php
Lines 574 to 624 in 35279e5
I wasn’t sure whether this was over-optimization, but hey, here we have a use case already 😎.
Solution
This pull request builds on #2012 to replicate the behavior that we’re going to add in 2.0 in the master branch so that this feature can be used now.
Impact
None.
Usage Changes
See #2012.
Considerations
None.
Testing
None.