You are here

function _soft_length_widget_settings in Soft Length Limit 8

Returns the widget settings that can be used for a soft_length widget.

Return value

array An array of settings and default values for each textfield type.

2 calls to _soft_length_widget_settings()
soft_length_limit_field_widget_settings_summary_alter in ./soft_length_limit.module
Implements hook_field_widget_settings_summary_alter().
soft_length_limit_field_widget_third_party_settings_form in ./soft_length_limit.module
Implements hook_field_widget_third_party_settings_form().

File

./soft_length_limit.module, line 23

Code

function _soft_length_widget_settings(string $plugin_id) : array {
  $settings = [
    'string_textfield' => [
      'max_limit' => TRUE,
      'minimum_limit' => TRUE,
      'style_select' => TRUE,
    ],
    'string_textarea' => [
      'max_limit' => TRUE,
      'minimum_limit' => TRUE,
      'style_select' => TRUE,
    ],
    'text_textfield' => [
      'max_limit' => TRUE,
      'minimum_limit' => TRUE,
      'style_select' => TRUE,
    ],
    'text_textarea' => [
      'max_limit' => TRUE,
      'minimum_limit' => TRUE,
      'style_select' => TRUE,
    ],
    'text_textarea_with_summary' => [
      'max_limit' => TRUE,
      'minimum_limit' => TRUE,
      'style_select' => TRUE,
    ],
  ];
  return $settings[$plugin_id] ?? [];
}