Changeset 54703 for trunk/src/wp-includes/global-styles-and-settings.php
- Timestamp:
- 10/27/2022 03:39:20 PM (2 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/global-styles-and-settings.php
r54412 r54703 219 219 } 220 220 221 $stylesheet_handle = 'global-styles'; 221 222 if ( isset( $metadata['name'] ) ) { 222 $block_name = str_replace( 'core/', '', $metadata['name'] );223 223 /* 224 224 * These block styles are added on block_render. … … 226 226 * based on whether or not the block is used on the page. 227 227 */ 228 wp_add_inline_style( 'wp-block-' . $block_name, $block_css ); 228 if ( str_starts_with( $metadata['name'], 'core/' ) ) { 229 $block_name = str_replace( 'core/', '', $metadata['name'] ); 230 $stylesheet_handle = 'wp-block-' . $block_name; 231 } 232 wp_add_inline_style( $stylesheet_handle, $block_css ); 229 233 } 230 234 … … 243 247 ); 244 248 if ( isset( $result[0] ) ) { 245 $block_name = str_replace( 'core/', '', $result[0] ); 246 wp_add_inline_style( 'wp-block-' . $block_name, $block_css ); 249 if ( str_starts_with( $result[0], 'core/' ) ) { 250 $block_name = str_replace( 'core/', '', $result[0] ); 251 $stylesheet_handle = 'wp-block-' . $block_name; 252 } 253 wp_add_inline_style( $stylesheet_handle, $block_css ); 247 254 } 248 255 }
Note: See TracChangeset
for help on using the changeset viewer.