Alert: This function’s access is marked private. This means it is not intended for use by plugin or theme developers, only in other core functions. It is listed here for completeness.
WC_Regenerate_Images::get_full_size_image_dimensions( int $attachment_id )
Get full size image dimensions.
Description Description
Parameters Parameters
- $attachment_id
-
(Required) Attachment ID of image.
Return Return
(array) Width and height. Empty array if the dimensions cannot be found.
Source Source
File: includes/class-wc-regenerate-images.php
private static function get_full_size_image_dimensions( $attachment_id ) { $imagedata = wp_get_attachment_metadata( $attachment_id ); if ( ! $imagedata ) { return array(); } if ( ! isset( $imagedata['file'] ) && isset( $imagedata['sizes']['full'] ) ) { $imagedata['height'] = $imagedata['sizes']['full']['height']; $imagedata['width'] = $imagedata['sizes']['full']['width']; } return array( 'width' => $imagedata['width'], 'height' => $imagedata['height'], ); }