diff --git a/wp-includes/media.php b/wp-includes/media.php index 4eb2886205..9fac913386 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -861,7 +861,7 @@ function wp_get_attachment_image($attachment_id, $size = 'thumbnail', $icon = fa // Generate 'srcset' and 'sizes' if not already present. if ( empty( $attr['srcset'] ) ) { - $image_meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); + $image_meta = wp_get_attachment_metadata( $attachment_id ); if ( is_array( $image_meta ) ) { $size_array = array( absint( $width ), absint( $height ) ); @@ -990,7 +990,7 @@ function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $imag } if ( ! is_array( $image_meta ) ) { - $image_meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); + $image_meta = wp_get_attachment_metadata( $attachment_id ); } $image_src = $image[0]; @@ -1206,7 +1206,7 @@ function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image } if ( ! is_array( $image_meta ) ) { - $image_meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); + $image_meta = wp_get_attachment_metadata( $attachment_id ); } $image_src = $image[0]; @@ -1239,7 +1239,7 @@ function wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, $width = absint( $size[0] ); } elseif ( is_string( $size ) ) { if ( ! $image_meta && $attachment_id ) { - $image_meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); + $image_meta = wp_get_attachment_metadata( $attachment_id ); } if ( is_array( $image_meta ) ) { @@ -1314,7 +1314,7 @@ function wp_make_content_images_responsive( $content ) { } foreach ( $selected_images as $image => $attachment_id ) { - $image_meta = get_post_meta( $attachment_id, '_wp_attachment_metadata', true ); + $image_meta = wp_get_attachment_metadata( $attachment_id ); $content = str_replace( $image, wp_image_add_srcset_and_sizes( $image, $image_meta, $attachment_id ), $content ); } diff --git a/wp-includes/version.php b/wp-includes/version.php index d18d1839bb..530fc52889 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.7-alpha-38295'; +$wp_version = '4.7-alpha-38296'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.