insterface-rest-api.php
1013 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
<?php
/**
* Interface for rest api requests.
*
* @link https://wordpress.org/plugins/broken-link-checker/
* @since 2.0.0
*
* @author WPMUDEV (https://wpmudev.com)
* @package WPMUDEV_BLC\Core\Interfaces
*
* @copyright (c) 2022, Incsub (http://incsub.com)
*/
namespace WPMUDEV_BLC\Core\Interfaces;
// Abort if called directly.
defined( 'WPINC' ) || die;
interface Rest_Api {
/**
* Init function.
*
* @since 2.0.0
*
*/
public function init();
/**
* Registers rest api routes.
*
* @since 2.0.0
*
* @return void
*/
public function register_routes();
/**
* Formats the response.
*
* @since 2.0.0
*
* @param array $item.
* @param WP_REST_Request $request request object.
*
* @return WP_Error|WP_REST_Response
*/
public function prepare_item_for_response( $item, $request );
/**
* Retrieves the item's schema, conforming to JSON Schema.
*
* @since 2.0.0
*
* @return array Item schema data.
*/
public function get_item_schema();
}