You appear to be a bot. Output may be restricted
Description
Standardises and validates the size_data array.
Usage
$array = Jetpack_Photon_ImageSizes::standardize_size_data( $size_data );
Parameters
- $size_data
- ( array ) required – Size data array – at least containing height or width key. Can contain crop as well.
Returns
array Array with populated width, height and crop keys; empty array if no width and height are provided.
Source
File name: jetpack/_inc/lib/class.jetpack-photon-image-sizes.php
Lines:
1 to 14 of 14
public function standardize_size_data( $size_data ) { $has_at_least_width_or_height = ( isset( $size_data['width'] ) || isset( $size_data['height'] ) ); if ( ! $has_at_least_width_or_height ) { return array(); } $defaults = array( 'width' => null, 'height' => null, 'crop' => false, ); return array_merge( $defaults, $size_data ); }