public function remove_donation($form_id, $args = array())
{
// Set some defaults
$defaults = array('quantity' => 1, 'price' => false, 'price_id' => false);
$args = wp_parse_args($args, $defaults);
$form = new Give_Donate_Form($form_id);
// Bail if this post isn't a valid give donation form
if (!$form || $form->post_type !== 'give_forms') {
return false;
}
$pending_args = $args;
$pending_args['id'] = $form_id;
$pending_args['amount'] = $this->total;
$pending_args['price_id'] = false !== $args['price_id'] ? (int) $args['price_id'] : false;
$pending_args['quantity'] = $args['quantity'];
$pending_args['action'] = 'remove';
$this->pending['donations'][] = $pending_args;
$this->decrease_subtotal($this->total);
return true;
}