import_single_post( $post_id ); } } } /** * Update post meta. * * @since 1.0.14 * @param integer $post_id Post ID. * @return void */ public function import_single_post( $post_id = 0 ) { if ( ! empty( $post_id ) ) { $hotlink_imported = get_post_meta( $post_id, '_astra_sites_hotlink_imported', true ); if ( empty( $hotlink_imported ) ) { $data = get_post_meta( $post_id, '_elementor_data', true ); if ( ! empty( $data ) ) { // Update WP form IDs. $ids_mapping = get_option( 'astra_sites_wpforms_ids_mapping', array() ); if ( $ids_mapping ) { foreach ( $ids_mapping as $old_id => $new_id ) { $data = str_replace( '[wpforms id=\"' . $old_id, '[wpforms id=\"' . $new_id, $data ); } } $data = add_magic_quotes( $data ); $data = json_decode( $data, true ); // Import the data. $data = $this->process_export_import_content( $data, 'on_import' ); // Update processed meta. update_metadata( 'post', $post_id, '_elementor_data', $data ); update_metadata( 'post', $post_id, '_astra_sites_hotlink_imported', true ); // !important, Clear the cache after images import. Plugin::$instance->posts_css_manager->clear_cache(); } } } } }