class-elementor-source.php
74 lines
| 1 | <?php |
| 2 | |
| 3 | namespace SuperbAddons\Elementor\Utils; |
| 4 | |
| 5 | defined('ABSPATH') || exit(); |
| 6 | |
| 7 | use Elementor\TemplateLibrary\Source_Base; |
| 8 | |
| 9 | class ElementorSourceExtension extends Source_Base // Extend Source_Base to gain access to Elementor functions such as process_export_import_content |
| 10 | { |
| 11 | /////////////////////////////// |
| 12 | // Required functions because of Source_Base extension abstractions |
| 13 | public function get_id() |
| 14 | { |
| 15 | return 'superbaddons-layout-manager'; |
| 16 | } |
| 17 | |
| 18 | public function get_title() |
| 19 | { |
| 20 | return __('Superb Layout Manager', "superb-blocks"); |
| 21 | } |
| 22 | |
| 23 | public function register_data() |
| 24 | { |
| 25 | } |
| 26 | |
| 27 | public function save_item($template_data) |
| 28 | { |
| 29 | return new \WP_Error('invalid_request', 'Cannot save template.'); |
| 30 | } |
| 31 | |
| 32 | public function update_item($new_data) |
| 33 | { |
| 34 | return new \WP_Error('invalid_request', 'Cannot update template.'); |
| 35 | } |
| 36 | |
| 37 | public function delete_template($template_id) |
| 38 | { |
| 39 | return new \WP_Error('invalid_request', 'Cannot delete template.'); |
| 40 | } |
| 41 | |
| 42 | public function export_template($template_id) |
| 43 | { |
| 44 | return new \WP_Error('invalid_request', 'Cannot export template.'); |
| 45 | } |
| 46 | |
| 47 | public function get_items($args = array()) |
| 48 | { |
| 49 | return new \WP_Error('invalid_request', 'Cannot get items.'); |
| 50 | } |
| 51 | |
| 52 | public function get_item($template_id) |
| 53 | { |
| 54 | return new \WP_Error('invalid_request', 'Cannot get item.'); |
| 55 | } |
| 56 | |
| 57 | public function request_template_data($template_id) |
| 58 | { |
| 59 | return new \WP_Error('invalid_request', 'Cannot request template data.'); |
| 60 | } |
| 61 | |
| 62 | public function get_data(array $args, $context = 'display') |
| 63 | { |
| 64 | return new \WP_Error('invalid_request', 'Cannot get data.'); |
| 65 | } |
| 66 | ///// |
| 67 | |
| 68 | public function HandleImport(&$data) |
| 69 | { |
| 70 | $data['content'] = $this->replace_elements_ids($data['content']); |
| 71 | $data['content'] = $this->process_export_import_content($data['content'], 'on_import'); |
| 72 | } |
| 73 | } |
| 74 |