function hook_date_format_types_alter

Modify existing date types.

Allows other modules to modify existing date types like 'long'. Called by _system_date_format_types_build(). For instance, A module may use this hook to apply settings across all date types, such as locking all date types so they appear to be provided by the system.

Parameters

$types: A list of date types. Each date type is keyed by the machine-readable name and the values are associative arrays containing:

  • is_new: Set to FALSE to override previous settings.
  • module: The name of the module that created the date type.
  • type: The machine-readable date type name.
  • title: The human-readable date type name.
  • locked: Specifies that the date type is system-provided.

Related topics

1 invocation of hook_date_format_types_alter()
_system_date_format_types_build in drupal/modules/system/system.module
Builds and returns information about available date types.

File

drupal/modules/system/system.api.php, line 4167
Hooks provided by Drupal core and the System module.

Code

function hook_date_format_types_alter(&$types) {
  foreach ($types as $name => $type) {
    $types[$name]['locked'] = 1;
  }
}