| @@ -158,11 +158,13 @@ | ||
| 158 | 158 | return $template_data; |
| 159 | 159 | } |
| 160 | 160 | |
| 161 | 161 | 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 ); | |
| 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' ); | |
| 165 | 167 | |
| 166 | 168 | if( $id == 0 ) { |
| 167 | 169 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 ); |
| 168 | 170 | } |
| @@ -178,9 +180,9 @@ | ||
| 178 | 180 | |
| 179 | 181 | @set_time_limit( 0 ); // Unlimited execution time for this request. |
| 180 | 182 | Utils::add_gd_editor_filter(); |
| 181 | 183 | |
| 182 | - return $this->platform( $platform )->import_in_library( $id, $this, $settings ); | |
| 184 | + return $this->platform( $platform )->import_in_library( $id, $this, $settings, $template_type, $type ); | |
| 183 | 185 | } |
| 184 | 186 | |
| 185 | 187 | public function import_as_page(){ |
| 186 | 188 | $platform = $this->get_param( 'platform', 'elementor' ); |
| @@ -185,9 +187,9 @@ | ||
| 185 | 187 | public function import_as_page(){ |
| 186 | 188 | $platform = $this->get_param( 'platform', 'elementor' ); |
| 187 | 189 | $id = $this->get_param( 'id', 0, 'intval' ); |
| 188 | 190 | $title = $this->get_param( 'title' ); |
| 189 | - $settings = $this->get_param( 'settings', [] ); | |
| 191 | + $settings = $this->get_param( 'settings', [], null ); | |
| 190 | 192 | |
| 191 | 193 | if( $id == 0 ) { |
| 192 | 194 | return $this->error('invalid_item_id', __( 'Invalid ID is provided.', 'templately' ), 'import/page', 404 ); |
| 193 | 195 | } |