| @@ -5,9 +5,8 @@ | ||
| 5 | 5 | use Elementor\Plugin; |
| 6 | 6 | use Elementor\Core\Experiments\Manager as Experiments_Manager; |
| 7 | 7 | use Templately\Core\Platform\Elementor; |
| 8 | 8 | use Templately\Core\Platform\Gutenberg; |
| 9 | -use Templately\Core\Importer\Utils\Utils; | |
| 10 | 9 | use Templately\Utils\Helper; |
| 11 | 10 | |
| 12 | 11 | /** |
| 13 | 12 | * @method Elementor|Gutenberg platform( $id ); |
| @@ -25,9 +24,8 @@ | ||
| 25 | 24 | $platform = $this->get_param( 'platform', 'elementor' ); |
| 26 | 25 | $origin = $this->get_param( 'origin', 'remote' ); |
| 27 | 26 | $id = $this->get_param( 'id', 0, 'intval' ); |
| 28 | 27 | $postId = $this->get_param( 'postId', 0, 'intval' ); |
| 29 | - $settings = $this->get_param( 'settings', [], null ); | |
| 30 | 28 | |
| 31 | 29 | if( $id <= 0 || $id == null ) { |
| 32 | 30 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'get_content', 404 ); |
| 33 | 31 | } |
| @@ -40,10 +38,8 @@ | ||
| 40 | 38 | ); |
| 41 | 39 | } |
| 42 | 40 | } |
| 43 | 41 | |
| 44 | - @set_time_limit( 0 ); // Unlimited execution time for this request. | |
| 45 | - Utils::add_gd_editor_filter(); | |
| 46 | 42 | |
| 47 | 43 | switch ( $origin ) { |
| 48 | 44 | case 'cloud': |
| 49 | 45 | $template_data = $this->get_cloud_content( $id, $platform ); |
| @@ -74,9 +70,9 @@ | ||
| 74 | 70 | 'insert', 404 |
| 75 | 71 | ); |
| 76 | 72 | } |
| 77 | 73 | |
| 78 | - return $this->platform( $platform )->insert( $template_data, $postId, $settings ); | |
| 74 | + return $this->platform( $platform )->insert( $template_data, $postId ); | |
| 79 | 75 | } |
| 80 | 76 | |
| 81 | 77 | private function get_cloud_content( $id = null, $platform = 'elementor' ){ |
| 82 | 78 | $response = $this->http()->query( |
| @@ -159,13 +155,10 @@ | ||
| 159 | 155 | return $template_data; |
| 160 | 156 | } |
| 161 | 157 | |
| 162 | 158 | public function import_in_library(){ |
| 163 | - $platform = $this->get_param( 'platform', 'elementor' ); | |
| 164 | - $id = $this->get_param( 'id', 0, 'intval' ); | |
| 165 | - $settings = $this->get_param( 'settings', [], null ); | |
| 166 | - $template_type = $this->get_param( 'template_type', '', 'sanitize_text_field' ); | |
| 167 | - $type = $this->get_param( 'type', '', 'sanitize_text_field' ); | |
| 159 | + $platform = $this->get_param( 'platform', 'elementor' ); | |
| 160 | + $id = $this->get_param( 'id', 0, 'intval' ); | |
| 168 | 161 | |
| 169 | 162 | if( $id == 0 ) { |
| 170 | 163 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 ); |
| 171 | 164 | } |
| @@ -178,12 +171,9 @@ | ||
| 178 | 171 | ); |
| 179 | 172 | } |
| 180 | 173 | } |
| 181 | 174 | |
| 182 | - @set_time_limit( 0 ); // Unlimited execution time for this request. | |
| 183 | - Utils::add_gd_editor_filter(); | |
| 184 | - | |
| 185 | - return $this->platform( $platform )->import_in_library( $id, $this, $settings, $template_type, $type ); | |
| 175 | + return $this->platform( $platform )->import_in_library( $id, $this ); | |
| 186 | 176 | } |
| 187 | 177 | |
| 188 | 178 | public function import_as_page(){ |
| 189 | 179 | $platform = $this->get_param( 'platform', 'elementor' ); |
| @@ -188,9 +178,8 @@ | ||
| 188 | 178 | public function import_as_page(){ |
| 189 | 179 | $platform = $this->get_param( 'platform', 'elementor' ); |
| 190 | 180 | $id = $this->get_param( 'id', 0, 'intval' ); |
| 191 | 181 | $title = $this->get_param( 'title' ); |
| 192 | - $settings = $this->get_param( 'settings', [], null ); | |
| 193 | 182 | |
| 194 | 183 | if( $id == 0 ) { |
| 195 | 184 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 ); |
| 196 | 185 | } |
| @@ -203,10 +192,7 @@ | ||
| 203 | 192 | ); |
| 204 | 193 | } |
| 205 | 194 | } |
| 206 | 195 | |
| 207 | - @set_time_limit( 0 ); // Unlimited execution time for this request. | |
| 208 | - Utils::add_gd_editor_filter(); | |
| 209 | - | |
| 210 | - return $this->platform( $platform )->create_page( $id, $title, $this, $settings ); | |
| 196 | + return $this->platform( $platform )->create_page( $id, $title, $this ); | |
| 211 | 197 | } |
| 212 | -} | |
| 198 | +} | |