You are here

function hook_date_field_widget_settings_form_alter in Date 8

Same name and namespace in other branches
  1. 7.3 date.api.php \hook_date_field_widget_settings_form_alter()
  2. 7.2 date.api.php \hook_date_field_widget_settings_form_alter()

Alter a date field widget settings form.

Parameters

array $form: Nested array of form elements that comprise the form.

array $context: An associative array containing the following keys:

  • field: The $field array.
  • instance: The $instance array.

See also

hook_field_widget_settings_form()

1 function implements hook_date_field_widget_settings_form_alter()

Note: this list is generated by pattern matching, so it may include some functions that are not actually implementations of this hook.

date_all_day_date_field_widget_settings_form_alter in date_all_day/date_all_day.module
Implements hook_date_field_widget_settings_form_alter().
3 invocations of hook_date_field_widget_settings_form_alter()
DateFieldWidgetBase::settingsForm in date_field/lib/Drupal/date_field/Plugin/field/widget/DateFieldWidgetBase.php
Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
DateTextWidget::settingsForm in lib/Drupal/date/Plugin/field/widget/DateTextWidget.php
Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().
DateWidgetBase::settingsForm in lib/Drupal/date/Plugin/field/widget/DateWidgetBase.php
Implements Drupal\field\Plugin\Type\Widget\WidgetInterface::settingsForm().

File

./date.api.php, line 416
Hooks provided by the Date module.

Code

function hook_date_field_widget_settings_form_alter(&$form, $context) {
  $field = $context['field'];
  $instance = $context['instance'];
  $form['new_setting'] = array(
    '#type' => 'textfield',
    '#default_value' => '',
    '#title' => t('My new setting'),
  );
}