hook_date_format_types_alter

  1. drupal
    1. 8
    2. 7
Versions
7 – 8 hook_date_format_types_alter(&$types)

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

Code

modules/system/system.api.php, line 3839

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