Changeset 55821
- Timestamp:
- 05/17/2023 06:29:41 PM (15 months ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/default-filters.php
r55695 r55821 445 445 add_action( 'delete_post', '_wp_delete_customize_changeset_dependent_auto_drafts' ); 446 446 447 // Post Thumbnail CSS classfiltering.447 // Post Thumbnail filtering. 448 448 add_action( 'begin_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_add' ); 449 449 add_action( 'end_fetch_post_thumbnail_html', '_wp_post_thumbnail_class_filter_remove' ); 450 451 450 452 451 453 // Redirect old slugs. -
trunk/src/wp-includes/media.php
r55816 r55821 1051 1051 ); 1052 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1053 1062 // Add `loading` attribute. 1054 if ( wp_lazy_loading_enabled( 'img', 'wp_get_attachment_image') ) {1055 $default_attr['loading'] = wp_get_loading_attr_default( 'wp_get_attachment_image');1063 if ( wp_lazy_loading_enabled( 'img', ) ) { 1064 $default_attr['loading'] = wp_get_loading_attr_default( ); 1056 1065 } 1057 1066 … … 2169 2178 function _wp_post_thumbnail_class_filter_remove( $attr ) { 2170 2179 remove_filter( 'wp_get_attachment_image_attributes', '_wp_post_thumbnail_class_filter' ); 2180 2181 2182 2183 2184 2185 2186 2187 2188 2189 2190 2191 2192 2193 2194 2195 2196 2197 2198 2199 2200 2201 2202 2203 2204 2205 2206 2207 2208 2209 2210 2211 2212 2213 2214 2215 2216 2217 2218 2219 2220 2171 2221 } 2172 2222 -
trunk/src/wp-includes/post-thumbnail-template.php
r55093 r55821 187 187 } 188 188 189 // Add `loading` attribute.190 if ( wp_lazy_loading_enabled( 'img', 'the_post_thumbnail' ) ) {191 // Get the 'loading' attribute value to use as default, taking precedence over the default from192 // `wp_get_attachment_image()`.193 $loading = wp_get_loading_attr_default( 'the_post_thumbnail' );194 195 // Add the default to the given attributes unless they already include a 'loading' directive.196 if ( empty( $attr ) ) {197 $attr = array( 'loading' => $loading );198 } elseif ( is_array( $attr ) && ! array_key_exists( 'loading', $attr ) ) {199 $attr['loading'] = $loading;200 } elseif ( is_string( $attr ) && ! preg_match( '/(^|&)loading=/', $attr ) ) {201 $attr .= '&loading=' . $loading;202 }203 }204 205 189 $html = wp_get_attachment_image( $post_thumbnail_id, $size, false, $attr ); 206 190 -
trunk/tests/phpunit/tests/media.php
r55816 r55821 3965 3965 3966 3966 /** 3967 3968 3969 3970 3971 3972 3973 3974 3975 3976 3977 3978 3979 3980 3981 3982 3983 3984 3985 3986 3987 3988 3989 3990 3991 3992 3993 3994 3995 3996 3997 3998 3999 4000 4001 4002 4003 4004 4005 4006 4007 4008 4009 4010 4011 4012 4013 4014 4015 4016 4017 4018 4019 4020 4021 4022 3967 4023 * Add threshold to create a `-scaled` output image for testing. 3968 4024 */ -
trunk/tests/phpunit/tests/post/thumbnails.php
r55093 r55821 451 451 } 452 452 453 454 455 456 457 458 459 460 461 462 463 464 465 466 467 468 469 470 471 472 473 474 475 476 477 478 479 480 481 482 483 484 485 486 487 488 489 490 491 492 493 494 495 496 497 498 499 500 501 502 503 504 505 506 507 508 509 510 511 512 513 514 515 516 517 518 519 520 521 522 523 524 525 526 527 528 529 530 531 532 533 534 535 536 537 538 539 540 541 542 543 544 545 546 547 548 549 550 551 552 553 554 555 556 557 558 559 560 561 562 563 564 565 566 567 568 569 570 571 572 573 574 575 576 577 578 579 580 581 453 582 public function filter_post_thumbnail_size( $size, $post_id ) { 454 583 if ( is_array( $this->current_size_filter_data ) && isset( $this->current_size_filter_data[ $post_id ] ) ) {
Note: See TracChangeset
for help on using the changeset viewer.