PluginProbe
Polylang / 3.8.7
Polylang v3.8.7
3.8.9 3.8.8 3.8.7 3.8.6 3.8.5 3.8.4 3.8.3 2.7 2.7.0.1 2.7.1 2.7.2 2.7.3 2.7.4 2.8 2.8.1 2.8.2 2.8.3 2.8.4 2.9 2.9.1 2.9.2 3.0 3.0.1 3.0.2 3.0.3 All 233 releases
polylang / src / modules / REST / API.php

API.php in Polylang 3.8.7, at src/modules/REST/API.php

63 lines 895 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * @package Polylang
4 */
5
6 namespace WP_Syntex\Polylang\REST;
7
8 use PLL_Model;
9
10 defined( 'ABSPATH' ) || exit;
11
12 /**
13 * Sets all Polylang REST controllers up.
14 *
15 * @since 3.7
16 */
17 class API {
18 /**
19 * REST languages.
20 *
21 * @var V1\Languages|null
22 */
23 public $languages;
24
25 /**
26 * REST settings.
27 *
28 * @var V1\Settings|null
29 */
30 public $settings;
31
32 /**
33 * @var PLL_Model
34 */
35 private $model;
36
37 /**
38 * Constructor.
39 *
40 * @since 3.7
41 *
42 * @param PLL_Model $model Polylang's model.
43 */
44 public function __construct( PLL_Model $model ) {
45 $this->model = $model;
46 }
47
48 /**
49 * Adds hooks and registers endpoints.
50 *
51 * @since 3.7
52 *
53 * @return void
54 */
55 public function init(): void {
56 $this->languages = new V1\Languages( $this->model );
57 $this->languages->register_routes();
58
59 $this->settings = new V1\Settings( $this->model );
60 $this->settings->register_routes();
61 }
62 }
63