Repository navigation
Code Quality: Rename patternBlock to patternPost - #57568
Merged
Merged
Conversation
talldan
requested review from
glendaviesnz,
kevin940726,
ntsekouras and
oandregal
January 5, 2024 04:17
patternBlock to patternPostpatternBlock to patternPost
talldan
commented
Jan 5, 2024
| name: patternPost.slug, | ||
| syncStatus: patternPost.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full, | ||
| title: patternPost.title.raw, | ||
| type: patternPost.type, |
Contributor
Author
There was a problem hiding this comment.
Here I've decided to pull the type from the post object's type property (which should be wp_block).
Given the discovery in #57532 (comment) that there are two different PATTERN_TYPE objects that are inconsistent, using it here seems dangerous.
|
Size Change: -1 B (0%) Total Size: 1.69 MB
ℹ️ View Unchanged
|
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.
What?
I noticed in the patterns code some confusing naming. There's something called a
patternBlock, which a reader might expect to be a block object, but instead it's a post object.In this PR I rename the property to
patternPost.I think there are further improvements that can be made - I don't think the entire post object should be passed around as the property of another 'item'. I'll try to keep this PR small to avoid breaking things.
Testing Instructions