PluginProbe
Extendify / 0.9.3
Extendify v0.9.3
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 0.7.0 All 126 releases
extendify / app / Library / Controllers / TemplateController.php

TemplateController.php in Extendify 0.9.3, at app/Library/Controllers/TemplateController.php

44 lines 912 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Controls Http requests
4 */
5
6 namespace Extendify\Library\Controllers;
7
8 use Extendify\Http;
9
10 if (!defined('ABSPATH')) {
11 die('No direct access.');
12 }
13
14 /**
15 * The controller for dealing with templates
16 */
17 class TemplateController
18 {
19
20 /**
21 * Return info about a template
22 *
23 * @param \WP_REST_Request $request - The request.
24 * @return WP_REST_Response|WP_Error
25 */
26 public static function index($request)
27 {
28 $response = Http::post('/templates', $request->get_params());
29 return new \WP_REST_Response($response);
30 }
31
32 /**
33 * Send data about a specific template
34 *
35 * @param \WP_REST_Request $request - The request.
36 * @return WP_REST_Response|WP_Error
37 */
38 public static function ping($request)
39 {
40 $response = Http::post('/templates', $request->get_params());
41 return new \WP_REST_Response($response);
42 }
43 }
44