Changeset 56416 for trunk/src/wp-includes/media.php
- Timestamp:
- 08/18/2023 05:54:41 PM (3 years ago)
- File:
-
- 1 edited
-
trunk/src/wp-includes/media.php (modified) (5 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/media.php
r56386 r56416 284 284 * @param int $width Optional. Image width in pixels. Default 0. 285 285 * @param int $height Optional. Image height in pixels. Default 0. 286 * @param bool|array $crop Optional. Image cropping behavior. If false, the image will be scaled (default), 287 * If true, image will be cropped to the specified dimensions using center positions. 288 * If an array, the image will be cropped using the array to specify the crop location. 289 * Array values must be in the format: array( x_crop_position, y_crop_position ) where: 290 * - x_crop_position accepts: 'left', 'center', or 'right'. 291 * - y_crop_position accepts: 'top', 'center', or 'bottom'. 286 * @param bool|array $crop { 287 * Optional. Image cropping behavior. If false, the image will be scaled (default). 288 * If true, image will be cropped to the specified dimensions using center positions. 289 * If an array, the image will be cropped using the array to specify the crop location: 290 * 291 * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. 292 * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. 293 * } 292 294 */ 293 295 function add_image_size( $name, $width = 0, $height = 0, $crop = false ) { … … 344 346 * @param int $width Image width in pixels. 345 347 * @param int $height Image height in pixels. 346 * @param bool|array $crop Optional. Whether to crop images to specified width and height or resize. 347 * An array can specify positioning of the crop area. Default false. 348 * @param bool|array $crop { 349 * Optional. Image cropping behavior. If false, the image will be scaled (default), 350 * If true, image will be cropped to the specified dimensions using center positions. 351 * If an array, the image will be cropped using the array to specify the crop location: 352 * 353 * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. 354 * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. 355 * } 348 356 */ 349 357 function set_post_thumbnail_size( $width = 0, $height = 0, $crop = false ) { … … 512 520 * within a specified width and height. 513 521 * 514 * Cropping behavior is dependent on the value of $crop:515 * 1. If false (default), images will not be cropped.516 * 2. If an array in the form of array( x_crop_position, y_crop_position ):517 * - x_crop_position accepts 'left' 'center', or 'right'.518 * - y_crop_position accepts 'top', 'center', or 'bottom'.519 * Images will be cropped to the specified dimensions within the defined crop area.520 * 3. If true, images will be cropped to the specified dimensions using center positions.521 *522 522 * @since 2.5.0 523 523 * … … 526 526 * @param int $dest_w New width in pixels. 527 527 * @param int $dest_h New height in pixels. 528 * @param bool|array $crop Optional. Whether to crop image to specified width and height or resize. 529 * An array can specify positioning of the crop area. Default false. 528 * @param bool|array $crop { 529 * Optional. Image cropping behavior. If false, the image will be scaled (default). 530 * If true, image will be cropped to the specified dimensions using center positions. 531 * If an array, the image will be cropped using the array to specify the crop location: 532 * 533 * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. 534 * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. 535 * } 530 536 * @return array|false Returned array matches parameters for `imagecopyresampled()`. False on failure. 531 537 */ … … 671 677 * @since 2.5.0 672 678 * 673 * @param string $file File path. 674 * @param int $width Image width. 675 * @param int $height Image height. 676 * @param bool $crop Optional. Whether to crop image to specified width and height or resize. 677 * Default false. 679 * @param string $file File path. 680 * @param int $width Image width. 681 * @param int $height Image height. 682 * @param bool|array $crop { 683 * Optional. Image cropping behavior. If false, the image will be scaled (default), 684 * If true, image will be cropped to the specified dimensions using center positions. 685 * If an array, the image will be cropped using the array to specify the crop location: 686 * 687 * @type string $0 The x crop position. Accepts 'left' 'center', or 'right'. 688 * @type string $1 The y crop position. Accepts 'top', 'center', or 'bottom'. 689 * } 678 690 * @return array|false Metadata array on success. False if no image was created. 679 691 */
Note:
See TracChangeset
for help on using the changeset viewer.
![(please configure the [header_logo] section in trac.ini)](/chrome/site/your_project_logo.png)