PluginProbe
Elementor Website Builder – more than just a page builder / 3.17.3
Elementor Website Builder – more than just a page builder v3.17.3
4.3.0-beta2 4.3.0-beta1 4.2.4 4.2.3 4.2.2 4.2.1 4.2.0 4.1.5 4.2.0-beta2 4.2.0-dev2 4.2.0-beta1 4.1.4 4.1.3 4.1.2 4.1.1 4.1.0 4.1.0-beta3 4.1.0-dev3 4.0.9 4.1.0-beta2 4.1.0-dev2 4.0.8 4.1.0-beta1 4.1.0-dev1 4.0.7 All 451 releases
elementor / modules / site-navigation / data / controller.php

controller.php in Elementor Website Builder – more than just a page builder 3.17.3, at modules/site-navigation/data/controller.php

51 lines 1.4 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Elementor\Modules\SiteNavigation\Data;
4
5 use Elementor\Plugin;
6 use Elementor\Data\V2\Base\Controller as Base_Controller;
7 use Elementor\Modules\SiteNavigation\Data\Endpoints\Add_New_Post;
8 use Elementor\Modules\SiteNavigation\Data\Endpoints\Duplicate_Post;
9 use Elementor\Modules\SiteNavigation\Data\Endpoints\Recent_Posts;
10
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit; // Exit if accessed directly.
13 }
14
15 class Controller extends Base_Controller {
16
17 public function get_name() {
18 return 'site-navigation';
19 }
20
21 public function get_items_permissions_check( $request ) {
22 return current_user_can( 'edit_posts' );
23 }
24
25 public function create_items_permissions_check( $request ): bool {
26 // Permissions check is located in the endpoint
27 return true;
28 }
29
30 public function get_item_permissions_check( $request ) {
31 return $this->get_items_permissions_check( $request );
32 }
33
34 public function create_item_permissions_check( $request ): bool {
35 return $this->create_items_permissions_check( $request );
36 }
37
38 public function register_endpoints() {
39 $this->register_endpoint( new Recent_Posts( $this ) );
40 $this->register_endpoint( new Add_New_Post( $this ) );
41
42 if ( Plugin::$instance->experiments->is_feature_active( 'pages_panel' ) ) {
43 $this->register_endpoint( new Duplicate_Post( $this ) );
44 }
45 }
46
47 protected function register_index_endpoint() {
48 // Bypass, currently does not required.
49 }
50 }
51