Give_Donate_Form::has_variable_prices PHP Method

has_variable_prices() public method

Determine if the donation form has variable prices enabled
Since: 1.0
public has_variable_prices ( ) : boolean
return boolean
    public function has_variable_prices()
    {
        $option = get_post_meta($this->ID, '_give_price_option', true);
        $ret = 0;
        if ($option === 'multi') {
            $ret = 1;
        }
        /**
         * Filter: Override whether the donation form has variables prices.
         *
         * @param bool $ret Does donation form have variable prices?
         * @param int|string The ID of the donation form.
         */
        return (bool) apply_filters('give_has_variable_prices', $ret, $this->ID);
    }

Usage Example

Ejemplo n.º 1
0
/**
 * Checks to see if a Give form has variable prices enabled.
 *
 * @since 1.0
 *
 * @param int $form_id ID number of the form to check
 *
 * @return bool true if has variable prices, false otherwise
 */
function give_has_variable_prices($form_id = 0)
{
    if (empty($form_id)) {
        return false;
    }
    $form = new Give_Donate_Form($form_id);
    return $form->has_variable_prices();
}
All Usage Examples Of Give_Donate_Form::has_variable_prices