diff --git a/wp-includes/media.php b/wp-includes/media.php index 5c93aee225..8a4277a2f5 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -1973,6 +1973,7 @@ function wp_filter_content_tags( $content, $context = null ) { * @return string Converted `img` tag with optimization attributes added. */ function wp_img_tag_add_loading_optimization_attrs( $image, $context ) { + $src = preg_match( '/ src=["\']?([^"\']*)/i', $image, $matche_src ) ? $matche_src[1] : null; $width = preg_match( '/ width=["\']([0-9]+)["\']/', $image, $match_width ) ? (int) $match_width[1] : null; $height = preg_match( '/ height=["\']([0-9]+)["\']/', $image, $match_height ) ? (int) $match_height[1] : null; $loading_val = preg_match( '/ loading=["\']([A-Za-z]+)["\']/', $image, $match_loading ) ? $match_loading[1] : null; @@ -1987,6 +1988,7 @@ function wp_img_tag_add_loading_optimization_attrs( $image, $context ) { $optimization_attrs = wp_get_loading_optimization_attributes( 'img', array( + 'src' => $src, 'width' => $width, 'height' => $height, 'loading' => $loading_val, diff --git a/wp-includes/version.php b/wp-includes/version.php index 50dbedda25..8c5c0b7e4f 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -16,7 +16,7 @@ * * @global string $wp_version */ -$wp_version = '6.7-alpha-58972'; +$wp_version = '6.7-alpha-58974'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.