Changeset 49310 for trunk/src/wp-includes/class-wp-block-supports.php
- Timestamp:
- 10/26/2020 08:29:04 AM (5 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/class-wp-block-supports.php (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-supports.php
r49226 r49310 23 23 */ 24 24 private $block_supports = array(); 25 26 /** 27 * Tracks the current block to be rendered. 28 * 29 * @var array 30 */ 31 public static $block_to_render = null; 25 32 26 33 /** … … 73 80 } 74 81 75 76 82 /** 77 83 * Generates an array of HTML attributes, such as classes, by applying to … … 80 86 * @since 5.6.0 81 87 * 82 * @param array $parsed_block Block as parsed from content.83 88 * @return array Array of HTML attributes. 84 89 */ 85 public function apply_block_supports( $parsed_block) {86 $block_attributes = $parsed_block['attrs'];90 public function apply_block_supports() { 91 $block_attributes = self::$block_to_render['attrs']; 87 92 $block_type = WP_Block_Type_Registry::get_instance()->get_registered( 88 $parsed_block['blockName']93 self::$block_to_render['blockName'] 89 94 ); 90 95 … … 156 161 * @since 5.6.0 157 162 * 158 * @global array $current_parsed_block Block currently being parsed.159 *160 163 * @param array $extra_attributes Optional. Extra attributes to render on the block wrapper. 161 164 * … … 163 166 */ 164 167 function get_block_wrapper_attributes( $extra_attributes = array() ) { 165 global $current_parsed_block; 166 $new_attributes = WP_Block_Supports::get_instance()->apply_block_supports( $current_parsed_block ); 168 $new_attributes = WP_Block_Supports::get_instance()->apply_block_supports(); 167 169 168 170 if ( empty( $new_attributes ) && empty( $extra_attributes ) ) { … … 209 211 return implode( ' ', $normalized_attributes ); 210 212 } 211
Note: See TracChangeset
for help on using the changeset viewer.