PluginProbe ʕ •ᴥ•ʔ
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel / 1.5.0
WP All Export – Drag & Drop Export to Any Custom CSV, XML & Excel v1.5.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 3 weeks ago addon-api 3 weeks ago classes 3 weeks ago config 3 weeks ago controllers 3 weeks ago dist 4 years ago filters 3 weeks ago helpers 3 weeks ago i18n 3 weeks ago libraries 3 weeks ago models 3 weeks ago sessions 10 years ago shortcodes 10 years ago src 3 weeks ago static 3 weeks ago views 3 weeks ago banner-772x250.png 12 years ago readme.txt 3 weeks ago schema.php 3 weeks ago screenshot-1.png 10 years ago screenshot-2.png 10 years ago wp-all-export.php 3 weeks ago wpae_api.php 3 weeks ago
wpae_api.php
36 lines
1 <?php
2
3 defined( 'ABSPATH' ) || exit;
4
5
6 // Let's bootstrap
7 function wpae_api() {
8
9 if ( ! check_ajax_referer( 'wp_all_export_secure', 'security', false )){
10 exit( json_encode(array('html' => __('Security check', 'wp-all-export'))) );
11 }
12
13 if ( ! current_user_can( \PMXE_Plugin::$capabilities ) ){
14 exit( json_encode(array('html' => __('Security check', 'wp-all-export'))) );
15 }
16
17 $container = new \Wpae\Di\WpaeDi(array());
18
19 $request = new \Wpae\Http\Request(file_get_contents('php://input'));
20
21 $q = isset( $_GET['q'] ) ? sanitize_text_field( wp_unslash( $_GET['q'] ) ) : '';
22 $routeParts = explode('/', $q);
23 $controller = 'Wpae\\App\\Controller\\'.ucwords($routeParts[0]).'Controller';
24 $action = ucwords($routeParts[1]).'Action';
25
26 $controller = new $controller($container);
27 $response = $controller->$action($request);
28
29 if(!$response instanceof \Wpae\Http\Response) {
30 throw new Exception('The controller must return an HttpResponse instance.');
31 }
32
33 $response->render();
34 }
35
36 add_action( 'wp_ajax_wpae_api', 'wpae_api' );