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.


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.


Top ↑

Return

(array) An array of resized images metadata by size.


Top ↑

Source

File: wp-includes/class-wp-image-editor.php

	abstract public function multi_resize( $sizes );

Top ↑

Changelog

Changelog
VersionDescription
3.5.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.