| @@ -1,13 +1,9 @@ | ||
| 1 | 1 | <?php |
| 2 | 2 | |
| 3 | 3 | namespace Elementor\Modules\SiteNavigation\Data; |
| 4 | 4 | |
| 5 | -use Elementor\Plugin; | |
| 6 | 5 | 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\Homepage; | |
| 10 | 6 | use Elementor\Modules\SiteNavigation\Data\Endpoints\Recent_Posts; |
| 11 | 7 | |
| 12 | 8 | if ( ! defined( 'ABSPATH' ) ) { |
| 13 | 9 | exit; // Exit if accessed directly. |
| @@ -22,29 +18,14 @@ | ||
| 22 | 18 | public function get_items_permissions_check( $request ) { |
| 23 | 19 | return current_user_can( 'edit_posts' ); |
| 24 | 20 | } |
| 25 | 21 | |
| 26 | - public function create_items_permissions_check( $request ): bool { | |
| 27 | - // Permissions check is located in the endpoint | |
| 28 | - return true; | |
| 29 | - } | |
| 30 | - | |
| 31 | 22 | public function get_item_permissions_check( $request ) { |
| 32 | 23 | return $this->get_items_permissions_check( $request ); |
| 33 | 24 | } |
| 34 | 25 | |
| 35 | - public function create_item_permissions_check( $request ): bool { | |
| 36 | - return $this->create_items_permissions_check( $request ); | |
| 37 | - } | |
| 38 | - | |
| 39 | 26 | public function register_endpoints() { |
| 40 | 27 | $this->register_endpoint( new Recent_Posts( $this ) ); |
| 41 | - $this->register_endpoint( new Add_New_Post( $this ) ); | |
| 42 | - | |
| 43 | - if ( Plugin::$instance->experiments->is_feature_active( 'pages_panel' ) ) { | |
| 44 | - $this->register_endpoint( new Duplicate_Post( $this ) ); | |
| 45 | - $this->register_endpoint( new Homepage( $this ) ); | |
| 46 | - } | |
| 47 | 28 | } |
| 48 | 29 | |
| 49 | 30 | protected function register_index_endpoint() { |
| 50 | 31 | // Bypass, currently does not required. |