Changeset 55909
- Timestamp:
- 06/13/2023 09:51:11 AM (18 months ago)
- Location:
- trunk
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/script-loader.php
r55900 r55909 2873 2873 // Build an array of styles that have a path defined. 2874 2874 foreach ( $wp_styles->queue as $handle ) { 2875 if ( ! isset( $wp_styles->registered[ $handle ] ) ) { 2876 continue; 2877 } 2875 2878 $src = $wp_styles->registered[ $handle ]->src; 2876 $path = wp_styles()->get_data( $handle, 'path' );2879 $path = $wp_styles->get_data( $handle, 'path' ); 2877 2880 if ( $path && $src ) { 2878 2881 $size = wp_filesize( $path ); -
trunk/tests/phpunit/tests/dependencies/styles.php
r55888 r55909 539 539 540 540 /** 541 * @ticket 58394 542 * 543 * @covers ::wp_maybe_inline_styles 544 */ 545 public function test_wp_maybe_inline_styles_dequeue_styles() { 546 $filter = new MockAction(); 547 add_filter( 'pre_wp_filesize', array( $filter, 'filter' ) ); 548 wp_register_style( 'test-handle', '/' . WPINC . '/css/classic-themes.css' ); 549 wp_style_add_data( 'test-handle', 'path', ABSPATH . WPINC . '/css/classic-themes.css' ); 550 551 wp_enqueue_style( 'test-handle' ); 552 553 wp_deregister_style( 'test-handle' ); 554 555 wp_maybe_inline_styles(); 556 557 $this->assertSame( 0, $filter->get_call_count() ); 558 } 559 560 /** 541 561 * wp_filesize should be only be called once, as on the second run of wp_maybe_inline_styles, 542 562 * src will be set to false and filesize will not be requested.
Note: See TracChangeset
for help on using the changeset viewer.