-
Notifications
You must be signed in to change notification settings - Fork 4.7k
Code Quality: Rename patternBlock to patternPost
#57568
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
patternBlock to patternPostpatternBlock to patternPost
| name: patternPost.slug, | ||
| syncStatus: patternPost.wp_pattern_sync_status || PATTERN_SYNC_TYPES.full, | ||
| title: patternPost.title.raw, | ||
| type: patternPost.type, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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
|
kevin940726
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍
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