PluginProbe
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution / 2.0.0
Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution v2.0.0
2.0.1 trunk 1.0.0 1.1.0 1.2.0 1.3.0 1.3.1 1.3.2 1.3.3 1.4.0 1.4.1 1.4.2 1.5.0 1.6.0 1.6.1 1.7.0 1.7.1 1.8.0 1.9.0 2.0.0
solid-performance / src / Performance / API / Base_Route.php

Base_Route.php in Solid Performance – Your No-Code Caching, Performance, & Page Speed Solution 2.0.0, at src/Performance/API/Base_Route.php

61 lines 912 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * An abstract route for all other routes to extend.
4 *
5 * @since 0.1.0
6 *
7 * @package SolidWP\Performance
8 */
9
10 namespace SolidWP\Performance\API;
11
12 use WP_REST_Request;
13
14 if ( ! defined( 'ABSPATH' ) ) {
15 exit;
16 }
17
18 /**
19 * The class that handles the clear cache route.
20 *
21 * @since 0.1.0
22 *
23 * @package SolidWP|Performance
24 */
25 abstract class Base_Route implements Route {
26
27 /**
28 * {@inheritdoc}
29 */
30 abstract public function get_path(): string;
31
32 /**
33 * {@inheritdoc}
34 */
35 abstract public function get_methods();
36
37 /**
38 * {@inheritdoc}
39 */
40 abstract public function callback( WP_REST_Request $request );
41
42 /**
43 * [@inheritdoc]
44 */
45 abstract public function schema_callback(): array;
46
47 /**
48 * {@inheritdoc}
49 */
50 public function get_arguments(): array {
51 return [];
52 }
53
54 /**
55 * {@inheritdoc}
56 */
57 public function permission_callback(): bool {
58 return current_user_can( 'manage_options' );
59 }
60 }
61