PluginProbe
Extendify / 0.11.1
Extendify v0.11.1
3.2.1 3.2.0 3.1.6 3.1.5 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.6 3.0.5 3.0.4 trunk 0.1.0 0.10.0 0.10.1 0.10.2 0.11.0 0.11.1 0.2.0 0.3.0 0.3.1 0.4.0 0.5.0 0.6.0 All 127 releases
extendify / app / Assist / Controllers / GlobalsController.php

GlobalsController.php in Extendify 0.11.1, at app/Assist/Controllers/GlobalsController.php

42 lines 822 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Controls Global Settings
4 */
5
6 namespace Extendify\Assist\Controllers;
7
8 if (!defined('ABSPATH')) {
9 die('No direct access.');
10 }
11
12 /**
13 * The controller for plugin dependency checking, etc
14 */
15 class GlobalsController
16 {
17
18 /**
19 * Return the data
20 *
21 * @return \WP_REST_Response
22 */
23 public static function get()
24 {
25 $data = get_option('extendify_assist_globals', []);
26 return new \WP_REST_Response($data);
27 }
28
29 /**
30 * Persist the data
31 *
32 * @param \WP_REST_Request $request - The request.
33 * @return \WP_REST_Response
34 */
35 public static function store($request)
36 {
37 $data = json_decode($request->get_param('data'), true);
38 update_option('extendify_assist_globals', $data);
39 return new \WP_REST_Response($data);
40 }
41 }
42