Ejemplo n.º 1
0
/**
 * Handle AJAX clear downloads lock 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_downloads_lock($response, $log_id)
{
    $response['success'] = wpsc_purchlog_clear_download_items($log_id);
    return $response;
}
Ejemplo n.º 2
0
/**
 * Handle clear downloads lock purchase log action
 *
 * The 'wpsc_purchase_log_action-downloads_lock' 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-downloads_lock' ).
 *
 * @since  3.9.0
 *
 * @param  int  $log_id  Purchase log ID.
 */
function wpsc_purchase_log_action_downloads_lock($log_id)
{
    wpsc_purchlog_clear_download_items($log_id);
    // Redirect back to purchase logs list
    $sendback = wp_get_referer();
    $sendback = esc_url_raw(add_query_arg('cleared', 1, $sendback));
    wp_redirect($sendback);
    exit;
}