You are here

function workbench_moderation_transition_delete in Workbench Moderation 7.3

Same name and namespace in other branches
  1. 7 workbench_moderation.module \workbench_moderation_transition_delete()

Deletes a moderation state transition.

Invoke hook_workbenech_moderation_tranisiton_delete().

Parameters

$transition: An object with from_name and to_name properties that reference moderation states.

See also

hook_workbench_moderation_transition_delete().

2 calls to workbench_moderation_transition_delete()
workbench_moderation_admin_transitions_form_submit in ./workbench_moderation.admin.inc
Form submit handler for moderation transitions.
workbench_moderation_state_delete in ./workbench_moderation.module
Delete a moderation state.

File

./workbench_moderation.module, line 1627
Content moderation for Workbench.

Code

function workbench_moderation_transition_delete($transition) {
  foreach (module_implements('workbench_moderation_transition_delete') as $module) {

    // Don't call this function! That would lead to infinite recursion.
    if ($module !== 'workbench_moderation') {
      module_invoke($module, 'workbench_moderation_transition_delete', $transition);
    }
  }
  db_delete('workbench_moderation_transitions')
    ->condition('from_name', $transition->from_name)
    ->condition('to_name', $transition->to_name)
    ->execute();
}