From 4671f9e2903945b51060ffd127d8ee5cf05a2f94 Mon Sep 17 00:00:00 2001 From: Harald Eilertsen Date: Sun, 29 Jan 2023 15:39:09 +0100 Subject: Make sure limit and offset is actually used. --- includes/class-giglogadmin-concert.php | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) diff --git a/includes/class-giglogadmin-concert.php b/includes/class-giglogadmin-concert.php index c277648..a470617 100644 --- a/includes/class-giglogadmin-concert.php +++ b/includes/class-giglogadmin-concert.php @@ -245,10 +245,7 @@ if ( ! class_exists( 'GiglogAdmin_Concert' ) ) { } $query .= ' ORDER BY wpgconcert_date'; - - if ( ! empty( $lmt ) ) { - $query .= " LIMIT {$offset},{$limit}"; - } + $query .= " LIMIT {$offset},{$limit}"; return $query; } @@ -272,12 +269,7 @@ if ( ! class_exists( 'GiglogAdmin_Concert' ) ) { // phpcs:ignore WordPress.DB.PreparedSQL.NotPrepared $results = $wpdb->get_results( $query ); - return array_map( - function( $c ) { - return new GiglogAdmin_Concert( $c ); - }, - $results - ); + return array_map( fn( $c ) => new GiglogAdmin_Concert( $c ), $results ); } /** -- cgit v1.2.3