PluginProbe ʕ •ᴥ•ʔ
Search Regex / 2.4
Search Regex v2.4
trunk 1.4.12 1.4.13 1.4.14 1.4.15 1.4.16 2.0 2.0.1 2.1 2.2 2.2.1 2.3 2.3.1 2.3.2 2.3.3 2.4 2.4.1 3.0.0 3.0.1 3.0.2 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.1 3.1.1 3.1.2 3.2 3.3 3.3.0 3.3.1 3.4 3.4.1 3.4.2
search-regex / api / api-plugin.php
search-regex / api Last commit date
api-base.php 5 years ago api-plugin.php 6 years ago api-preset.php 5 years ago api-replace.php 5 years ago api-search.php 5 years ago api-settings.php 6 years ago api-source.php 5 years ago api.php 5 years ago
api-plugin.php
30 lines
1 <?php
2
3 /**
4 * 'Plugin' functions for Search Regex
5 */
6 class Search_Regex_Api_Plugin extends Search_Regex_Api_Route {
7 /**
8 * Plugin API endpoint constructor
9 *
10 * @param String $namespace Namespace.
11 */
12 public function __construct( $namespace ) {
13 register_rest_route( $namespace, '/plugin/test', array(
14 $this->get_route( WP_REST_Server::ALLMETHODS, 'route_test', [ $this, 'permission_callback' ] ),
15 ) );
16 }
17
18 /**
19 * Test the API
20 *
21 * @param WP_REST_Request $request Request.
22 * @return Array
23 */
24 public function route_test( WP_REST_Request $request ) {
25 return array(
26 'success' => true,
27 );
28 }
29 }
30