Changeset 51254
- Timestamp:
- 06/29/2021 12:07:53 AM (3 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r51221 r51254 152 152 } 153 153 154 $style_handle = generate_block_asset_handle( $metadata['name'], $field_name ); 155 $block_dir = dirname( $metadata['file'] ); 156 $style_file = realpath( "$block_dir/$style_path" ); 157 $version = file_exists( $style_file ) ? filemtime( $style_file ) : false; 154 $style_handle = generate_block_asset_handle( $metadata['name'], $field_name ); 155 $block_dir = dirname( $metadata['file'] ); 156 $style_file = realpath( "$block_dir/$style_path" ); 157 $has_style_file = false !== $style_file; 158 $version = ! $is_core_block && $has_style_file ? filemtime( $style_file ) : false; 159 $style_uri = $has_style_file ? $style_uri : false; 158 160 $result = wp_register_style( 159 161 $style_handle, … … 165 167 wp_style_add_data( $style_handle, 'rtl', 'replace' ); 166 168 } 167 if ( file_exists( $style_file )) {169 if ( $has_style_file ) { 168 170 wp_style_add_data( $style_handle, 'path', $style_file ); 169 171 } … … 222 224 $metadata['style'] = "wp-block-$block_name"; 223 225 } 224 if ( ! isset( $metadata['editor _style'] ) ) {225 $metadata['editor _style'] = "wp-block-$block_name-editor";226 if ( ! isset( $metadata['editorStyle'] ) ) { 227 $metadata['editorStyle'] = "wp-block-{$block_name}-editor"; 226 228 } 227 229 }
Note: See TracChangeset
for help on using the changeset viewer.