1 file.api.php hook_file_formatter_FORMATTER_settings($form, &$form_state, $settings)

Define formatter settings.

Note: This is not really a hook. The function name is manually specified via 'settings callback' in hook_file_formatter_info(), with this recommended callback name pattern.


$form: An array representing the settings form.

$form_state: An array representing the current state of the settings form.

$settings: An array containing default settings for the form elements.


core/modules/file/file.api.php, line 156
Hooks for file module.


function hook_file_formatter_FORMATTER_settings($form, &$form_state, $settings) {
  $element['image_style'] = array(
    '#title' => t('Image style'),
    '#type' => 'select',
    '#options' => image_style_options(FALSE),
    '#default_value' => $settings['image_style'],
    '#empty_option' => t('None (original image)'),
  return $element;