Block Locking: Register the 'lock' attribute on the server#40468
Block Locking: Register the 'lock' attribute on the server#40468
Conversation
|
I'll create the WP core patch today or tomorrow 👍 |
|
The lock functionality isn't technically a part of the block supports layer so I would appreciate some sanity check on the idea from @youknowriad, @andrewserong, and @ramonjd who helped with WP 6.0 Beta 1 backports in that area. |
|
@gziolo, the block locking UI can be controlled via block supports, but you're right attributes are registered for every block. |
With the full context, it looks for me like a more legit use case then 👍🏻 |
|
I think we should include it by default in the "register" function like I said before, this is backend and frontend if needed as it's part of the "framework" and not an extension (which both hooks and block supports are). So yeah, I think we should add it. I'd prefer it was baked in though but it's minor. |
I guess you are referring to this function call: We could also simplify a lot of code by assuming that |
|
I will update PR to use |
9d1cb2c to
1212c56
Compare
|
@gziolo, updated registration method. |
gziolo
left a comment
There was a problem hiding this comment.
Yes, I think it's a good way to handle this attribute 👍🏻
Yes, it's going to look different in WP core. |
|
I don't think React Native test failure is related to this change, so I'll merge after the Performance test is green. |
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. Props mamaduka, peterwilsoncc. See #55567. git-svn-id: https://develop.svn.wordpress.org/trunk@53268 602fd350-edb4-49c9-b593-d223f7449a82
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. Props mamaduka, peterwilsoncc. See #55567. Built from https://develop.svn.wordpress.org/trunk@53268 git-svn-id: http://core.svn.wordpress.org/trunk@52857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
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. Props mamaduka, peterwilsoncc. See #55567. Built from https://develop.svn.wordpress.org/trunk@53268 git-svn-id: https://core.svn.wordpress.org/trunk@52857 1a063a9b-81f0-0310-95a4-ce76da25c4cd
What?
Resolves #40461.
PR fixes an error when locking server-side rendered blocks.
Why?
The
block-rendererendpoint validates passed attributes, but thelockblock attribute was registered on the client-side.How?
Use
register_block_type_argsfilter to register thelockattribute.Testing Instructions
ServerSideRendercomponent.Screenshots or screencast