| 1 |
<?php |
| 2 |
namespace Elementor\Modules\Checklist\Data; |
| 3 |
|
| 4 |
use Elementor\Data\V2\Base\Controller as Controller_Base; |
| 5 |
use Elementor\Modules\Checklist\Data\Endpoints\Steps; |
| 6 |
use Elementor\Modules\Checklist\Data\Endpoints\User_Progress; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly |
| 10 |
} |
| 11 |
|
| 12 |
class Controller extends Controller_Base { |
| 13 |
public function get_name() { |
| 14 |
return 'checklist'; |
| 15 |
} |
| 16 |
|
| 17 |
public function register_endpoints() { |
| 18 |
$this->index_endpoint->register_item_route(); |
| 19 |
$this->register_endpoint( new Steps( $this ) ); |
| 20 |
$this->register_endpoint( new User_Progress( $this ) ); |
| 21 |
} |
| 22 |
|
| 23 |
public function update_items_permissions_check( $request ) { |
| 24 |
return current_user_can( 'manage_options' ); |
| 25 |
} |
| 26 |
|
| 27 |
public function update_item_permissions_check( $request ) { |
| 28 |
return current_user_can( 'manage_options' ); |
| 29 |
} |
| 30 |
|
| 31 |
public function get_item_permissions_check( $request ) { |
| 32 |
return current_user_can( 'manage_options' ); |
| 33 |
} |
| 34 |
|
| 35 |
public function get_items_permissions_check( $request ) { |
| 36 |
return current_user_can( 'manage_options' ); |
| 37 |
} |
| 38 |
} |
| 39 |
|