WordPress.org

Make WordPress Core

Ticket #42463: 42463.2.diff

File 42463.2.diff, 2.0 KB (added by joemcgill, 12 months ago)
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 71bfed3a42..0bdc079739 100644
    function image_downsize( $id, $size = 'medium' ) { 
    268268/**
    269269 * Register a new image size.
    270270 *
    271  * Cropping behavior for the image size is dependent on the value of $crop:
    272  * 1. If false (default), images will be scaled, not cropped.
    273  * 2. If an array in the form of array( x_crop_position, y_crop_position ):
    274  *    - x_crop_position accepts 'left' 'center', or 'right'.
    275  *    - y_crop_position accepts 'top', 'center', or 'bottom'.
    276  *    Images will be cropped to the specified dimensions within the defined crop area.
    277  * 3. If true, images will be cropped to the specified dimensions using center positions.
    278  *
    279271 * @since 2.9.0
    280272 *
    281273 * @global array $_wp_additional_image_sizes Associative array of additional image sizes.
    function image_downsize( $id, $size = 'medium' ) { 
    283275 * @param string     $name   Image size identifier.
    284276 * @param int        $width  Optional. Image width in pixels. Default 0.
    285277 * @param int        $height Optional. Image height in pixels. Default 0.
    286  * @param bool|array $crop   Optional. Whether to crop images to specified width and height or resize.
    287  *                           An array can specify positioning of the crop area. Default false.
     278 * @param bool|array $crop   Optional. Image cropping behavior. If false, the image will be scaled (default),
     279 *                                                                         If true, image will be cropped to the specified dimensions using center positions.
     280 *                                                                         If an array, the image will be cropped using the array to specify the crop location.
     281 *                                     Array values must be in the format: array( x_crop_position, y_crop_position ) where:
     282 *                                                                              - x_crop_position accepts: 'left', 'center', or 'right'
     283 *                                                                                  - y_crop_position accepts: 'top', 'center', or 'bottom'
    288284 */
    289285function add_image_size( $name, $width = 0, $height = 0, $crop = false ) {
    290286        global $_wp_additional_image_sizes;