PluginProbe
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards / 5.5.82
WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards v5.5.82
5.5.84 5.5.83 5.5.82 5.5.81 5.5.80 5.5.79 5.5.77 5.5.76 5.5.75 5.5.73 5.5.72 5.5.22 5.5.23 5.5.29 5.5.3 5.5.31 5.5.32 5.5.34 5.5.35 5.5.36 5.5.37 5.5.4 5.5.40 5.5.41 5.5.42 All 160 releases
wp-data-access / WPDataAccess / Utilities / WPDA_Export.php

WPDA_Export.php in WP Data Access – App Builder for Tables, Forms, Charts, Maps & Dashboards 5.5.82, at WPDataAccess/Utilities/WPDA_Export.php

58 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * Suppress "error - 0 - No summary was found for this file" on phpdoc generation
5 *
6 * @package WPDataAccess\Utilities
7 */
8
9 namespace WPDataAccess\Utilities {
10
11 use WPDataAccess\WPDA;
12
13 /**
14 * Class WPDA_Export
15 *
16 * @author Peter Schulz
17 * @since 2.0.13
18 */
19 class WPDA_Export {
20
21 /**
22 * Main method to start specific export type
23 *
24 * @since 2.0.13
25 */
26 public static function export() {
27 $export_class = 'WPDataAccess\\Utilities\\WPDA_Export_Sql'; // Default export class exports to SQL.
28 if ( isset( $_REQUEST['format_type'] ) ) { // phpcs:ignore
29 $format_type = sanitize_text_field( wp_unslash( $_REQUEST['format_type'] ) ); // phpcs:ignore
30 switch ( $format_type ) {
31 case 'excel':
32 $export_class = 'WPDataAccess\\Utilities\\WPDA_Export_Excel';
33 break;
34 case 'json':
35 $export_class = 'WPDataAccess\\Utilities\\WPDA_Export_Json';
36 break;
37 case 'xml':
38 $export_class = 'WPDataAccess\\Utilities\\WPDA_Export_Xml';
39 break;
40 case 'csv':
41 $export_class = 'WPDataAccess\\Utilities\\WPDA_Export_Csv';
42 break;
43 }
44 }
45
46 $export = new $export_class();
47 $export->export();
48 }
49
50 public static function export_ajax() {
51 static::export();
52 die();
53 }
54
55 }
56
57 }
58