PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.0.6
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.0.6
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | includes/API/Import.php +4 -48 3.6.73.0.6 View file →
@@ -1,14 +1,10 @@
1 1 <?php
2 2
3 3 namespace Templately\API;
4 4
5 -use Elementor\Plugin;
6 -use Elementor\Core\Experiments\Manager as Experiments_Manager;
7 5 use Templately\Core\Platform\Elementor;
8 6 use Templately\Core\Platform\Gutenberg;
9 -use Templately\Core\Importer\Utils\Utils;
10 -use Templately\Utils\Helper;
11 7
12 8 /**
13 9 * @method Elementor|Gutenberg platform( $id );
14 10 */
@@ -29,21 +25,9 @@
29 25
30 26 if( $id <= 0 || $id == null ) {
31 27 return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'get_content', 404 );
32 28 }
33 - if($platform === 'elementor') {
34 - if(Helper::enable_elementor_container()) {
35 - return $this->error(
36 - 'retry_again',
37 - __( 'Please try again we enabled container.', 'templately' ),
38 - 'insert', 404
39 - );
40 - }
41 - }
42 29
43 - @set_time_limit( 0 ); // Unlimited execution time for this request.
44 - Utils::add_gd_editor_filter();
45 -
46 30 switch ( $origin ) {
47 31 case 'cloud':
48 32 $template_data = $this->get_cloud_content( $id, $platform );
49 33 break;
@@ -158,31 +142,16 @@
158 142 return $template_data;
159 143 }
160 144
161 145 public function import_in_library(){
162 - $platform = $this->get_param( 'platform', 'elementor' );
163 - $id = $this->get_param( 'id', 0, 'intval' );
164 - $settings = $this->get_param( 'settings', [], null );
165 - $template_type = $this->get_param( 'template_type', '', 'sanitize_text_field' );
166 - $type = $this->get_param( 'type', '', 'sanitize_text_field' );
146 + $platform = $this->get_param( 'platform', 'elementor' );
147 + $id = $this->get_param( 'id', 0, 'intval' );
167 148
168 149 if( $id == 0 ) {
169 150 return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 );
170 151 }
171 - if($platform === 'elementor') {
172 - if(Helper::enable_elementor_container()) {
173 - return $this->error(
174 - 'retry_again',
175 - __( 'Please try again we enabled container.', 'templately' ),
176 - 'insert', 404
177 - );
178 - }
179 - }
180 152
181 - @set_time_limit( 0 ); // Unlimited execution time for this request.
182 - Utils::add_gd_editor_filter();
183 -
184 - return $this->platform( $platform )->import_in_library( $id, $this, $settings, $template_type, $type );
153 + return $this->platform( $platform )->import_in_library( $id, $this );
185 154 }
186 155
187 156 public function import_as_page(){
188 157 $platform = $this->get_param( 'platform', 'elementor' );
@@ -187,25 +156,12 @@
187 156 public function import_as_page(){
188 157 $platform = $this->get_param( 'platform', 'elementor' );
189 158 $id = $this->get_param( 'id', 0, 'intval' );
190 159 $title = $this->get_param( 'title' );
191 - $settings = $this->get_param( 'settings', [], null );
192 160
193 161 if( $id == 0 ) {
194 162 return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 );
195 163 }
196 - if($platform === 'elementor') {
197 - if(Helper::enable_elementor_container()) {
198 - return $this->error(
199 - 'retry_again',
200 - __( 'Please try again we enabled container.', 'templately' ),
201 - 'insert', 404
202 - );
203 - }
204 - }
205 164
206 - @set_time_limit( 0 ); // Unlimited execution time for this request.
207 - Utils::add_gd_editor_filter();
208 -
209 - return $this->platform( $platform )->create_page( $id, $title, $this, $settings );
165 + return $this->platform( $platform )->create_page( $id, $title, $this );
210 166 }
211 167 }