PluginProbe
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell / 3.13.2
WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell v3.13.2
3.13.3 3.13.2 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 All 261 releases
wpfunnels / includes / core / widgets / divi-modules / classes / class-wpfnl-divi-theme-compatibility.php

class-wpfnl-divi-theme-compatibility.php in WPFunnels – Funnel Builder for WooCommerce with Checkout & One Click Upsell 3.13.2, at includes/core/widgets/divi-modules/classes/class-wpfnl-divi-theme-compatibility.php

76 lines 1.8 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Theme compattability
4 *
5 * @package
6 */
7 if ( ! defined( 'ABSPATH' ) ) {
8 // Exit if accessed directly.
9 exit;
10 }
11
12 class Wpfnl_Divi_Theme_Compatibility extends ET_Builder_Plugin_Compat_Base {
13 /**
14 * Constructor.
15 *
16 * @since 2.3.4
17 */
18 public function __construct() {
19 $this->plugin_id = 'wpfunnels/wpfnl.php';
20 $this->init_hooks();
21 }
22 /**
23 * Hook methods to WordPress.
24 *
25 * @since 2.3.4
26 *
27 * @return void
28 */
29 public function init_hooks() {
30 // Bail if there's no version found.
31 if ( ! $this->get_plugin_version() ) {
32 return;
33 }
34 add_action( 'wp', array( $this, 'maybe_disable_theme_builder' ), 9 );
35 }
36 /**
37 * Disable theme builder for specific Wpfunnels templates that don't use
38 * the normal WordPress partials (get_header(), get_footer()).
39 *
40 * @since 2.3.4
41 */
42 public function maybe_disable_theme_builder() {
43 $step_post_type = defined( 'WPFNL_STEPS_POST_TYPE' ) ? WPFNL_STEPS_POST_TYPE : 'wpfunnel_steps';
44
45 if ( is_singular( $step_post_type ) ) {
46 /**
47 * Filters page templates that should have the Theme Builder disabled.
48 *
49 * @param string[] $templates
50 *
51 * @since 2.3.4
52 */
53 $disable_for = apply_filters( 'et_builder_compatibility_wpfunnel_templates_without_theme_builder', array('wpfunnels_fullwidth_without_header_footer' ) );
54 $template = get_post_meta( get_the_ID(), '_wp_page_template', true );
55
56 if ( in_array( $template, $disable_for, true ) ) {
57 add_filter( 'et_theme_builder_template_layouts', array( $this, 'disable_theme_builder' ) );
58 }
59 }
60 }
61
62 /**
63 * Disable theme builder for the current request by returning no layouts for it.
64 *
65 * @param array $layouts
66 *
67 * @return array
68 * @since 2.3.4
69 */
70
71 public function disable_theme_builder( $layouts ) {
72 return array();
73 }
74 }
75 new Wpfnl_Divi_Theme_Compatibility();
76