summaryrefslogtreecommitdiffstats
path: root/includes/venue.php
diff options
context:
space:
mode:
authorHarald Eilertsen <haraldei@anduin.net>2021-04-14 21:44:42 +0200
committerHarald Eilertsen <haraldei@anduin.net>2021-04-14 21:44:42 +0200
commit96fbcbc6a915fc284a6a07de6696be66ef5cecb2 (patch)
treea4fa98b499bc5b617852f74fcaf0b27193cb2ec8 /includes/venue.php
parenta17c5b5f05ca4c7cf4f0d0d640f95ae283b1796a (diff)
downloadgigologadmin-96fbcbc6a915fc284a6a07de6696be66ef5cecb2.tar.gz
gigologadmin-96fbcbc6a915fc284a6a07de6696be66ef5cecb2.tar.bz2
gigologadmin-96fbcbc6a915fc284a6a07de6696be66ef5cecb2.zip
GiglogAdmin_Venue: Use default args to set default city.
Diffstat (limited to 'includes/venue.php')
-rw-r--r--includes/venue.php7
1 files changed, 3 insertions, 4 deletions
diff --git a/includes/venue.php b/includes/venue.php
index 896f448..1b3d79b 100644
--- a/includes/venue.php
+++ b/includes/venue.php
@@ -28,21 +28,20 @@ if ( !class_exists('GiglogAdmin_Venue') ) {
$this->webpage = isset($attrs->wpgvenue_webpage) ? $attrs->wpgvenue_webpage : NULL;
}
- static function create($name,$city)
+ static function create($name, $city = 'Oslo')
{
$venue = new GiglogAdmin_Venue((object) [
'wpgvenue_name' => $name,
- 'wpgvenue_city' => !empty($city) ? $city : 'Oslo',
+ 'wpgvenue_city' => $city,
]);
$venue->save();
return $venue;
}
- static function find_or_create($name, $city)
+ static function find_or_create($name, $city = 'Oslo')
{
global $wpdb;
- if(empty($city)) $city='Oslo';
$venuesql = 'SELECT * FROM wpg_venues WHERE upper(wpgvenue_name)="' . $name . '"';
$results = $wpdb->get_results($venuesql);