You appear to be a bot. Output may be restricted
Description
Return all registered image sizes arrays, including the standard sizes.
Return a two-dimensional array of standard and additionally registered image sizes, with width, height and crop sub-keys. Here, the standard sizes have their sub-keys populated by pulling from the options saved in the database.
Usage
$array = genesis_get_image_sizes();
Parameters
Returns
array Two-dimensional, with width`,
sub-keys. height
and `crop
Source
File name: genesis/lib/functions/image.php
Lines:
1 to 41 of 41
function genesis_get_image_sizes() { global $_wp_additional_image_sizes; /** * Allows controlling the image sizes before running the get_intermediate_image_sizes() logic. * * The return value must be false or a two-dimensional array with `width`, `height`, and `crop` subkeys. * * @param bool|array $pre False or genesis_get_image_sizes compatible array. */ $pre = apply_filters( 'genesis_pre_get_image_sizes', false ); if ( $pre ) { return $pre; } $sizes = []; foreach ( get_intermediate_image_sizes() as $size ) { if ( isset( $_wp_additional_image_sizes[ $size ] ) ) { $sizes[ $size ] = [ 'width' => absint( $_wp_additional_image_sizes[ $size ]['width'] ), 'height' => absint( $_wp_additional_image_sizes[ $size ]['height'] ), 'crop' => $_wp_additional_image_sizes[ $size ]['crop'], ]; } else { $sizes[ $size ] = [ 'width' => absint( get_option( "{$size}_size_w" ) ), 'height' => absint( get_option( "{$size}_size_h" ) ), 'crop' => (bool) get_option( "{$size}_crop" ), ]; } } /** * Allows filtering the genesis_get_image_sizes() output. * * @param array $sizes Two-dimensional, with `width`, `height` and `crop` sub-keys. */ return (array) apply_filters( 'genesis_get_image_sizes', $sizes ); }