Display an Image Sizes selector as radio, checkbox or select field type.
Setting name | Description |
Allow Image Sizes | Filter which image size can be chosen |
Appearance | Select the appearance of this field |
Default Value | Enter each default value on a new line |
Display Format | Choose between Size name, size or size name and dimensions |
Return Value | Return the size object or size name |
Allow Null | Allow empty value |
Layout | Choose the layout |
Toggle | Allow to toggle all values |
Allow Custom | Allow custom value |
Save Custom | Save custom value in the field settings |
Select multiple values | Allow multiple values selection |
Stylised UI | Enable Select2 UI style |
$image_sizes = get_field('image_sizes');
/**
* array(
* 'name' => 'thumbnail',
* 'width' => 150,
* 'height' => 150,
* 'crop' => true,
* )
*/
$image_sizes = get_field('image_sizes');
// thumbnail
$image_sizes = get_field('image_sizes', false, false);
// thumbnail