| @@ -25,9 +25,8 @@ | ||
| 25 | 25 | $platform = $this->get_param( 'platform', 'elementor' ); |
| 26 | 26 | $origin = $this->get_param( 'origin', 'remote' ); |
| 27 | 27 | $id = $this->get_param( 'id', 0, 'intval' ); |
| 28 | 28 | $postId = $this->get_param( 'postId', 0, 'intval' ); |
| 29 | - $settings = $this->get_param( 'settings', [], null ); | |
| 30 | 29 | |
| 31 | 30 | if( $id <= 0 || $id == null ) { |
| 32 | 31 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'get_content', 404 ); |
| 33 | 32 | } |
| @@ -74,9 +73,9 @@ | ||
| 74 | 73 | 'insert', 404 |
| 75 | 74 | ); |
| 76 | 75 | } |
| 77 | 76 | |
| 78 | - return $this->platform( $platform )->insert( $template_data, $postId, $settings ); | |
| 77 | + return $this->platform( $platform )->insert( $template_data, $postId ); | |
| 79 | 78 | } |
| 80 | 79 | |
| 81 | 80 | private function get_cloud_content( $id = null, $platform = 'elementor' ){ |
| 82 | 81 | $response = $this->http()->query( |
| @@ -159,13 +158,11 @@ | ||
| 159 | 158 | return $template_data; |
| 160 | 159 | } |
| 161 | 160 | |
| 162 | 161 | 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' ); | |
| 162 | + $platform = $this->get_param( 'platform', 'elementor' ); | |
| 163 | + $id = $this->get_param( 'id', 0, 'intval' ); | |
| 164 | + $settings = $this->get_param( 'settings', [], null ); | |
| 168 | 165 | |
| 169 | 166 | if( $id == 0 ) { |
| 170 | 167 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 ); |
| 171 | 168 | } |
| @@ -181,9 +178,9 @@ | ||
| 181 | 178 | |
| 182 | 179 | @set_time_limit( 0 ); // Unlimited execution time for this request. |
| 183 | 180 | Utils::add_gd_editor_filter(); |
| 184 | 181 | |
| 185 | - return $this->platform( $platform )->import_in_library( $id, $this, $settings, $template_type, $type ); | |
| 182 | + return $this->platform( $platform )->import_in_library( $id, $this, $settings ); | |
| 186 | 183 | } |
| 187 | 184 | |
| 188 | 185 | public function import_as_page(){ |
| 189 | 186 | $platform = $this->get_param( 'platform', 'elementor' ); |
| @@ -188,9 +185,9 @@ | ||
| 188 | 185 | public function import_as_page(){ |
| 189 | 186 | $platform = $this->get_param( 'platform', 'elementor' ); |
| 190 | 187 | $id = $this->get_param( 'id', 0, 'intval' ); |
| 191 | 188 | $title = $this->get_param( 'title' ); |
| 192 | - $settings = $this->get_param( 'settings', [], null ); | |
| 189 | + $settings = $this->get_param( 'settings', [] ); | |
| 193 | 190 | |
| 194 | 191 | if( $id == 0 ) { |
| 195 | 192 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 ); |
| 196 | 193 | } |
| @@ -208,5 +205,5 @@ | ||
| 208 | 205 | Utils::add_gd_editor_filter(); |
| 209 | 206 | |
| 210 | 207 | return $this->platform( $platform )->create_page( $id, $title, $this, $settings ); |
| 211 | 208 | } |
| 212 | -} | |
| 209 | +} | |