PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 2.0.0
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v2.0.0
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 +2 -8 3.1.102.0.0 View file →
@@ -20,9 +20,8 @@
20 20 public function insert_template() {
21 21 $platform = $this->get_param( 'platform', 'elementor' );
22 22 $origin = $this->get_param( 'origin', 'remote' );
23 23 $id = $this->get_param( 'id', 0, 'intval' );
24 - $postId = $this->get_param( 'postId', 0, 'intval' );
25 24
26 25 if( $id <= 0 || $id == null ) {
27 26 return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'get_content', 404 );
28 27 }
@@ -31,9 +30,9 @@
31 30 case 'cloud':
32 31 $template_data = $this->get_cloud_content( $id, $platform );
33 32 break;
34 33 case 'remote':
35 - $template_data = $this->get_remote_content( $id );
34 + $template_data = $this->get_remote_content( $id, $platform, $origin );
36 35 break;
37 36 case 'local':
38 37 default:
39 38 $template_data = $this->get_local_content( $id, $platform );
@@ -40,13 +39,8 @@
40 39 $template_data = isset( $template_data['data'] ) ? $template_data['data'] : [];
41 40 break;
42 41 }
43 42
44 - /**
45 - * A fallback for old cloud items.
46 - */
47 - $template_data = is_string( $template_data ) ? json_decode( wp_unslash($template_data), true ) : $template_data;
48 -
49 43 if( is_wp_error( $template_data ) ) {
50 44 return $template_data;
51 45 }
52 46
@@ -57,9 +51,9 @@
57 51 'insert', 404
58 52 );
59 53 }
60 54
61 - return $this->platform( $platform )->insert( $template_data, $postId );
55 + return $this->platform( $platform )->insert( $template_data );
62 56 }
63 57
64 58 private function get_cloud_content( $id = null, $platform = 'elementor' ){
65 59 $response = $this->http()->query(