WP_Image_Editor::get_size() WordPress Method

The WP_Image_Editor::get_size() method is used to get the width and height of an image. This is useful for getting the dimensions of an image so that you can resize it or crop it accordingly. The method returns an array with the width and height of the image.

WP_Image_Editor::get_size() #

Gets dimensions of image.


Return

(int[]) Dimensions of the image.

  • 'width'
    (int) The image width.
  • 'height'
    (int) The image height.


Top ↑

Source

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

	public function get_size() {
		return $this->size;
	}


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.