-
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
Templates DataViews: Set the right context for the preview field #63488
Conversation
@@ -176,7 +177,7 @@ function Preview( { item, viewType } ) { | |||
// the block editor settings are needed in context where we don't have the block editor. | |||
// Explore how we can solve this in a better way. | |||
return ( | |||
<ExperimentalBlockEditorProvider settings={ settings }> | |||
<EditorProvider post={ item } settings={ settings }> |
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 Preview component should actually be moved to the "editor" package and be named something like PostPreview
or something. The purpose of that is to preview a given postType + postId tuple.
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.
You mean by having a lighter component than the actual EditorProvider, right? Do you think this change will affect performance for now, until we implement that component?
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.
No, I think the EditorProvider
is fine. but instead of having all of this custom logic here in the site editor, this seems like an easy reusable component (preview of a post)
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: -4 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.
Looks good, thank you!
…dPress#63488) Co-authored-by: youknowriad <youknowriad@git.wordpress.org> Co-authored-by: ntsekouras <ntsekouras@git.wordpress.org> Co-authored-by: jameskoster <jameskoster@git.wordpress.org>
Fixes #59082
What?
Some core blocks are WP specific and require the "EditorProvider" (the core/editor store) context to work properly and render the right information.
One of these blocks is the QueryTitle block and this is fixed in this PR.
Testing Instructions
1- Create a "Tag Archive" template and use the Archive Title block in it.
2- In the data views, the block should show the right placeholder.