WP_Image_Editor::get_suffix() WordPress Method

The WP_Image_Editor::get_suffix() method was introduced in Wordpress 4.5. It allows for the retrieval of an image's suffix (file extension) from its filename. This can be useful for image editing plugins that need to know an image's file extension in order to determine which editor to use.

WP_Image_Editor::get_suffix() #

Builds and returns proper suffix for file based on height and width.


Return

(string|false) suffix


Top ↑

Source

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

	public function get_suffix() {
		if ( ! $this->get_size() ) {
			return false;
		}

		return "{$this->size['width']}x{$this->size['height']}";
	}


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.