Skip to content

Commit

Permalink
- Fixed PHP error Undefined variable: connection.
Browse files Browse the repository at this point in the history
- 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`.
  • Loading branch information
viscosho committed Mar 24, 2020
1 parent 4d31e3d commit 218b7b0
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 4 deletions.
4 changes: 4 additions & 0 deletions changelog.txt
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
5 changes: 4 additions & 1 deletion includes/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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' );
Expand Down
7 changes: 4 additions & 3 deletions includes/template-tags/destination.php
Original file line number Diff line number Diff line change
Expand Up @@ -391,16 +391,17 @@ 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 '<span class="' . esc_attr( $meta_class ) . 'regions"><span class="lsx-to-meta-data-key">' . esc_html__( 'Regions', 'tour-operator' ) . ':</span>';
while ( $child->have_posts() ) {
$child->the_post();
$childtitle = get_the_title();
$childlink = get_the_permalink();
$list_destinations[] = '<a href="' . esc_attr( $childlink ) . '"> ' . esc_attr( $childtitle ) . '</a>';
}
echo implode( ', ', wp_kses_post( $list_destinations ) );
$final_list_destinations = implode( ', ', $list_destinations );
echo wp_kses_post( $final_list_destinations );
} else {
echo '<span class="' . esc_attr( $meta_class ) . 'regions"><span class="lsx-to-meta-data-key">' . esc_html__( 'Country', 'tour-operator' ) . ':</span>';
$parent_title = get_the_title( wp_get_post_parent_id( $theid ) );
Expand Down
3 changes: 3 additions & 0 deletions templates/content-map-marker.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,9 @@

<div class="entry-content">
<?php
if ( empty( $connection ) || '' === $connection || 'undefined' === $connection ) {
$connection = '';
}
$excerpt = get_the_excerpt( $connection );
if ( empty( $excerpt ) || '' === $excerpt ) {
$tooltip = apply_filters( 'get_the_excerpt', get_the_content() );
Expand Down

0 comments on commit 218b7b0

Please sign in to comment.