File tree Expand file tree Collapse file tree 3 files changed +27
-36
lines changed
Expand file tree Collapse file tree 3 files changed +27
-36
lines changed Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -269,3 +269,30 @@ function ( $response ) {
269269 );
270270}
271271add_action ( 'rest_api_init ' , 'gutenberg_rest_comment_set_children_as_embeddable ' );
272+
273+ /**
274+ * Registers the lock block attribute for block types.
275+ *
276+ * Once 6.0 is the minimum supported WordPress version for the Gutenberg
277+ * plugin, this shim can be removed
278+ *
279+ * Doesn't need to be backported into Core.
280+ *
281+ * @param array $args Array of arguments for registering a block type.
282+ * @return array $args
283+ */
284+ function gutenberg_register_lock_attribute ( $ args ) {
285+ // Setup attributes if needed.
286+ if ( empty ( $ args ['attributes ' ] ) ) {
287+ $ args ['attributes ' ] = array ();
288+ }
289+
290+ if ( ! array_key_exists ( 'lock ' , $ args ['attributes ' ] ) ) {
291+ $ args ['attributes ' ]['lock ' ] = array (
292+ 'type ' => 'object ' ,
293+ );
294+ }
295+
296+ return $ args ;
297+ }
298+ add_filter ( 'register_block_type_args ' , 'gutenberg_register_lock_attribute ' );
Original file line number Diff line number Diff line change @@ -156,7 +156,6 @@ function gutenberg_is_experiment_enabled( $name ) {
156156require __DIR__ . '/block-supports/typography.php ' ;
157157require __DIR__ . '/block-supports/border.php ' ;
158158require __DIR__ . '/block-supports/layout.php ' ;
159- require __DIR__ . '/block-supports/lock.php ' ;
160159require __DIR__ . '/block-supports/spacing.php ' ;
161160require __DIR__ . '/block-supports/dimensions.php ' ;
162161require __DIR__ . '/block-supports/duotone.php ' ;
You can’t perform that action at this time.
0 commit comments