diff options
author | Harald Eilertsen <haraldei@anduin.net> | 2023-01-29 15:39:09 +0100 |
---|---|---|
committer | Harald Eilertsen <haraldei@anduin.net> | 2023-01-29 15:39:09 +0100 |
commit | 4671f9e2903945b51060ffd127d8ee5cf05a2f94 (patch) | |
tree | f062c66b716a877b87f99a6ca61f2811bf78f517 | |
parent | eb92d695450fd51e23d928343d0c11226a20404d (diff) | |
download | gigologadmin-4671f9e2903945b51060ffd127d8ee5cf05a2f94.tar.gz gigologadmin-4671f9e2903945b51060ffd127d8ee5cf05a2f94.tar.bz2 gigologadmin-4671f9e2903945b51060ffd127d8ee5cf05a2f94.zip |
Make sure limit and offset is actually used.
-rw-r--r-- | includes/class-giglogadmin-concert.php | 12 |
1 files 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 ); } /** |