示例#1
0
/**
 * Handle AJAX email receipt purchase log action
 *
 * The _wpsc_ajax_purchase_log_action_link() function which triggers this function is nonce
 * and capability checked in _wpsc_ajax_handler().
 *
 * @since   3.9.0
 * @access  private
 *
 * @param  array  $response  AJAX response.
 * @param  int    $log_id    Purchase log ID.
 */
function wpsc_purchase_log_action_ajax_email_receipt($response, $log_id)
{
    $response['success'] = wpsc_purchlog_resend_email($log_id);
    return $response;
}
示例#2
0
/**
 * Handle email receipt purchase log action
 *
 * The 'wpsc_purchase_log_action-email_receipt' action hook which calls this function is nonce and capability checked
 * in wpsc_do_purchase_log_actions() before triggering do_action( 'wpsc_purchase_log_action-email_receipt' ).
 *
 * @since  3.9.0
 *
 * @param  int  $log_id  Purchase log ID.
 */
function wpsc_purchase_log_action_email_receipt($log_id)
{
    $sent = wpsc_purchlog_resend_email($log_id);
    // Redirect back to purchase logs list
    $sendback = wp_get_referer();
    $sendback = esc_url_raw(add_query_arg('sent', absint($sent), $sendback));
    wp_redirect($sendback);
    exit;
}