/** * Template tag for indirect filtering * * should be probably marked as deprecated * use leyka_get_payment_form instead **/ function leyka_get_donation_form($echo = true) { if (!is_singular(Leyka_Campaign_Management::$post_type)) { return ''; } if ($echo) { echo get_leyka_payment_form_template_html(); } else { return get_leyka_payment_form_template_html(); } }
function leyka_get_payment_form($campaign = null, $args = array()) { global $post; $defaults = array('template' => null); $args = wp_parse_args($args, $defaults); if (!$campaign) { $campaign = $post; } elseif (is_int($campaign)) { $campaign = get_post($campaign); } if ($campaign->post_type != Leyka_Campaign_Management::$post_type) { return ''; } $campaign = new Leyka_Campaign($campaign); $campaign->increase_views_counter(); // Increase campaign views counter return get_leyka_payment_form_template_html($campaign, $args['template']); }