function system_date_format_delete

Deletes a date format from the database.

Parameters

$date_format_id: The date format ID.

1 call to system_date_format_delete()
system_date_delete_format_form_submit in drupal/core/modules/system/system.admin.inc
Delete a configured date format.

File

drupal/core/modules/system/system.module, line 3780
Configuration system that lets administrators modify the workings of the site.

Code

function system_date_format_delete($date_format_id) {
  $format_id = 'formats.' . $date_format_id;
  config('system.date')
    ->clear($format_id)
    ->save();

  // Clean up the localized entry if required.
  foreach (language_list() as $langcode => $data) {
    $config = config('locale.config.' . $langcode . '.system.date');
    if ($config
      ->get($format_id)) {
      $config
        ->clear($format_id)
        ->save();
    }
  }
}