summaryrefslogtreecommitdiff
path: root/inc/compatibility/class-astra-divi-builder.php
diff options
context:
space:
mode:
authorZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
committerZach van Rijn <me@zv.io>2021-07-21 14:54:07 -0500
commit9d4123cee1867ee7199b06bdc92d40611f547ecc (patch)
tree6d864e2725242863afed1f8ba12d9c7a9bc63a69 /inc/compatibility/class-astra-divi-builder.php
downloadblog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.gz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.bz2
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.tar.xz
blog-ng-9d4123cee1867ee7199b06bdc92d40611f547ecc.zip
Initial unmodified import from Astra (Version: 3.6.5) @ /wp-content/themes/astra/.
Diffstat (limited to 'inc/compatibility/class-astra-divi-builder.php')
-rw-r--r--inc/compatibility/class-astra-divi-builder.php68
1 files changed, 68 insertions, 0 deletions
diff --git a/inc/compatibility/class-astra-divi-builder.php b/inc/compatibility/class-astra-divi-builder.php
new file mode 100644
index 0000000..5f0192d
--- /dev/null
+++ b/inc/compatibility/class-astra-divi-builder.php
@@ -0,0 +1,68 @@
+<?php
+/**
+ * Divi Builder File.
+ *
+ * @package Astra
+ */
+
+// If plugin - 'Divi Builder' not exist then return.
+if ( ! class_exists( 'ET_Builder_Plugin' ) ) {
+ return;
+}
+
+/**
+ * Astra Divi Builder
+ */
+if ( ! class_exists( 'Astra_Divi_Builder' ) ) :
+
+ /**
+ * Astra Divi Builder
+ *
+ * @since 1.4.0
+ */
+ class Astra_Divi_Builder {
+
+ /**
+ * Member Variable
+ *
+ * @var object instance
+ */
+ private static $instance;
+
+ /**
+ * Initiator
+ */
+ public static function get_instance() {
+ if ( ! isset( self::$instance ) ) {
+ self::$instance = new self();
+ }
+ return self::$instance;
+ }
+
+ /**
+ * Constructor
+ */
+ public function __construct() {
+ add_filter( 'astra_theme_assets', array( $this, 'add_styles' ) );
+ }
+
+ /**
+ * Add assets in theme
+ *
+ * @param array $assets list of theme assets (JS & CSS).
+ * @return array List of updated assets.
+ * @since 1.4.0
+ */
+ public function add_styles( $assets ) {
+ $assets['css']['astra-divi-builder'] = 'compatibility/divi-builder';
+ return $assets;
+ }
+
+ }
+
+endif;
+
+/**
+ * Kicking this off by calling 'get_instance()' method
+ */
+Astra_Divi_Builder::get_instance();