Make WordPress Core

Ticket #34464: 34464.diff

File 34464.diff, 3.7 KB (added by jaspermdegroot, 9 years ago)

inline docs improvements

  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 30df322..8713f77 100644
    function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium' 
    905905                return false;
    906906        }
    907907
    908         // Use the URL from the intermediate size or build the url from the metadata.
     908        // Use the URL from the intermediate size or build the URL from the metadata.
    909909        if ( ! empty( $image['url'] ) ) {
    910910                $img_url = $image['url'];
    911911        } else {
    function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium' 
    934934        $img_edited = preg_match( '/-e[0-9]{13}/', $img_url, $img_edit_hash );
    935935
    936936        /**
    937          * Filter the maximum width included in a srcset attribute.
     937         * Filter the maximum width included in a 'srcset' attribute.
    938938         *
    939939         * @since 4.4.0
    940940         *
    941          * @param array|string $size Size of image, either array or string.
     941         * @param int          $max_width The maximum width to include in the 'srcset'. Default '1600'.
     942         * @param array|string $size      Image size. Image size or an array of width and height
     943         *                                values in pixels (in that order).
    942944         */
    943945        $max_srcset_width = apply_filters( 'max_srcset_image_width', 1600, $size );
    944946
    945947        /*
    946          * Set up arrays to hold url candidates and matched image sources so
     948         * Set up arrays to hold URL candidates and matched image sources so
    947949         * we can avoid duplicates without looping through the full sources array
    948950         */
    949951        $candidates = $sources = array();
    function wp_get_attachment_image_srcset_array( $attachment_id, $size = 'medium' 
    994996         *
    995997         * @param array        $sources       An array of image urls and widths.
    996998         * @param int          $attachment_id Attachment ID for image.
    997          * @param array|string $size          Image size. Accepts any valid image size, or an array of width and height
    998          *                                    values in pixels (in that order). Default 'medium'.
     999         * @param array|string $size          Image size. Image size or an array of width and height
     1000         *                                    values in pixels (in that order).
    9991001         */
    10001002        return apply_filters( 'wp_get_attachment_image_srcset_array', $sources, $attachment_id, $size );
    10011003}
    function wp_get_attachment_image_srcset( $attachment_id, $size = 'medium' ) { 
    10301032         *
    10311033         * @param string       $srcset        A source set formated for a `srcset` attribute.
    10321034         * @param int          $attachment_id Attachment ID for image.
    1033          * @param array|string $size          Image size. Accepts any valid image size, or an array of width and height
    1034          *                                    values in pixels (in that order). Default 'medium'.
     1035         * @param array|string $size          Image size. Image size or an array of width and height
     1036         *                                    values in pixels (in that order).
    10351037         */
    10361038        return apply_filters( 'wp_get_attachment_image_srcset', rtrim( $srcset, ', ' ), $attachment_id, $size );
    10371039}
    function wp_get_attachment_image_sizes( $attachment_id, $size = 'medium', $width 
    10751077         *
    10761078         * @param string       $sizes         A source size value for use in a 'sizes' attribute.
    10771079         * @param int          $attachment_id Post ID of the original image.
    1078          * @param array|string $size          Image size. Accepts any valid image size, or an array of width and height
    1079          *                                    values in pixels (in that order). Default 'medium'.
     1080         * @param array|string $size          Image size. Image size or an array of width and height
     1081         *                                    values in pixels (in that order).
    10801082         * @param int          $width         Display width of the image.
    10811083         */
    10821084        return apply_filters( 'wp_get_attachment_image_sizes', $sizes, $attachment_id, $size, $width );