PluginProbe
Extendify / 0.4.0
Extendify v0.4.0
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 / Controllers / SiteSettingsController.php

SiteSettingsController.php in Extendify 0.4.0, at app/Controllers/SiteSettingsController.php

43 lines 845 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Controls User info
4 */
5
6 namespace Extendify\Library\Controllers;
7
8 use Extendify\Library\SiteSettings;
9
10 if (!defined('ABSPATH')) {
11 die('No direct access.');
12 }
13
14 /**
15 * The controller for managing Extendify SiteSettings.
16 */
17 class SiteSettingsController
18 {
19
20 /**
21 * Return Current SiteSettings meta data
22 *
23 * @return array
24 */
25 public static function show()
26 {
27 return new \WP_REST_Response(SiteSettings::data());
28 }
29
30 /**
31 * Persist the data
32 *
33 * @param \WP_REST_Request $request - The request.
34 * @return array
35 */
36 public static function store($request)
37 {
38 $settingsData = json_decode($request->get_param('data'), true);
39 \update_option(SiteSettings::key(), $settingsData, true);
40 return new \WP_REST_Response(SiteSettings::data());
41 }
42 }
43