| 1 |
<?php |
| 2 |
namespace Elementor\Includes\TemplateLibrary\Data; |
| 3 |
|
| 4 |
use Elementor\User; |
| 5 |
use Elementor\TemplateLibrary\Source_Local; |
| 6 |
use Elementor\Data\V2\Base\Controller as Controller_Base; |
| 7 |
|
| 8 |
if ( ! defined( 'ABSPATH' ) ) { |
| 9 |
exit; // Exit if accessed directly. |
| 10 |
} |
| 11 |
|
| 12 |
class Controller extends Controller_Base { |
| 13 |
|
| 14 |
public function get_name() { |
| 15 |
return 'template-library'; |
| 16 |
} |
| 17 |
|
| 18 |
public function register_endpoints() { |
| 19 |
$this->register_endpoint( new Endpoints\Templates( $this ) ); |
| 20 |
} |
| 21 |
|
| 22 |
protected function register_index_endpoint() { |
| 23 |
// Bypass, currently does not required. |
| 24 |
} |
| 25 |
|
| 26 |
public function get_permission_callback( $request ) { |
| 27 |
return User::is_current_user_can_edit_post_type( Source_Local::CPT ); |
| 28 |
} |
| 29 |
} |
| 30 |
|