PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.2.0
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.2.0
trunk 0.9.0 0.9.1 1.0.0 1.0.1 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.0.7 1.0.8 1.0.9 1.1.0 1.1.1 1.1.2 1.1.3 1.1.4 1.1.5 1.2.0 1.2.1 1.2.10 1.2.2 1.2.3 1.2.4 1.2.5 1.2.6 1.2.7 1.2.8 1.2.9 1.3.0 1.3.1 1.3.2 1.3.3 1.3.4 1.3.5 1.3.6 1.3.7 1.3.8 1.3.9 1.4.0 1.4.1 1.4.10 1.4.11 1.4.12 1.4.13 1.4.14 1.4.15 1.4.2 1.4.3 1.4.4 1.4.5 1.4.6 1.4.7 1.4.8 1.4.9 1.5.0
wp-all-export / wpae_api.php
wp-all-export Last commit date
actions 8 years ago classes 8 years ago config 8 years ago controllers 8 years ago dist 8 years ago filters 8 years ago frontend 8 years ago helpers 8 years ago history 8 years ago i18n 8 years ago libraries 8 years ago models 8 years ago sessions 8 years ago shortcodes 8 years ago src 8 years ago static 8 years ago views 8 years ago banner-772x250.png 8 years ago readme.txt 8 years ago schema.php 8 years ago screenshot-1.png 8 years ago screenshot-2.png 8 years ago wp-all-export.php 8 years ago wpae_api.php 8 years ago
wpae_api.php
33 lines
1 <?php
2
3 // Let's bootstrap
4 function wpae_api() {
5
6 if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
7 exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
8 }
9
10 if ( ! current_user_can( \PMXE_Plugin::$capabilities ) ){
11 exit( json_encode(array('html' => __('Security check', 'wp_all_export_plugin'))) );
12 }
13
14 $container = new \Wpae\Di\WpaeDi(array());
15
16 $request = new \Wpae\Http\Request(file_get_contents('php://input'));
17
18 $q = $_GET['q'];
19 $routeParts = explode('/', $q);
20 $controller = 'Wpae\\App\\Controller\\'.ucwords($routeParts[0]).'Controller';
21 $action = ucwords($routeParts[1]).'Action';
22
23 $controller = new $controller($container);
24 $response = $controller->$action($request);
25
26 if(!$response instanceof \Wpae\Http\Response) {
27 throw new Exception('The controller must return an HttpResponse instance.');
28 }
29
30 $response->render();
31 }
32
33 add_action( 'wp_ajax_wpae_api', 'wpae_api' );