PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 1.1.2
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v1.1.2
3.3.0 3.2.1 3.2.0 3.1.4 3.1.3 3.1.2 3.1.1 3.1.0 3.0.1 trunk 1.0.4 1.1.0 1.1.0.1 1.1.1 1.1.10 1.1.11 1.1.12 1.1.13 1.1.14 1.1.15 1.1.16 1.1.17 1.1.18 1.1.19 1.1.2 All 162 releases
cartflows / classes / class-cartflows-elementor-compatibility.php

class-cartflows-elementor-compatibility.php in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 1.1.2, at classes/class-cartflows-elementor-compatibility.php

67 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 page builder compatibility
4 *
5 * @package CartFlows
6 */
7
8 namespace Elementor\Modules\PageTemplates;
9
10 use Elementor\Core\Base\Document;
11 use Elementor\Plugin;
12
13 /**
14 * Class for elementor page builder compatibility
15 */
16 class Cartflows_Elementor_Compatibility {
17
18 /**
19 * Member Variable
20 *
21 * @var instance
22 */
23 private static $instance;
24
25 /**
26 * Initiator
27 */
28 public static function get_instance() {
29 if ( ! isset( self::$instance ) ) {
30 self::$instance = new self;
31 }
32 return self::$instance;
33 }
34
35 /**
36 * Constructor
37 */
38 public function __construct() {
39
40 add_filter( 'cartflows_page_template', array( $this, 'get_page_template' ) );
41 }
42
43 /**
44 * Get page template fiter callback for elementor preview mode
45 *
46 * @param string $template page template.
47 * @return string
48 */
49 public function get_page_template( $template ) {
50
51 if ( is_singular() ) {
52 $document = Plugin::$instance->documents->get_doc_for_frontend( get_the_ID() );
53
54 if ( $document ) {
55 $template = $document->get_meta( '_wp_page_template' );
56 }
57 }
58
59 return $template;
60 }
61 }
62
63 /**
64 * Kicking this off by calling 'get_instance()' method
65 */
66 Cartflows_Elementor_Compatibility::get_instance();
67