From 9f312cd69ce7f06b0131c3d0a4de90764d18a508 Mon Sep 17 00:00:00 2001 From: Steve Sutton Date: Wed, 29 Jun 2016 14:49:32 -0400 Subject: [PATCH] Show all Coupons Add posts_per_page of -1 to show all the coupons. --- controllers/front.php | 9 +++++---- index.php | 2 +- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/controllers/front.php b/controllers/front.php index b955b8a..34fbf1a 100644 --- a/controllers/front.php +++ b/controllers/front.php @@ -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(); } diff --git a/index.php b/index.php index 3295a89..e8f3c3a 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.5 + * Version: 1.1.6 * Author: Steve Sutton * Author URI: http://www.gaslightmedia.com * License: All right reserved -- 2.17.1