summaryrefslogtreecommitdiffstats
path: root/includes/concert.php
diff options
context:
space:
mode:
Diffstat (limited to 'includes/concert.php')
-rw-r--r--includes/concert.php9
1 files changed, 6 insertions, 3 deletions
diff --git a/includes/concert.php b/includes/concert.php
index 050c924..455bc82 100644
--- a/includes/concert.php
+++ b/includes/concert.php
@@ -171,14 +171,17 @@ if ( !class_exists('GiglogAdmin_Concert') ) {
}
- public static function find_concerts_in(string $city) : array
+ public static function find_concerts_in(?string $city = null) : array
{
global $wpdb;
$query = 'SELECT wpg_concerts.*, wpg_venues.wpgvenue_name, wpg_venues.wpgvenue_city '
. 'FROM wpg_concerts '
- . 'INNER JOIN wpg_venues ON wpg_concerts.venue = wpg_venues.id '
- . 'WHERE wpg_venues.wpgvenue_city = ' . $wpdb->prepare('%s', $city);
+ . 'INNER JOIN wpg_venues ON wpg_concerts.venue = wpg_venues.id ';
+
+ if ( $city ) {
+ $query .= 'WHERE wpg_venues.wpgvenue_city = ' . $wpdb->prepare('%s', $city);
+ }
$results = $wpdb->get_results($query);