| 1 |
<?php |
| 2 |
namespace Elementor\Includes\TemplateLibrary\Data\Endpoints; |
| 3 |
|
| 4 |
use Elementor\Data\V2\Base\Endpoint; |
| 5 |
use Elementor\Plugin; |
| 6 |
|
| 7 |
if ( ! defined( 'ABSPATH' ) ) { |
| 8 |
exit; // Exit if accessed directly. |
| 9 |
} |
| 10 |
|
| 11 |
class Templates extends Endpoint { |
| 12 |
public function get_name() { |
| 13 |
return 'templates'; |
| 14 |
} |
| 15 |
|
| 16 |
public function get_format() { |
| 17 |
return 'template-library/templates'; |
| 18 |
} |
| 19 |
|
| 20 |
public function get_items( $request ) { |
| 21 |
return Plugin::$instance->templates_manager->get_library_data( [ 'filter_sources' => [ $request->get_param( 'source' ) ] ] ); |
| 22 |
} |
| 23 |
} |
| 24 |
|