PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.1
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.1
3.13.1 3.13.0 3.12.13 3.12.12 3.12.11 3.12.10 3.12.9 3.12.8 3.12.7 3.12.6 3.12.5 3.12.4 3.12.3 3.12.1 3.12.2 3.12.0 3.11.1 3.11.0 3.10.9 3.10.8 3.10.7 3.10.6 2.8.16 2.8.17 2.8.18 All 259 releases
wpfunnels / admin / import-export / batch-processing / elementor / class-wpfnl-elementor-source.php

class-wpfnl-elementor-source.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.1, at admin/import-export/batch-processing/elementor/class-wpfnl-elementor-source.php

58 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Elementor source
4 *
5 * @package WPFunnels\Batch\Elementor
6 */
7
8 namespace WPFunnels\Batch\Elementor;
9
10 use Elementor\TemplateLibrary\Source_Local;
11
12 /**
13 * Elementor source
14 *
15 * @since 1.0.0
16 */
17 class Wpfnl_Elementor_Source extends Source_Local {
18
19
20 /**
21 * Import single template
22 *
23 * @param string|int $step_id Funnel step id.
24 *
25 * @return array|int|void|\WP_Error
26 *
27 * @since 1.0.0
28 */
29 public function import_single_template( $step_id ) {
30 $_elementor_data = get_post_meta( $step_id, '_elementor_data', true );
31 $content = '';
32 if ( $_elementor_data ) {
33 if ( is_array( $_elementor_data ) ) {
34 $content = $_elementor_data;
35 } else {
36 $_elementor_data = add_magic_quotes( json_decode( $_elementor_data, true ) );
37 $content = $_elementor_data;
38 }
39 }
40
41 if ( is_array( $content ) ) {
42 $content = $this->process_export_import_content( $content, 'on_import' );
43 update_metadata( 'post', $step_id, '_elementor_data', $content );
44 $this->clear_cache();
45 }
46 }
47
48 /**
49 * Clear cache
50 */
51 public function clear_cache() {
52 // Clear 'Elementor' file cache.
53 if ( class_exists( '\Elementor\Plugin' ) ) {
54 \Elementor\Plugin::$instance->files_manager->clear_cache();
55 }
56 }
57 }
58