You are here

function taxonomy_display_delete_taxonomy_display in Taxonomy display 7

Helper function; delete taxonomy display data.

Parameters

string $machine_name: The machine name of the vocabulary's taxonomy display data to remove.

string|NULL|FALSE $watchdog_message: Provide a watchdog message as a string. If null then a generic default message will be used. If false then no watchdog message will be recorded.

array $watchdog_variables: Variables for substitution in the watchdog message.

int $watchdog_severity: One of the defined watchdog constant severities: WATCHDOG_EMERGENCY, WATCHDOG_ALERT, WATCHDOG_CRITICAL, WATCHDOG_ERROR, WATCHDOG_WARNING, WATCHDOG_NOTICE, WATCHDOG_INFO, WATCHDOG_DEBUG. Defaults to WATCHDOG_NOTICE.

Return value

void

2 calls to taxonomy_display_delete_taxonomy_display()
taxonomy_display_enable in ./taxonomy_display.install
Implements hook_enable().
taxonomy_display_taxonomy_vocabulary_delete in ./taxonomy_display.module
Implements hook_taxonomy_vocabulary_delete().

File

./taxonomy_display.module, line 35
Hooks for the taxonomy display module.

Code

function taxonomy_display_delete_taxonomy_display($machine_name, $watchdog_message = NULL, $watchdog_variables = array(), $watchdog_severity = WATCHDOG_NOTICE) {

  // Delete our display record for the term being removed.
  $count = (bool) db_delete('taxonomy_display')
    ->condition('machine_name', $machine_name)
    ->execute();

  // If a record was deleted then log it in watchdog.
  if ($count && $watchdog_message !== FALSE) {
    if (empty($watchdog_message)) {
      $watchdog_message = 'Taxonomy display settings deleted for %name.';
      $watchdog_variables = array(
        '%name' => $machine_name,
      );
    }
    watchdog('taxonomy_display', $watchdog_message, $watchdog_variables, $watchdog_severity);
  }
}