-
Notifications
You must be signed in to change notification settings - Fork 2.6k
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
Register 'lock' attribute for every block on the server #2615
Register 'lock' attribute for every block on the server #2615
Conversation
* @since 6.0.0 | ||
* @var array | ||
*/ | ||
const CORE_ATTRIBUTES = array( |
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.
I couldn't decide between CORE_ATTRIBUTES
and BUILTIN_ATTRIBUTES
. I'm open to name suggestions :)
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.
I couldn't decide between
CORE_ATTRIBUTES
andBUILTIN_ATTRIBUTES
.
How about GLOBAL_ATTRIBUTES
or GLOBAL_BLOCK_ATTRIBUTES
?
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.
GLOBAL_ATTRIBUTES
reads nice 👍🏻
The issue is from WP 5.9, but it's more visible now that we have UI. |
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.
I've added a few notes inline, mainly in the tests to use more precise assertions and add the ticket number to the docblocks.
* @since 6.0.0 | ||
* @var array | ||
*/ | ||
const CORE_ATTRIBUTES = array( |
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.
I couldn't decide between
CORE_ATTRIBUTES
andBUILTIN_ATTRIBUTES
.
How about GLOBAL_ATTRIBUTES
or GLOBAL_BLOCK_ATTRIBUTES
?
Co-authored-by: Peter Wilson <519727+peterwilsoncc@users.noreply.github.com>
Let's plan to land this patch tomorrow before WP 6.0 Beta 3. I see two remaining tasks:
|
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.
Awesome, this is in great shape. I will take care of committing to WP core 👍🏻
Committed with https://core.trac.wordpress.org/changeset/53268. |
Backports changes from WordPress/gutenberg#40468.
The
lock
attribute needs to be supported by every block, but currently, it is only done on the client site. As a result, it was causing block rendered API requests to fail when blocks are locked.PR updates the
WP_Block_Type
class to handle built-in/core attribute registration.Trac ticket: https://core.trac.wordpress.org/ticket/55567
cc @gziolo, @hellofromtonya
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.