/** * The payment link for invoices * @param integer $id * @param string $type * @return string */ function si_get_payment_link($id = 0, $type = '') { if (!$id) { $id = get_the_ID(); } if ($type == '') { $processor = SI_Payment_Processors::get_payment_processor(); $type = $processor->get_slug(); } $url = add_query_arg(array(SI_Checkouts::CHECKOUT_QUERY_VAR => $type, 'nonce' => wp_create_nonce(SI_Controller::NONCE)), si_get_payment_url($id)); return apply_filters('si_get_payment_link', esc_url_raw($url), $id, $type); }
/** * The payment link for invoices * @param integer $id * @param string $type * @return string */ function si_get_payment_link($id = 0, $type = '') { if (!$id) { global $post; $id = $post->ID; } if ($type == '') { $processor = SI_Payment_Processors::get_payment_processor(); $type = $processor->get_slug(); } $url = add_query_arg(array(SI_Checkouts::CHECKOUT_QUERY_VAR => $type, 'nonce' => wp_create_nonce(SI_Controller::NONCE)), si_get_payment_url($id)); return esc_url_raw($url); }