From 8a6c58604bda5743e43cbbbb14386ba4de1d4d8e Mon Sep 17 00:00:00 2001 From: Lauri Kallioniemi Date: Mon, 4 Oct 2021 14:40:51 +0300 Subject: [PATCH] fix PHP8 Deprecated: Required parameter follows optional parameter --- includes/event-organiser-event-functions.php | 12 +++++++++--- includes/event-organiser-venue-functions.php | 2 +- 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/includes/event-organiser-event-functions.php b/includes/event-organiser-event-functions.php index e401c047..d67b5bd2 100644 --- a/includes/event-organiser-event-functions.php +++ b/includes/event-organiser-event-functions.php @@ -310,8 +310,12 @@ function eo_get_the_occurrence( $event_id, $occurrence_id ) { * @param int $occurrence_id The occurrence ID * @return string the start date formated to given format, as accepted by PHP date */ -function eo_get_the_occurrence_start($format='d-m-Y',$occurrence_id){ +function eo_get_the_occurrence_start($format = 'd-m-Y', $occurrence_id = 0){ global $wpdb; + + if( empty( $occurrence_id ) ) { + return false; + } $querystr = $wpdb->prepare(" SELECT StartDate,StartTime FROM {$wpdb->eo_events} @@ -320,13 +324,15 @@ function eo_get_the_occurrence_start($format='d-m-Y',$occurrence_id){ $occurrence = $wpdb->get_row($querystr); - if( !$occurrence ) + if( !$occurrence ) { return false; + } $date = trim($occurrence->StartDate).' '.trim($occurrence->StartTime); - if(empty($date)||$date==" ") + if(empty($date)||$date==" ") { return false; + } return eo_format_date($date,$format); } diff --git a/includes/event-organiser-venue-functions.php b/includes/event-organiser-venue-functions.php index bb3ec402..5b3ad99d 100644 --- a/includes/event-organiser-venue-functions.php +++ b/includes/event-organiser-venue-functions.php @@ -1023,7 +1023,7 @@ function _eventorganiser_get_venue_address_fields(){ *@ignore *@access private */ -function eventorganiser_venue_dropdown($post_id=0,$args){ +function eventorganiser_venue_dropdown($post_id = 0, $args = array() ){ $venues = get_terms('event-venue', array('hide_empty'=>false)); $current = (int) eo_get_venue($post_id);