function ca_remove_condition in Ubercart 6.2
Remove a condition from a predicate.
Parameters
$pid: The ID of the predicate to remove the condition group from.
$group_key: The key of the condition group the condition is in.
$cond_key: The key of the condition to remove.
Return value
An array representing the full, updated predicate.
1 call to ca_remove_condition()
- ca_conditions_form_remove_condition_submit in ca/
ca.admin.inc - Submit handler for button to remove a condition from a condition group.
File
- ca/
ca.module, line 877 - This is a demonstration module for the new conditional actions API.
Code
function ca_remove_condition($pid, $group_key, $cond_key) {
// Load the predicate as it is now.
$predicate = ca_load_predicate($pid);
// Update, save, and return the predicate.
unset($predicate['#conditions']['#conditions'][$group_key]['#conditions'][$cond_key]);
ca_save_predicate($predicate);
return $predicate;
}