summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--includes/class-giglogadmin-concert.php9
1 files changed, 5 insertions, 4 deletions
diff --git a/includes/class-giglogadmin-concert.php b/includes/class-giglogadmin-concert.php
index 94b1902..c277648 100644
--- a/includes/class-giglogadmin-concert.php
+++ b/includes/class-giglogadmin-concert.php
@@ -209,7 +209,8 @@ if ( ! class_exists( 'GiglogAdmin_Concert' ) ) {
);
$where = array();
- $lmt = array();
+ $offset = 0;
+ $limit = 15;
foreach ( $filter as $key => $value ) {
switch ( $key ) {
case 'name':
@@ -230,11 +231,11 @@ if ( ! class_exists( 'GiglogAdmin_Concert' ) ) {
break;
case 'offset':
- array_push( $lmt, $value );
+ $offset = intval( $value );
break;
case 'limit':
- array_push( $lmt, $value );
+ $limit = intval( $value );
break;
}
}
@@ -246,7 +247,7 @@ if ( ! class_exists( 'GiglogAdmin_Concert' ) ) {
$query .= ' ORDER BY wpgconcert_date';
if ( ! empty( $lmt ) ) {
- $query .= ' LIMIT ' . implode( ', ', $lmt );
+ $query .= " LIMIT {$offset},{$limit}";
}
return $query;