-
Notifications
You must be signed in to change notification settings - Fork 4.3k
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
Show metabox when pattern is accessed directly #68255
Conversation
This issue first appeared in WP 6.7, and since this PR is relatively small, it might be worth backporting to WP 6.7. |
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. |
Size Change: +14 B (0%) Total Size: 1.84 MB
ℹ️ View Unchanged
|
Flaky tests detected in 51661b6. 🔍 Workflow run URL: https://github.com/WordPress/gutenberg/actions/runs/12476275877
|
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.
This makes sense and works as intended. Thanks for putting this together Aki!
A quick fix for #67902
What? / Why?
The meta box that appears when you navigate to the pattern editor in the post editor is tied to the post editor, not the pattern. This was reported as confusing, so it was fixed in #64990. This PR removes the meta box from always appearing when editing a pattern.
However, as reported in #67902, we found that there are cases where you want to apply meta data to the pattern itself. And since a pattern is a kind of post type, you can edit the pattern directly via
/wp-admin/edit.php?post_type=wp_block
. This PR renders the meta box only when the pattern is accessed directly.How?
Ideally, the meta box itself would be reloaded (re-rendered) when you navigate to a pattern in the post editor, but as mentioned in this comment, that's a bit tricky.
For now, we check
onNavigateToPreviousEntityRecord
to see if the pattern was accessed directly.Testing Instructions
Testing Instructions for Keyboard
/wp-admin/edit.php?post_type=wp_block
and select the sync pattern you just created.