testing out the glma filters
authorAnthony Talarico <talarico@gaslightmedia.com>
Fri, 18 Oct 2019 03:08:51 +0000 (23:08 -0400)
committerAnthony Talarico <talarico@gaslightmedia.com>
Fri, 18 Oct 2019 03:08:51 +0000 (23:08 -0400)
admin/glm-theme-options.php
admin/includes/glma-addons.php [new file with mode: 0644]
functions.php
includes/defines.php

index a164b70..9a4d03e 100644 (file)
@@ -10,12 +10,14 @@ License: GPL-2.0+
 Text Domain: glmthemeoptions
 minimum PHP Version : 5.4
 */
-
 if ( ! defined( 'ABSPATH' ) ) {
        die();
 }
 require_once get_template_directory().'/includes/defines.php';
+require_once 'includes/glma-addons.php';
+
 use Glm\GlmThemeOptions\Defines;
+use Glm\GlmThemeOptions\GlmaAddons;
 
 require_once 'utility.php';
 
@@ -25,11 +27,12 @@ if(!class_exists('GlmThemOptions')){
         private $glm_theme_options;
         private static $instance = null;
         private $utility;
-        private $log;
+        private $glma_addons;
 
         function __construct(){
             $this->utility = new GlmThemeUtility();
             $this->defines = new Glm\GlmThemeOptions\Defines\Defines();
+            $this->glma_addons = new Glm\GlmThemeOptions\GlmaAddons\GlmaAddons();
             $this->glm_theme_options = $this->defines::$glm_theme_options;
         }
 
@@ -57,9 +60,7 @@ if(!class_exists('GlmThemOptions')){
         public function glm_get_theme_options() {
             
             if( get_option( $this->glm_theme_options ) ){
-
                 $data = get_option( $this->glm_theme_options );
-                echo stripslashes($data);
             }
             wp_die();
             // $this->utility::log( get_option($this->glm_theme_options ));
@@ -75,6 +76,7 @@ if(!class_exists('GlmThemOptions')){
             require_once 'menus.php';
             $this->glm_init_theme_options();
             $this->glm_create_ajax_actions();
+            $this->glma_addons->glm_load_addons();
         }
     }
 }
diff --git a/admin/includes/glma-addons.php b/admin/includes/glma-addons.php
new file mode 100644 (file)
index 0000000..800ce85
--- /dev/null
@@ -0,0 +1,21 @@
+<?php
+namespace Glm\GlmThemeOptions\GlmaAddons;
+
+if (! class_exists( 'GlmaAddons') ){
+    require_once ABSPATH . 'wp-admin/includes/plugin.php';
+
+    class GlmaAddons{
+        private $glma_addons;
+
+        private function glm_addons_installed(){
+            return is_plugin_active( 'glm-member-db/index.php');
+        }
+
+        public function glm_load_addons(){
+            if( $this->glm_addons_installed() ){
+                $this->glma_addons = apply_filters("glm_list_addons",'');
+            }
+        }
+
+    }
+}
\ No newline at end of file
index d98a69c..3dd7d75 100644 (file)
@@ -19,4 +19,4 @@ add_action("wp_enqueue_scripts", function(){
     wp_enqueue_style("glm_theme_styles", get_template_directory_uri()."/dist/css/glm-app.min.css",false,"glm1570914435915.0.0");
     wp_enqueue_script("jquery");
     wp_enqueue_script("glm_theme_js", get_template_directory_uri()."/dist/js/glm-app.min.js", array("jquery"), "glm1570914435915.0.0", true);
-});
\ No newline at end of file
+});
index ec00506..e4c251f 100644 (file)
@@ -1,6 +1,7 @@
 <?php
 namespace Glm\GlmThemeOptions\Defines;
 if(!class_exists('Defines')){
+    
     class Defines{
         public static $glm_options_url;
         public static $glm_theme_options = "glm_theme_options";