1. drupal
    1. 8
    2. 7
8 – 7 image_style_options($include_empty = TRUE)

Get an array of image styles suitable for using as select list options.


$include_empty If TRUE a <none> option will be inserted in the options array.

Return value

Array of image styles both key and value are set to style name.

▾ 6 functions call image_style_options()

image_example_style_form in examples/image_example/
Form for uploading and displaying an image using selected style.
image_field_formatter_settings_form in modules/image/
Implements hook_field_formatter_settings_form().
image_field_formatter_settings_summary in modules/image/
Implements hook_field_formatter_settings_summary().
image_field_widget_settings_form in modules/image/
Implements hook_field_widget_settings_form().
image_style_delete_form in modules/image/
Form builder; Form for deleting an image style.
user_admin_settings in modules/user/
Form builder; Configure user settings for this site.


modules/image/image.module, line 677

function image_style_options($include_empty = TRUE) {
  $styles = image_styles();
  $options = array();
  if ($include_empty && !empty($styles)) {
    $options[''] = t('<none>');
  $options = array_merge($options, drupal_map_assoc(array_keys($styles)));
  if (empty($options)) {
    $options[''] = t('No defined styles');
  return $options;