su_get_image_sizes

The shortcodes-ultimate su get image sizes function.

Published Date - February 15, 2021

Description

Helper function to get array with available intermediate image sizes.

su_get_image_sizes();

Usage

The following example is for adding a hook callback.

if ( !function_exists( 'su_get_image_sizes' ) ) {
    require_once ABSPATH . PLUGINDIR . 'shortcodes-ultimateshortcodes-ultimate/includes/functions-galleries.php';
}



// NOTICE! Understand what this does before running.
$result = su_get_image_sizes();
            

Defined

The function is defined in the following location(s).

shortcodes-ultimate/includes/functions-galleries.php

function su_get_image_sizes() {

	$sizes = array(
		'full' => __( 'Original image size', 'shortcodes-ultimate' ),
	);

	foreach ( get_intermediate_image_sizes() as $size ) {
		$sizes[ $size ] = ucfirst( $size );
	}

	return $sizes;

}