-
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
Editor: Fix loading templates using a top level pattern block that includes a template part. #59900
Conversation
…cludes a template part
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 Unlinked AccountsThe following contributors have not linked their GitHub and WordPress.org accounts: @fushar. Contributors, please read how to link your accounts to ensure your work is properly credited in WordPress releases. 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: +9 B (0%) Total Size: 1.71 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.
This works for me.
- Following the steps in the original issue shows me the page.
- Clicking in the editable area prompts me to click the link to edit the template
- The link differs, but I think that's a good thing
- With this PR I go to
site-editor.php?postId=bedrock-wpcom%2F%2Fpage&postType=wp_template&focusMode=true&canvas=edit
and can edit the header etc - With GB deactivated I go to
site-editor.php?canvas=edit
and can't edit the header
- With this PR I go to
- Trying to insert the pattern inside the post editor by pasing
<!-- wp:pattern {"slug":"bedrock/page"} /-->
shows a blank page with a pattern placeholder in the post list.
…cludes a template part (WordPress#59900)
closes #59634
Regression introduced in #58928
What?
This bug actually existed in the post editor before but was hidden (only visible in template preview mode) so when unifying this logic (hiding template parts) with the site editor, it became more visible.
Basically this PR limits the removal of the "template part" from the allowed blocks in "post-only" mode, in other words templates surrounding the pages/posts being rendered may use template parts.
1- Install bedrock theme
2- Set a static page as home page
3- Open the site editor, the page and template should load (and not be empty)