PluginProbe
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce / 3.1.0
CartFlows – Funnel Builder & Checkout Plugin for WooCommerce v3.1.0
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 / admin-core / inc / onboarding-helper.php

onboarding-helper.php in CartFlows – Funnel Builder & Checkout Plugin for WooCommerce 3.1.0, at admin-core/inc/onboarding-helper.php

77 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 * CartFlows Onboarding Helper.
4 *
5 * @package CartFlows
6 */
7
8 namespace CartflowsAdmin\AdminCore\Inc;
9
10 // Exit if accessed directly.
11 if ( ! defined( 'ABSPATH' ) ) {
12 exit;
13 }
14
15 /**
16 * Class OnboardingHelper.
17 */
18 class OnboardingHelper {
19
20 /**
21 * Determine the active supported page builder.
22 *
23 * This function checks the list of supported page builders and returns the first active one.
24 * If no active page builder is found, it returns false.
25 *
26 * @param array $supported_page_builders List of supported page builders.
27 * @return string|bool The slug of the active page builder or false if none is active.
28 */
29 public static function get_active_supported_builder( $supported_page_builders ) {
30 foreach ( $supported_page_builders as $key => $builder ) {
31 if ( 'yes' === $builder['install'] && 'yes' === $builder['active'] ) {
32 return $key;
33 } elseif ( 'divi' === $key && self::is_divi_enabled() ) {
34 return $key;
35 } elseif ( 'bricks-builder' === $key && self::is_bricks_enabled() ) {
36 return $key;
37 }
38 }
39
40 return false;
41 }
42
43 /**
44 * Check if divi builder enabled.
45 *
46 * @param object $theme theme data.
47 * @return boolean
48 */
49 public static function is_divi_enabled( $theme = false ) {
50
51 if ( empty( $theme ) ) {
52 $theme = wp_get_theme();
53 }
54
55 if ( defined( 'ET_BUILDER_THEME' ) || defined( 'ET_BUILDER_PLUGIN_VERSION' ) || 'Divi' === $theme->name || 'Divi' === $theme->parent_theme || 'Extra' === $theme->name || 'Extra' === $theme->parent_theme ) {
56 return true;
57 }
58
59 return false;
60 }
61
62 /**
63 * Check if bricks builder enabled.
64 *
65 * @return boolean
66 */
67 public static function is_bricks_enabled() {
68
69 $theme = wp_get_theme();
70 if ( 'Bricks' === $theme->name || 'Bricks' === $theme->parent_theme ) {
71 return true;
72 }
73
74 return false;
75 }
76 }
77