1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
|
<?php require_once __DIR__ . "/../../../../../../wp-config.php"; include __DIR__ . "/../../base_request.php";
class clear_lite_speed_cache extends base_request { function clear_cache_post($post_ids){ foreach ($post_ids as $post_id){ do_action( 'litespeed_purge_post', $post_id ); } $this->success(array('post_ids' => $post_ids)); } function clear_all(){ do_action( 'litespeed_purge_all' ); $this->success('clear_all'); } }
$request = new clear_lite_speed_cache(); $method = $_SERVER['REQUEST_METHOD']; $setting_key = ''; if(isset($_GET['action'])) $action = $_GET['action'];
if ($method == 'POST' || $method == 'post') { $json = file_get_contents('php://input'); $item = json_decode($json, true); switch ($action) { case 'clear_all': $request->clear_all(); break; case 'clear_cache_post': default: $request->clear_cache_post($item['ids']); break; } }
|