| 610 | | * @return false|array False on failure or array of file path, width, and height on success. |
| | 610 | * @return false|array $data { |
| | 611 | * Array of file relative path, width, and height on success. |
| | 612 | * Additionally includes absolute path and URL if registered size is passed to $size parameter. |
| | 613 | * False on failure. |
| | 614 | * |
| | 615 | * @type string $file Image's path relative to uploads directory |
| | 616 | * @type int $width Width of image |
| | 617 | * @type int $height Height of image |
| | 618 | * @type string $path Optional. Image's absolute filesystem path. |
| | 619 | * Only returned if registered size is passed to $size parameter. |
| | 620 | * @type string $url Optional. Image's URL. |
| | 621 | * Only returned if registered size is passed to $size parameter. |
| | 622 | * } |
| 623 | | $file = $data['file']; |
| 624 | | list($width, $height) = image_constrain_size_for_editor( $data['width'], $data['height'], $size ); |
| 625 | | return compact( 'file', 'width', 'height' ); |
| | 635 | list( $data['width'], $data['height'] ) = image_constrain_size_for_editor( $data['width'], $data['height'], $size ); |
| | 636 | |
| | 637 | /** This filter is documented in wp-includes/media.php */ |
| | 638 | return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size ); |
| 651 | | $file = $data['file']; |
| 652 | | list( $width, $height ) = image_constrain_size_for_editor( $data['width'], $data['height'], $size ); |
| 653 | | return compact( 'file', 'width', 'height' ); |
| | 664 | list( $data['width'], $data['height'] ) = image_constrain_size_for_editor( $data['width'], $data['height'], $size ); |
| | 665 | |
| | 666 | /** This filter is documented in wp-includes/media.php */ |
| | 667 | return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size ); |
| 668 | | return $data; |
| | 682 | |
| | 683 | /** |
| | 684 | * Filter the output of image_get_intermediate_size() |
| | 685 | * |
| | 686 | * @since 4.4.0 |
| | 687 | * |
| | 688 | * @see image_get_intermediate_size() |
| | 689 | * |
| | 690 | * @param array $data Array of file relative path, width, and height on success. |
| | 691 | * May also include file absolute path and URL. See image_get_intermediate_size() for details. |
| | 692 | * @param int $post_id The post_id of the image attachment |
| | 693 | * @param string|array $size Registered image size or flat array of height and width dimensions initially requested. |
| | 694 | */ |
| | 695 | return apply_filters( 'image_get_intermediate_size', $data, $post_id, $size ); |