Make WordPress Core

Ticket #34612: 34612.4.diff

File 34612.4.diff, 2.7 KB (added by joemcgill, 10 years ago)
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index f8a2da5..d54ddbb 100644
    function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $image 
    11361136}
    11371137
    11381138/**
    1139  * Create 'sizes' attribute value for an image.
     1139 * Creates a 'sizes' attribute value for an image.
    11401140 *
    11411141 * @since 4.4.0
    11421142 *
    11431143 * @param array|string $size          Image size to retrieve. Accepts any valid image size, or an array
    11441144 *                                    of width and height values in pixels (in that order). Default 'medium'.
    1145  * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'.
     1145 * @param string       $image_src     Optional. The URL to the image file. Default null.
     1146 * @param array        $image_meta    Optional. The image meta data as returned by 'wp_get_attachment_metadata()'. Default null.
    11461147 * @param int          $attachment_id Optional. Image attachment ID. Either `$image_meta` or `$attachment_id` is needed
    1147  *                                    when using the image size name as argument for `$size`.
    1148  * @param string       $image_src     Optional. The URL to the image file.
     1148 *                                    when using the image size name as argument for `$size`. Default 0.
    11491149 *
    11501150 * @return string|bool A valid source size value for use in a 'sizes' attribute or false.
    11511151 */
    1152 function wp_calculate_image_sizes( $size, $image_src, $image_meta, $attachment_id = 0 ) {
     1152function wp_calculate_image_sizes( $size, $image_src = null, $image_meta = null, $attachment_id = 0 ) {
    11531153        $width = 0;
    11541154
    11551155        if ( is_array( $size ) ) {
    function wp_calculate_image_sizes( $size, $image_src, $image_meta, $attachment_i 
    11811181         *
    11821182         * @param string       $sizes         A source size value for use in a 'sizes' attribute.
    11831183         * @param array|string $size          Requested size. Image size or array of width and height values
    1184          *                                    in pixels (in that order). Default 'medium'.
    1185          * @param string       $image_src     The URL to the image file.
    1186          * @param array        $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()'.
    1187          * @param int          $attachment_id Image attachment ID of the original image.
     1184         *                                    in pixels (in that order).
     1185         * @param string|null  $image_src     The URL to the image file or null.
     1186         * @param array|null   $image_meta    The image meta data as returned by 'wp_get_attachment_metadata()' or null.
     1187         * @param int          $attachment_id Image attachment ID of the original image or 0.
    11881188         */
    11891189        return apply_filters( 'wp_calculate_image_sizes', $sizes, $size, $image_src, $image_meta, $attachment_id );
    11901190}