From 218b7b0a36c7844e38a3b0de01089669d529330d Mon Sep 17 00:00:00 2001 From: Virginia Garcia Date: Tue, 24 Mar 2020 12:31:35 -0300 Subject: [PATCH] - Fixed PHP error `Undefined variable: connection`. - Fixed PHP error `preg_match() expects parameter 2 to be string, array given`. - Fixed PHP error `Undefined variable: accommodation_id`. - Fixed PHP error `Undefined variable: temp_id`. --- changelog.txt | 4 ++++ includes/functions.php | 5 ++++- includes/template-tags/destination.php | 7 ++++--- templates/content-map-marker.php | 3 +++ 4 files changed, 15 insertions(+), 4 deletions(-) diff --git a/changelog.txt b/changelog.txt index 047b3e75..c23d4fc4 100644 --- a/changelog.txt +++ b/changelog.txt @@ -15,6 +15,10 @@ - Fix output escaping issues. - Fixed issue `PHP Deprecated: dbx_post_advanced is deprecated since version 3.7.0! Use add_meta_boxes instead`. - Fixed Slick slider bug. +- Fixed PHP error `Undefined variable: connection`. +- Fixed PHP error `preg_match() expects parameter 2 to be string, array given`. +- Fixed PHP error `Undefined variable: accommodation_id`. +- Fixed PHP error `Undefined variable: temp_id`. ### Security - Sanitizing widget fields. diff --git a/includes/functions.php b/includes/functions.php index 042cb89b..b633522c 100644 --- a/includes/functions.php +++ b/includes/functions.php @@ -197,7 +197,8 @@ function lsx_to_itinerary_has_thumbnail() { */ function lsx_to_itinerary_thumbnail() { global $tour_itinerary; - + $accommodation_id = ''; + $temp_id = ''; if ( $tour_itinerary && $tour_itinerary->has_itinerary && false !== $tour_itinerary->itinerary ) { $thumbnail_src = false; @@ -241,7 +242,9 @@ function lsx_to_itinerary_thumbnail() { // If it is the last day of the itinerary and there is no image, then use the featured image of the tour. if ( $tour_itinerary->index === $tour_itinerary->count && ( false === $thumbnail_src || '' === $thumbnail_src ) ) { + $temp_id = get_post_thumbnail_id( $accommodation_id ); + if ( false !== $temp_id ) { $current_image_id = $tour_itinerary->find_next_image( $accommodation_id ); $temp_src_array = wp_get_attachment_image_src( $current_image_id, 'lsx-thumbnail-square' ); diff --git a/includes/template-tags/destination.php b/includes/template-tags/destination.php index c2d6936f..4fb1c7f1 100644 --- a/includes/template-tags/destination.php +++ b/includes/template-tags/destination.php @@ -391,8 +391,8 @@ function destination_children( $parent_id ) { ) ); $meta_class = 'lsx-to-meta-data lsx-to-meta-data-'; if ( $child->have_posts() ) { - $list_destinations = array(); - + $list_destinations = array(); + $final_list_destinations = ''; echo ''; while ( $child->have_posts() ) { $child->the_post(); @@ -400,7 +400,8 @@ function destination_children( $parent_id ) { $childlink = get_the_permalink(); $list_destinations[] = ' ' . esc_attr( $childtitle ) . ''; } - echo implode( ', ', wp_kses_post( $list_destinations ) ); + $final_list_destinations = implode( ', ', $list_destinations ); + echo wp_kses_post( $final_list_destinations ); } else { echo ''; $parent_title = get_the_title( wp_get_post_parent_id( $theid ) ); diff --git a/templates/content-map-marker.php b/templates/content-map-marker.php index 3baeb62c..e1937c6e 100644 --- a/templates/content-map-marker.php +++ b/templates/content-map-marker.php @@ -11,6 +11,9 @@