Skip to content

Commit

Permalink
fix PHP8 Deprecated: Required parameter follows optional parameter
Browse files Browse the repository at this point in the history
  • Loading branch information
Lauri Kallioniemi committed Oct 4, 2021
1 parent a48945b commit 8a6c586
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
12 changes: 9 additions & 3 deletions includes/event-organiser-event-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand All @@ -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);
}
Expand Down
2 changes: 1 addition & 1 deletion includes/event-organiser-venue-functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand Down

0 comments on commit 8a6c586

Please sign in to comment.