-
Notifications
You must be signed in to change notification settings - Fork 4.6k
Core Block Reference: Add ancestor status and refactor generation logic #59390
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
|
Size Change: 0 B Total Size: 1.71 MB ℹ️ View Unchanged
|
|
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. |
fabiankaegy
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.
This is a great enhancement and the code looks good to me :)
gziolo
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.
Nice one! There is also allowedBlocks introduced in WP 6.5 that will have to be explicitly listed.
|
@fabiankaegy @gziolo Thanks for the review!
I see, I would like to respond with follow-up PR 👍 |
Fixes: #58603
What?
This PR makes two changes to the core block reference page:
ancestorfieldWhy?
I think the
ancestorfield is important information for developers, just like the already existingparentfield.Also, the current logic produces Attributes/Supports fields with no values, which seems unnecessary:
How?
The previous logic seemed unstable because newline characters were added dynamically.
This PR first defines an array to display the block information list. After that, if there is any information that can be displayed, push it into the array. Finally, it outputs the elements of that array separated by newlines.
This should also make it easier to add fields in the future.
Testing Instructions
Compare the readme files.