| @@ -610,8 +610,10 @@ | ||
| 610 | 610 | remove_filter( 'elementor/files/allow-file-type/json', [ $this, 'enable_json_template_upload' ] ); |
| 611 | 611 | remove_filter( 'elementor/files/allow_unfiltered_upload', [ $this, 'enable_json_template_upload' ] ); |
| 612 | 612 | |
| 613 | 613 | if ( is_wp_error( $upload_result ) ) { |
| 614 | + Plugin::$instance->uploads_manager->remove_file_or_dir( dirname( $upload_result['tmp_name'] ) ); | |
| 615 | + | |
| 614 | 616 | return $upload_result; |
| 615 | 617 | } |
| 616 | 618 | |
| 617 | 619 | $source = $this->get_source( $data['source'] ?? 'local' ); |
| @@ -678,17 +680,9 @@ | ||
| 678 | 680 | } |
| 679 | 681 | |
| 680 | 682 | $import_data = $document->get_import_data( [ 'content' => $elements ] ); |
| 681 | 683 | |
| 682 | - $content = $document::on_import_update_dynamic_content( | |
| 683 | - $import_data['content'], | |
| 684 | - [ 'post_ids' => [] ] | |
| 685 | - ); | |
| 686 | - | |
| 687 | - return Plugin::$instance->db->iterate_data( $content, function( $element_data ) { | |
| 688 | - unset( $element_data['htmlCache'] ); | |
| 689 | - return $element_data; | |
| 690 | - } ); | |
| 684 | + return $import_data['content']; | |
| 691 | 685 | } |
| 692 | 686 | |
| 693 | 687 | public function process_global_styles( array $args ) { |
| 694 | 688 | $validate_args = $this->ensure_args( [ 'content', 'import_mode' ], $args ); |