/** * Set the export headers * * @access public * @since 1.0 * @return void */ public function headers() { ignore_user_abort(true); if (!give_is_func_disabled('set_time_limit') && !ini_get('safe_mode')) { set_time_limit(0); } nocache_headers(); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=give-export-' . $this->export_type . '-' . date('m-d-Y') . '.csv'); header("Expires: 0"); }
/** * Set the export headers * * @access public * @since 1.0 * @return void */ public function headers() { ignore_user_abort(true); if (!give_is_func_disabled('set_time_limit') && !ini_get('safe_mode')) { set_time_limit(0); } $month = isset($_POST['month']) ? absint($_POST['month']) : date('n'); $year = isset($_POST['year']) ? absint($_POST['year']) : date('Y'); nocache_headers(); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=' . apply_filters('give_payments_export_filename', 'give-export-' . $this->export_type . '-' . $month . '-' . $year) . '.csv'); header("Expires: 0"); }
/** * Set the export headers * * @access public * @since 1.0 * @return void */ public function headers() { ignore_user_abort(true); if (!give_is_func_disabled('set_time_limit') && !ini_get('safe_mode')) { set_time_limit(0); } $extra = ''; if (!empty($_POST['give_export_download'])) { $extra = sanitize_title(get_the_title(absint($_POST['give_export_download']))) . '-'; } nocache_headers(); header('Content-Type: text/csv; charset=utf-8'); header('Content-Disposition: attachment; filename=' . apply_filters('give_donors_export_filename', 'give-export-' . $extra . $this->export_type . '-' . date('m-d-Y')) . '.csv'); header("Expires: 0"); }
public function headers() { ignore_user_abort(true); if (!give_is_func_disabled('set_time_limit') && !ini_get('safe_mode')) { set_time_limit(0); } }
/** * Upgrades the Offline Status * * @description: Reverses the issue where offline donation transactions in "pending" status where inappropriately marked as abandoned * * @since 1.3.4 * */ function give_v134_upgrade_give_offline_status() { global $wpdb; if (!current_user_can('manage_give_settings')) { wp_die(__('You do not have permission to do Give upgrades', 'give'), __('Error', 'give'), array('response' => 403)); } ignore_user_abort(true); if (!give_is_func_disabled('set_time_limit') && !ini_get('safe_mode')) { @set_time_limit(0); } // Get abandoned offline payments $select = "SELECT ID FROM {$wpdb->posts} p "; $join = "LEFT JOIN {$wpdb->postmeta} m ON p.ID = m.post_id "; $where = "WHERE p.post_type = 'give_payment' "; $where .= "AND ( p.post_status = 'abandoned' )"; $where .= "AND ( m.meta_key = '_give_payment_gateway' AND m.meta_value = 'offline' )"; $sql = $select . $join . $where; $found_payments = $wpdb->get_col($sql); foreach ($found_payments as $payment) { //Only change ones marked abandoned since our release last week //because the admin may have marked some abandoned themselves $modified_time = get_post_modified_time('U', false, $payment); //1450124863 = 12/10/2015 20:42:25 if ($modified_time >= 1450124863) { give_update_payment_status($payment, 'pending'); } } update_option('give_version', preg_replace('/[^0-9.].*/', '', GIVE_VERSION)); give_set_upgrade_complete('upgrade_give_offline_status'); delete_option('give_doing_upgrade'); wp_redirect(admin_url()); exit; }