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.


Top ↑

Return Return

(array) Width and height. Empty array if the dimensions cannot be found.


Top ↑

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'],
		);
	}


Top ↑

User Contributed Notes User Contributed Notes

You must log in before being able to contribute a note or feedback.