Give_Payments_Query::give_forms PHP Méthode

give_forms() public méthode

Specific Give Form
Since: 1.0
public give_forms ( ) : void
Résultat void
    public function give_forms()
    {
        if (empty($this->args['give_forms'])) {
            return;
        }
        global $give_logs;
        $args = array('post_parent' => $this->args['give_forms'], 'log_type' => 'sale', 'post_status' => array('publish'), 'nopaging' => true, 'no_found_rows' => true, 'update_post_term_cache' => false, 'update_post_meta_cache' => false, 'cache_results' => false, 'fields' => 'ids');
        if (is_array($this->args['give_forms'])) {
            unset($args['post_parent']);
            $args['post_parent__in'] = $this->args['give_forms'];
        }
        $sales = $give_logs->get_connected_logs($args);
        if (!empty($sales)) {
            $payments = array();
            foreach ($sales as $sale) {
                $payments[] = get_post_meta($sale, '_give_log_payment_id', true);
            }
            $this->__set('post__in', $payments);
        } else {
            // Set post_parent to something crazy so it doesn't find anything
            $this->__set('post_parent', 999999999999999);
        }
        $this->__unset('give_forms');
    }