meta; if ( array_key_exists( '_elementor_data', $meta_data ) ) { $this->import_single_template( $step_id, $meta_data['_elementor_data'] ); } } /** * Imports single template. * * @param int $post_id Post ID. * @param string $content Content. */ public function import_single_template( $post_id, $content ) { if ( empty( $content ) ) { return; } if ( ! is_array( $content ) ) { $content = json_decode( $content, true ); $content = add_magic_quotes( $content ); } if ( is_array( $content ) ) { $content = $this->process_export_import_content( $content, 'on_import' ); update_post_meta( $post_id, '_elementor_data', $content ); $this->clear_elementor_cache(); } } /** * Clear Cache. * * @since 1.0.0 */ public function clear_elementor_cache() { // Clear 'Elementor' file cache. if ( class_exists( '\Elementor\Plugin' ) ) { Plugin::$instance->files_manager->clear_cache(); } } }