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
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']}"; }
Expand full source codeCollapse full source codeView on TracView on GitHub
Changelog
Version | Description |
---|---|
3.5.0 | Introduced. |