Changeset 54385 for trunk/src/wp-includes/class-wp-theme-json.php
- Timestamp:
- 10/04/2022 03:48:31 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-theme-json.php
r54363 r54385 34 34 * 35 35 * @since 5.8.0 36 * @since 6.1.0 Initialize as an empty array. 36 37 * @var array 37 38 */ 38 protected static $blocks_metadata = null;39 protected static $blocks_metadata = array(); 39 40 40 41 /** … … 722 723 */ 723 724 protected static function get_blocks_metadata() { 724 if ( null !== static::$blocks_metadata ) {725 return static::$blocks_metadata;726 }727 728 static::$blocks_metadata = array();729 730 725 $registry = WP_Block_Type_Registry::get_instance(); 731 726 $blocks = $registry->get_all_registered(); 727 728 // Is there metadata for all currently registered blocks? 729 $blocks = array_diff_key( $blocks, static::$blocks_metadata ); 730 if ( empty( $blocks ) ) { 731 return static::$blocks_metadata; 732 } 733 732 734 foreach ( $blocks as $block_name => $block_type ) { 733 735 if (
Note: See TracChangeset
for help on using the changeset viewer.