-
Notifications
You must be signed in to change notification settings - Fork 4.2k
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
WP 6.6 merge - Patterns: check for edited entity content property when exporting #63277
Conversation
Merge #63227 into wp/6.6
The following accounts have interacted with this PR and/or linked issues. I will continue to update these lists as activity occurs. You can also manually ask me to refresh this list by adding the If you're merging code through a pull request on GitHub, copy and paste the following into the bottom of the merge commit message.
To understand the WordPress project's expectations around crediting contributors, please review the Contributor Attribution page in the Core Handbook. |
content: item.patternPost.content.raw, | ||
syncStatus: item.patternPost.wp_pattern_sync_status, | ||
content: item?.patternPost?.content?.raw || item.content, | ||
syncStatus: |
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.
Thanks to @t-hamano for the tip about migrating syncStatus
as well 👍🏻
Size Change: +10 B (0%) Total Size: 1.75 MB
ℹ️ View Unchanged
|
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.
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.
Thanks for the fix 🙇♂️
What?
This PR merges #63227 into wp/6.6
It ensures that
content
andsyncStatus
is exported when exporting custom patterns from the editor pattern side bar.Why?
The "item" passed to getJsonFromItem is fetched using getEditedEntityRecord.
getEditedEntityRecord
calls getRawEntityRecord.getRawEntityRecord
maps properties to their raw values, socontent.raw
will be mapped tocontent
.Because an item can either be an entity record fetched via
getEntityRecord
orgetEditedEntityRecord
, I think we should support both formats.How?
Checks for
content.raw
andcontent
when exporting item JSON, e.g., for a custom pattern.Testing Instructions
syncStatus
,title
.Example:
Kapture.2024-07-08.at.17.25.20.mp4