mirror of
https://github.com/gosticks/wordpress-develop.git
synced 2026-07-04 09:10:06 +00:00
Block Types: Add metadata global attribute.
Add a new global attribute (i.e. an attribute that can be added to all and any blocks) called `metadata`. This is required 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). Props Mamaduka, gziolo, get_dave. Fixes #59797. git-svn-id: https://develop.svn.wordpress.org/trunk@57068 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
@@ -242,11 +242,13 @@ class WP_Block_Type {
|
||||
/**
|
||||
* Attributes supported by every block.
|
||||
*
|
||||
* @since 6.0.0
|
||||
* @since 6.0.0 Added `lock`.
|
||||
* @since 6.5.0 Added `metadata`.
|
||||
* @var array
|
||||
*/
|
||||
const GLOBAL_ATTRIBUTES = array(
|
||||
'lock' => array( 'type' => 'object' ),
|
||||
'lock' => array( 'type' => 'object' ),
|
||||
'metadata' => array( 'type' => 'object' ),
|
||||
);
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user