← All changes
|
app/modules/import-export-customization/processes/import.php
+21
-21
4.1.3
→
3.35.0-dev4
View file →
| @@ -306,9 +306,18 @@ | ||
| 306 | 306 | if ( empty( $this->runners ) ) { |
| 307 | 307 | throw new \Exception( 'Couldn’t execute the import process because no import runners have been specified. Try again by specifying import runners.' ); |
| 308 | 308 | } |
| 309 | 309 | |
| 310 | - $data = $this->build_runner_data(); | |
| 310 | + $data = [ | |
| 311 | + 'session_id' => $this->session_id, | |
| 312 | + 'include' => $this->settings_include, | |
| 313 | + 'manifest' => $this->manifest, | |
| 314 | + 'site_settings' => $this->site_settings, | |
| 315 | + 'selected_plugins' => $this->settings_selected_plugins, | |
| 316 | + 'customization' => $this->settings_customization, | |
| 317 | + 'extracted_directory_path' => $this->extracted_directory_path, | |
| 318 | + 'selected_custom_post_types' => $this->settings_selected_custom_post_types, | |
| 319 | + ]; | |
| 311 | 320 | |
| 312 | 321 | $this->init_import_session(); |
| 313 | 322 | |
| 314 | 323 | remove_filter( 'elementor/document/save/data', [ Plugin::$instance->modules_manager->get_modules( 'content-sanitizer' ), 'sanitize_content' ] ); |
| @@ -352,9 +361,18 @@ | ||
| 352 | 361 | if ( empty( $this->runners ) ) { |
| 353 | 362 | throw new \Exception( 'Couldn’t execute the import process because no import runners have been specified. Try again by specifying import runners.' ); |
| 354 | 363 | } |
| 355 | 364 | |
| 356 | - $data = $this->build_runner_data(); | |
| 365 | + $data = [ | |
| 366 | + 'session_id' => $this->session_id, | |
| 367 | + 'include' => $this->settings_include, | |
| 368 | + 'manifest' => $this->manifest, | |
| 369 | + 'site_settings' => $this->site_settings, | |
| 370 | + 'selected_plugins' => $this->settings_selected_plugins, | |
| 371 | + 'customization' => $this->settings_customization, | |
| 372 | + 'extracted_directory_path' => $this->extracted_directory_path, | |
| 373 | + 'selected_custom_post_types' => $this->settings_selected_custom_post_types, | |
| 374 | + ]; | |
| 357 | 375 | |
| 358 | 376 | add_filter( 'elementor/document/save/data', [ $this, 'prevent_saving_elements_on_post_creation' ], 10, 2 ); |
| 359 | 377 | |
| 360 | 378 | // Set the Request's state as an Elementor upload request, in order to support unfiltered file uploads. |
| @@ -452,27 +470,9 @@ | ||
| 452 | 470 | return apply_filters( 'elementor/import/kit_thumbnail', '', $this->kit_id, $this->settings_referrer ); |
| 453 | 471 | } |
| 454 | 472 | |
| 455 | 473 | public function get_runners_name(): array { |
| 456 | - $data = $this->build_runner_data(); | |
| 457 | - | |
| 458 | - return array_keys( array_filter( | |
| 459 | - $this->runners, | |
| 460 | - fn( $runner ) => $runner->should_import( $data ) | |
| 461 | - ) ); | |
| 462 | - } | |
| 463 | - | |
| 464 | - private function build_runner_data(): array { | |
| 465 | - return [ | |
| 466 | - 'session_id' => $this->session_id, | |
| 467 | - 'include' => $this->settings_include, | |
| 468 | - 'manifest' => $this->manifest, | |
| 469 | - 'site_settings' => $this->site_settings, | |
| 470 | - 'selected_plugins' => $this->settings_selected_plugins, | |
| 471 | - 'customization' => $this->settings_customization, | |
| 472 | - 'extracted_directory_path' => $this->extracted_directory_path, | |
| 473 | - 'selected_custom_post_types' => $this->settings_selected_custom_post_types, | |
| 474 | - ]; | |
| 474 | + return array_keys( $this->runners ); | |
| 475 | 475 | } |
| 476 | 476 | |
| 477 | 477 | public function get_manifest() { |
| 478 | 478 | return $this->manifest; |