Merged
Conversation
These are just aliases of ::get_post(). See also discussion in #2316, specifically: #2316 (review)
gchtr
reviewed
Oct 16, 2020
gchtr
reviewed
Oct 16, 2020
Member
gchtr
left a comment
There was a problem hiding this comment.
I see your concerns with having these aliases and had an idea that I wanted to run by you (see suggestion).
Collaborator
Author
|
@gchtr I like it - nice and simple, and less surprising. @jarednova what do you think? |
acobster
added a commit
that referenced
this pull request
Oct 16, 2020
2.x factories NOTE: THIS DOES NOT CONTAIN UP TO DATE DOCS ABOUT THE NEW API The 2.x-docs-api API branch (PR #2073) is where overall API changes for 2.x are being tracked and discussed. At time of writing these are the tasks remaining before the 2.0 API/docs are production-ready: * Deprecate Timber\PostClassMap filter and rename it to timber/post/classmap. Currently, it’s called timber/post/post_class in the 2.x branch. #2293 * Determine what happens when a timber/*/classmap filter callback returns something other than a CoreInterface. (Probably should throw an exception rather than just letting it TypeError.) - also #2293 * Finalize type declarations #1863 * Implement the new PagesMenu API. #2292 * Implement ::get_image() and ::get_attachment() top-level methods and corresponding Twig functions. #2333 #2342
added 3 commits
October 16, 2020 13:00
Corresponding Timber methods are no longer aliases and should be called directly
Collaborator
Author
|
@gchtr please see updates :) |
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: #2333
Issue
Discussed in detail in the linked issue and in #2316 .
Solution
Aliases and docs for
::get_image()and::get_attachment()and corresponding Twig functions.Impact
A slightly bigger but less confusing API.
Usage Changes
MOAR METHODS
Considerations
We threw out the idea of adding
::get_images()and::get_attachments()(plural) for consistency. I don't see as strong a reason to have these in there, and they're potentially even more confusing because of the potential for getting back a mixed bag of concrete classes.Testing
Yes, test all the things!