WordPress.org

Make WordPress Core

Ticket #34733: 34733.diff

File 34733.diff, 3.2 KB (added by joemcgill, 6 years ago)
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index ae108e5..ac105e7 100644
    function _wp_get_image_size_from_meta( $size_name, $image_meta ) { 
    935935 * @param int          $attachment_id Image attachment ID.
    936936 * @param array|string $size          Optional. Image size. Accepts any valid image size, or an array of
    937937 *                                    width and height values in pixels (in that order). Default 'medium'.
    938  * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
     938 * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. Default null.
    939939 * @return string|bool A 'srcset' value string or false.
    940940 */
    941941function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $image_meta = null ) {
    function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium', $imag 
    964964 * @param array  $size_array    Array of width and height values in pixels (in that order).
    965965 * @param string $image_src     The 'src' of the image.
    966966 * @param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.
    967  * @param int    $attachment_id Optional. The image attachment ID to pass to the filter.
     967 * @param int    $attachment_id Optional. The image attachment ID to pass to the filter. Default 0.
    968968 * @return string|bool          The 'srcset' attribute value. False on error or when only one source exists.
    969969 */
    970970function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attachment_id = 0 ) {
    function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac 
    10881088         * @param array  $size_array    Array of width and height values in pixels (in that order).
    10891089         * @param string $image_src     The 'src' of the image.
    10901090         * @param array  $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.
    1091          * @param int    $attachment_id Image attachment ID.
     1091         * @param int    $attachment_id Image attachment ID or 0.
    10921092         */
    10931093        $sources = apply_filters( 'wp_calculate_image_srcset', $sources, $size_array, $image_src, $image_meta, $attachment_id );
    10941094
    function wp_calculate_image_srcset( $size_array, $image_src, $image_meta, $attac 
    11141114 * @param int          $attachment_id Image attachment ID.
    11151115 * @param array|string $size          Optional. Image size. Accepts any valid image size, or an array of width
    11161116 *                                    and height values in pixels (in that order). Default 'medium'.
    1117  * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
    1118  * @return string|bool A 'srcset' value string or false.
     1117 * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. Default null.
     1118 * @return string|bool A valid source size value for use in a 'sizes' attribute or false.
    11191119 */
    11201120function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image_meta = null ) {
    11211121        if ( ! $image = wp_get_attachment_image_src( $attachment_id, $size ) ) {