PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 3.4.7
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v3.4.7
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 +6 -15 3.7.33.4.7 View file →
@@ -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 }
@@ -41,9 +39,8 @@
41 39 }
42 40 }
43 41
44 42 @set_time_limit( 0 ); // Unlimited execution time for this request.
45 - Utils::add_gd_editor_filter();
46 43
47 44 switch ( $origin ) {
48 45 case 'cloud':
49 46 $template_data = $this->get_cloud_content( $id, $platform );
@@ -74,9 +71,9 @@
74 71 'insert', 404
75 72 );
76 73 }
77 74
78 - return $this->platform( $platform )->insert( $template_data, $postId, $settings );
75 + return $this->platform( $platform )->insert( $template_data, $postId );
79 76 }
80 77
81 78 private function get_cloud_content( $id = null, $platform = 'elementor' ){
82 79 $response = $this->http()->query(
@@ -159,13 +156,10 @@
159 156 return $template_data;
160 157 }
161 158
162 159 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' );
160 + $platform = $this->get_param( 'platform', 'elementor' );
161 + $id = $this->get_param( 'id', 0, 'intval' );
168 162
169 163 if( $id == 0 ) {
170 164 return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 );
171 165 }
@@ -179,11 +173,10 @@
179 173 }
180 174 }
181 175
182 176 @set_time_limit( 0 ); // Unlimited execution time for this request.
183 - Utils::add_gd_editor_filter();
184 177
185 - return $this->platform( $platform )->import_in_library( $id, $this, $settings, $template_type, $type );
178 + return $this->platform( $platform )->import_in_library( $id, $this );
186 179 }
187 180
188 181 public function import_as_page(){
189 182 $platform = $this->get_param( 'platform', 'elementor' );
@@ -188,9 +181,8 @@
188 181 public function import_as_page(){
189 182 $platform = $this->get_param( 'platform', 'elementor' );
190 183 $id = $this->get_param( 'id', 0, 'intval' );
191 184 $title = $this->get_param( 'title' );
192 - $settings = $this->get_param( 'settings', [], null );
193 185
194 186 if( $id == 0 ) {
195 187 return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 );
196 188 }
@@ -204,9 +196,8 @@
204 196 }
205 197 }
206 198
207 199 @set_time_limit( 0 ); // Unlimited execution time for this request.
208 - Utils::add_gd_editor_filter();
209 200
210 - return $this->platform( $platform )->create_page( $id, $title, $this, $settings );
201 + return $this->platform( $platform )->create_page( $id, $title, $this );
211 202 }
212 -}
203 +}