function hook_date_format_types_alter

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

File

modules/system/system.api.php, line 4151
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;
  }
}

© 2001–2016 by the original authors
Licensed under the GNU General Public License, version 2 and later.
Drupal is a registered trademark of Dries Buytaert.
https://api.drupal.org/api/drupal/modules!system!system.api.php/function/hook_date_format_types_alter/7.x