From: Steve Sutton Date: Mon, 25 Apr 2016 20:49:08 +0000 (-0400) Subject: Update for stylesheet call X-Git-Tag: v1.1.5^2 X-Git-Url: http://cvs2.gaslightmedia.com/gitweb/?a=commitdiff_plain;h=9ba7839bede070a66f5da2a6bcb9c39e3c4b4d0f;p=WP-Plugins%2Fglm-coupons.git Update for stylesheet call call only when shortcode runs --- diff --git a/controllers/front.php b/controllers/front.php index 3519b1f..b955b8a 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -20,7 +20,6 @@ class glm_coupon_front add_shortcode('glmcoupons', array($this, 'glm_coupon_shortcode')); $this->viewDir = $this->pluginDirName . self::FORM_VIEW_DIR; $this->frontViewDir = $this->viewDir . '/front'; - add_action('wp_enqueue_scripts', array($this, 'load_stylesheet')); add_action('query_vars', array($this, 'glm_coupon_query_vars')); add_action('wp', array($this, 'glm_coupon_parse_request')); } @@ -45,6 +44,14 @@ class glm_coupon_front array('category' => '-1'), $atts, 'glmcoupons') ); + wp_enqueue_style( + 'glm-coupons', + plugins_url('glm-coupons/css/front/coupons.css' , $this->pluginDirName), + array(), + '0.0.1', + 'all' + ); + ob_start(); $this->list_coupons(); $output = ob_get_contents(); @@ -59,17 +66,6 @@ class glm_coupon_front // use smarty template to output the form } - public function load_stylesheet() - { - wp_enqueue_style( - 'glm-coupons', - plugins_url('glm-coupons/css/front/coupons.css' , $this->pluginDirName), - array(), - '0.0.1', - 'all' - ); - } - public function list_coupons($print = false) { global $wpdb, $wp; diff --git a/index.php b/index.php index 1adea54..3295a89 100644 --- a/index.php +++ b/index.php @@ -2,7 +2,7 @@ /** * Plugin Name: Gaslight Media Coupons * Description: Coupon Application for Gaslight Media Clients. - * Version: 1.1.4 + * Version: 1.1.5 * Author: Steve Sutton * Author URI: http://www.gaslightmedia.com * License: All right reserved