Show all Coupons
authorSteve Sutton <steve@gaslightmedia.com>
Wed, 29 Jun 2016 18:49:32 +0000 (14:49 -0400)
committerSteve Sutton <steve@gaslightmedia.com>
Wed, 29 Jun 2016 18:49:32 +0000 (14:49 -0400)
Add posts_per_page of -1 to show all the coupons.

controllers/front.php
index.php

index b955b8a..34fbf1a 100644 (file)
@@ -70,13 +70,14 @@ class glm_coupon_front
     {
         global $wpdb, $wp;
 
-        $glm_couponscategory   = (isset($_REQUEST['glm_couponscategory']))
+        $glm_couponscategory = (isset($_REQUEST['glm_couponscategory']))
             ? filter_var($_REQUEST['glm_couponscategory'])
             : false;
         $catSelected = stripslashes(htmlspecialchars($glm_couponscategory));
-
-        $midnight           = strtotime(date('Y-m-d',time()).' 00:00:00');
+        $midnight    = strtotime(date('Y-m-d',time()).' 00:00:00');
+        // args for the search
         $args = array(
+            'posts_per_page' => -1,
             'post_type' => GLM_COUPON_POST_TYPE,
             'meta_query' => array(
                 array(
@@ -97,7 +98,7 @@ class glm_coupon_front
         foreach ($coupons as $coupon) {
             $custom = get_post_custom($coupon->ID);
             if (isset($custom['glm_coupons_member'][0]) && $custom['glm_coupons_member'][0]) {
-                 $member_data = $this->_getMemberData($custom['glm_coupons_member'][0]);
+                $member_data = $this->_getMemberData($custom['glm_coupons_member'][0]);
             } else {
                 $member_data = array();
             }
index 3295a89..e8f3c3a 100644 (file)
--- 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.5
+ * Version: 1.1.6
  * Author: Steve Sutton
  * Author URI: http://www.gaslightmedia.com
  * License: All right reserved