Changeset 50703
- Timestamp:
- 04/13/2021 08:02:33 AM (4 years ago)
- Location:
- trunk/src/wp-includes
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/class-wp-block-styles-registry.php
r49120 r50703 37 37 * @param string $block_name Block type name including namespace. 38 38 * @param array $style_properties Array containing the properties of the style name, label, 39 * style (name of the stylesheet to be enqueued),39 * is_default, style_handle (name of the stylesheet to be enqueued), 40 40 * inline_style (string containing the CSS to be added). 41 41 * @return bool True if the block style was registered with success and false otherwise. -
trunk/src/wp-includes/script-loader.php
r50629 r50703 2304 2304 foreach ( $block_styles as $block_name => $styles ) { 2305 2305 foreach ( $styles as $style_properties ) { 2306 $block_style = array( 2307 'name' => $style_properties['name'], 2308 'label' => $style_properties['label'], 2309 ); 2310 if ( isset( $style_properties['is_default'] ) ) { 2311 $block_style['isDefault'] = $style_properties['is_default']; 2312 } 2306 2313 $register_script_lines[] = sprintf( 2307 2314 ' wp.blocks.registerBlockStyle( \'%s\', %s );', 2308 2315 $block_name, 2309 wp_json_encode( 2310 array( 2311 'name' => $style_properties['name'], 2312 'label' => $style_properties['label'], 2313 ) 2314 ) 2316 wp_json_encode( $block_style ) 2315 2317 ); 2316 2318 }
Note: See TracChangeset
for help on using the changeset viewer.