Give_Donate_Form::is_free PHP Method

is_free() public method

Determine if the donation is free or if the given price ID is free
Since: 1.0
public is_free ( integer $price_id = false ) : boolean
$price_id integer Price ID. Default is false.
return boolean
    public function is_free($price_id = false)
    {
        $is_free = false;
        $variable_pricing = give_has_variable_prices($this->ID);
        if ($variable_pricing && !is_null($price_id) && $price_id !== false) {
            $price = give_get_price_option_amount($this->ID, $price_id);
        } elseif (!$variable_pricing) {
            $price = get_post_meta($this->ID, '_give_set_price', true);
        }
        if (isset($price) && (double) $price == 0) {
            $is_free = true;
        }
        return (bool) apply_filters('give_is_free_donation', $is_free, $this->ID, $price_id);
    }