Changeset 49982
- Timestamp:
- 01/19/2021 11:48:59 AM (4 years ago)
- Location:
- trunk
- Files:
-
- 1 added
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/blocks.php
r49981 r49982 170 170 $style_handle = generate_block_asset_handle( $metadata['name'], $field_name ); 171 171 $block_dir = dirname( $metadata['file'] ); 172 $style_file = realpath( "$block_dir/$style_path" ); 172 173 $result = wp_register_style( 173 174 $style_handle, 174 175 plugins_url( $style_path, $metadata['file'] ), 175 176 array(), 176 filemtime( realpath( "$block_dir/$style_path" ) ) 177 ); 177 filemtime( $style_file ) 178 ); 179 if ( file_exists( str_replace( '.css', '-rtl.css', $style_file ) ) ) { 180 wp_style_add_data( $style_handle, 'rtl', 'replace' ); 181 } 182 178 183 return $result ? $style_handle : false; 179 184 } -
trunk/tests/phpunit/tests/blocks/register.php
r49981 r49982 270 270 271 271 $this->assertSame( 'unit-tests-test-block-style', $result ); 272 $this->assertSame( 'replace', wp_styles()->get_data( 'unit-tests-test-block-style', 'rtl' ) ); 272 273 } 273 274
Note: See TracChangeset
for help on using the changeset viewer.