PluginProbe
Polylang / 2.6.2
Polylang v2.6.2
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
← All changes | include/rest-request.php +31 -10 2.8.32.6.2 View file →
@@ -1,8 +1,5 @@
1 1 <?php
2 -/**
3 - * @package Polylang
4 - */
5 2
6 3 /**
7 4 * REST API controller
8 5 * accessible as $polylang global object
@@ -12,17 +9,17 @@
12 9 * model => inherited, reference to PLL_Model object
13 10 * links_model => inherited, reference to PLL_Links_Model object
14 11 * links => reference to PLL_Admin_Links object
15 12 * static_pages => reference to PLL_Static_Pages object
16 - * filters => reference to PLL_Frontend_Filters object
17 13 * filters_links => reference to PLL_Filters_Links object
18 14 * posts => reference to PLL_CRUD_Posts object
19 15 * terms => reference to PLL_CRUD_Terms object
16 + * sync => reference to PLL_Sync object
20 17 *
21 18 * @since 2.6
22 19 */
23 20 class PLL_REST_Request extends PLL_Base {
24 - public $links, $static_pages, $posts, $terms, $filters, $filters_links;
21 + public $links, $posts, $terms, $filters_links, $sync;
25 22
26 23 /**
27 24 * Setup filters
28 25 *
@@ -31,14 +28,9 @@
31 28 public function init() {
32 29 parent::init();
33 30
34 31 if ( $this->model->get_languages_list() ) {
35 -
36 - /** This action is documented in include/class-polylang.php */
37 - do_action( 'pll_no_language_defined' ); // To load overridden textdomains.
38 -
39 32 $this->filters_links = new PLL_Filters_Links( $this );
40 - $this->filters = new PLL_Filters( $this );
41 33
42 34 // Static front page and page for posts
43 35 if ( 'page' === get_option( 'show_on_front' ) ) {
44 36 $this->static_pages = new PLL_Static_Pages( $this );
@@ -44,9 +36,38 @@
44 36 $this->static_pages = new PLL_Static_Pages( $this );
45 37 }
46 38
47 39 $this->links = new PLL_Admin_Links( $this );
40 + $this->posts = new PLL_CRUD_Posts( $this );
41 + $this->terms = new PLL_CRUD_Terms( $this );
42 + $this->sync = new PLL_Sync( $this );
48 43
49 44 $this->nav_menu = new PLL_Nav_Menu( $this ); // For auto added pages to menu
45 +
46 + // Share term slugs
47 + if ( get_option( 'permalink_structure' ) && $this->options['force_lang'] && class_exists( 'PLL_Share_Term_Slug' ) ) {
48 + $this->share_term_slug = version_compare( $GLOBALS['wp_version'], '4.8', '<' ) ?
49 + new PLL_Frontend_Share_Term_Slug( $this ) :
50 + new PLL_Share_Term_Slug( $this );
51 + }
52 +
53 + // Translate slugs, only for pretty permalinks
54 + if ( get_option( 'permalink_structure' ) && class_exists( 'PLL_Translate_Slugs' ) ) {
55 + $curlang = null;
56 + $slugs_model = new PLL_Translate_Slugs_Model( $this );
57 + $this->translate_slugs = new PLL_Translate_Slugs( $slugs_model, $curlang );
58 + }
59 +
60 + if ( class_exists( 'PLL_Sync_Content' ) ) {
61 + $this->sync_content = new PLL_Sync_Content( $this );
62 + }
63 +
64 + if ( class_exists( 'PLL_Sync_Post_REST' ) ) {
65 + $this->sync_post = new PLL_Sync_Post_REST( $this );
66 + }
67 +
68 + if ( class_exists( 'PLL_Duplicate_REST' ) ) {
69 + $this->duplicate_rest = new PLL_Duplicate_REST();
70 + }
50 71 }
51 72 }
52 73 }