diff options
-rw-r--r-- | includes/concert.php | 19 |
1 files changed, 12 insertions, 7 deletions
diff --git a/includes/concert.php b/includes/concert.php index 8c99c42..e3c32e8 100644 --- a/includes/concert.php +++ b/includes/concert.php @@ -31,13 +31,18 @@ if ( !class_exists('GiglogAdmin_Concert') ) { if ( isset( $attrs->venue ) ) { - $venue_attrs = (object) [ - "id" => $attrs->venue, - "wpgvenue_name" => $attrs->wpgvenue_name, - "wpgvenue_city" => $attrs->wpgvenue_city, - ]; - - $this->venue = new GiglogAdmin_Venue($venue_attrs); + if (isset($attrs->wpgvenue_name) && isset($attrs->wpgvenue_city)) { + $venue_attrs = (object) [ + "id" => $attrs->venue, + "wpgvenue_name" => $attrs->wpgvenue_name, + "wpgvenue_city" => $attrs->wpgvenue_city, + ]; + + $this->venue = new GiglogAdmin_Venue($venue_attrs); + } + else { + $this->venue = GiglogAdmin_Venue::get($attrs->venue); + } } } |