WordPress.org

Make WordPress Core

Ticket #42463: 42463.5.patch

File 42463.5.patch, 2.0 KB (added by pierlo, 10 months ago)
  • src/wp-includes/media.php

    diff --git src/wp-includes/media.php src/wp-includes/media.php
    index 6f104a20c7..c22b8a9063 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. 1. If false, image will be scaled, not cropped (default).
     279 *                                                                         2. If true, image will be cropped to the specified dimensions using center positions.
     280 *                                                                         3. If an array, it must be in the format: array( x_crop_position, y_crop_position ) where:
     281 *                                                                              - x_crop_position accepts: 'left', 'center', or 'right'
     282 *                                                                                  - y_crop_position accepts: 'top', 'center', or 'bottom'
     283 *                                                                            The image will be cropped to the specified dimensions within the defined crop area.
    288284 */
    289285function add_image_size( $name, $width = 0, $height = 0, $crop = false ) {
    290286        global $_wp_additional_image_sizes;