WP_Image_Editor::multi_resize() WordPress Method
The WP_Image_Editor::multi_resize() function is used to resize an image to multiple sizes. This is useful for creating different image sizes for different devices or for creating different image sizes for different areas of a website.
WP_Image_Editor::multi_resize( array $sizes ) #
Resize multiple images from a single source.
Contents
Parameters
- $sizes
(array)(Required)An array of image size arrays. Default sizes are 'small', 'medium', 'large'.
- '...$0'
(array)- 'width'
(int) Image width. - 'height'
(int) Image height. - 'crop'
(bool) Optional. Whether to crop the image. Default false.
- 'width'
- '...$0'
Return
(array) An array of resized images metadata by size.
Source
File: wp-includes/class-wp-image-editor.php
abstract public function multi_resize( $sizes );
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.5.0 | Introduced. |