Streamline get_meta_values functions across objects#2019
Conversation
Codecov Report
@@ Coverage Diff @@
## 2.x #2019 +/- ##
======================================
Coverage ? 95.36%
Complexity ? 1507
======================================
Files ? 50
Lines ? 3865
Branches ? 0
======================================
Hits ? 3686
Misses ? 179
Partials ? 0
Continue to review full report at Codecov.
|
|
@jarednova This pull request should fix the current build issues in |
|
Great! Will review so we can unblock the other 2x stuff |
jarednova
left a comment
There was a problem hiding this comment.
I did a few touch-ups to bring these more into line across the classes, namely:
- Specify
arrayas the return type - Same docblock for args
- Have all functions handle the post/comment/term/user ID in the same way
|
@jarednova Cool, thanks! 👍 I feel like the more we iterate with small changes, the more we see the patterns that will make different object types work in the same way. |
Ticket: #1617
Issue
There were failing tests after merging in #2014. And it made me realize that for the meta functionality, I added way too few tests.
Solution
This pull request first streamlines the functionality of what the
get_meta_values()does across Post, Term, User and Comment objects. I figured it’s actually good this is coming together step by step, because when I started out with working on meta for 2.x, I was hard to get an overview.Now, all objects import all meta values into a
customproperty. And allget_meta_values()functions do pretty much the same, including the same variable pattern etc.I also added tests for the different objects. The tests that were introduced in #2012 are really good to test the
timber/{object}/pre_get_meta_valuesfilter (Thanks, @aj-adl!).Impact
Fewer fails.
Usage Changes
None.
Considerations
I need to add more tests to improve coverage of changes for meta. There will be more pull requests.
Testing
Yes.