Skip to content
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

Block Types: Add metadata global attribute #5608

Closed
wants to merge 7 commits into from

Conversation

ockham
Copy link
Contributor

@ockham ockham commented Nov 1, 2023

For use cases such as allowing the user to assign custom names to blocks or for making Block Hooks work with user-modified templates/parts/patterns (#59646), there's a requirement for a new global attribute (i.e. an attribute that can be added to all and any blocks) to hold that sort of metadata.

See #2615 for precedent for registering a global attribute.

Spun off from #5523.
Fixes WordPress/gutenberg#55194.

Trac ticket: https://core.trac.wordpress.org/ticket/59797


This Pull Request is for code review only. Please keep all other discussion in the Trac ticket. Do not merge this Pull Request. See GitHub Pull Requests for Code Review in the Core Handbook for more details.

@ockham ockham self-assigned this Nov 1, 2023
@ockham
Copy link
Contributor Author

ockham commented Nov 1, 2023

FYI @getdave @Mamaduka -- partly to make sure that there's no-one else working on this yet? (Also, we don't have a Trac ticket for this yet, do we?)

@ockham ockham marked this pull request as ready for review November 2, 2023 16:44
@ockham ockham requested review from gziolo and Mamaduka November 2, 2023 16:44
@ockham ockham changed the title Block Types: Add metadata global attribute Block Types: Add metadata global attribute Nov 2, 2023
Copy link
Member

@Mamaduka Mamaduka left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for updating the tests. The change required for this update is pretty straightforward.

@ockham
Copy link
Contributor Author

ockham commented Nov 6, 2023

Thanks all!

I also made sure to test this change with Gutenberg installed and activated, to make sure this change wouldn't commit with code from WordPress/gutenberg#54426 ✅ (Fortunately, the latter has a number of isset guards to avoid that kind of collision.)

Committed to Core in https://core.trac.wordpress.org/changeset/57068.

@ockham ockham closed this Nov 6, 2023
@ockham ockham deleted the add/metadata-global-attribute branch November 6, 2023 14:47
@getdave
Copy link
Contributor

getdave commented Nov 7, 2023

I was very pleased to return to work and find this completed. Thank you so much 🙇

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Backport Block Renaming Default Attributes
4 participants