lib/ImageHelper.php
private static function find_wp_dimensions( $size ) {
		global $_wp_additional_image_sizes;
		if ( isset($_wp_additional_image_sizes[$size]) ) {
			$w = $_wp_additional_image_sizes[$size]['width'];
			$h = $_wp_additional_image_sizes[$size]['height'];
		} else if ( in_array($size, array('thumbnail', 'medium', 'large')) ) {
			$w = get_option($size.'_size_w');
			$h = get_option($size.'_size_h');
		}
		if ( isset($w) && isset($h) && ($w || $h) ) {
			return array('w' => $w, 'h' => $h);
		}
		return false;
	}
private static function find_wp_dimensions( $size ) {
		global $_wp_additional_image_sizes;
		if ( isset($_wp_additional_image_sizes[$size]) ) {
			$w = $_wp_additional_image_sizes[$size]['width'];
			$h = $_wp_additional_image_sizes[$size]['height'];
		} else if ( in_array($size, array('thumbnail', 'medium', 'large')) ) {
			$w = get_option($size.'_size_w');
			$h = get_option($size.'_size_h');
		}
		if ( isset($w) && isset($h) && ($w || $h) ) {
			return array('w' => $w, 'h' => $h);
		}
		return false;
	}
private static function find_wp_dimensions ( $ size ) { global $ _wp_additional_image_sizes ; if ( isset ( $ _wp_additional_image_sizes [ $ size ] ) ) { $ w = $ _wp_additional_image_sizes [ $ size ] [ 'width' ] ; $ h = $ _wp_additional_image_sizes [ $ size ] [ 'height' ] ; } else if ( in_array ( $ size , array ( 'thumbnail' , 'medium' , 'large' ) ) ) { $ w = get_option ( $ size . '_size_w' ) ; $ h = get_option ( $ size . '_size_h' ) ; } if ( isset ( $ w ) && isset ( $ h ) && ( $ w || $ h ) ) { return array ( 'w' => $ w , 'h' => $ h ) ; } return false ; }
Find the sizes of an image based on a defined image size
@param  string $size the image size to search for
can be WordPress-defined ("medium")
or user-defined ("my-awesome-size")
@return false|array {
@type int w
@type int h
}
Find the sizes of an image based on a defined image size