Plugin Directory

Changeset 2501574


Ignore:
Timestamp:
03/23/2021 09:13:53 AM (5 years ago)
Author:
slopeit
Message:

Add compatibility with wordpress 5.7

File:
1 edited

Legend:

Unmodified
Added
Removed
  • slope-widgets/trunk/slope-reservations.php

    r2501564 r2501574  
    4747
    4848    // Checkbox: slope_options[show_children]
    49     if ($options['show_children']) {
    50         $checkedChildren = ' checked="checked" ';
    51     }
     49    $checkedChildren = array_key_exists('show_children', $options) ? ' checked="checked" ' : null;
    5250    echo "<div class='setting-field'>
    5351      <label class='checkbox-children'>" . esc_html__('Mostra selezione bambini', 'slope-widgets') . "<input " . $checkedChildren . " id='slope_show_children' name='slope_options[show_children]' type='checkbox'></label>
     
    6765    echo "<div class='setting-field'>
    6866            <label>" . esc_html__('Apri il Booking Engine in una nuova scheda', 'slope-widgets');
    69     if ($options['book_target']) {
    70         $checkedBook = ' checked="checked" ';
    71     }
     67    $checkedBook = array_key_exists('book_target', $options) ? ' checked="checked" ' : null;
    7268    echo "<input" . $checkedBook . " id='slope_book_target' name='slope_options[book_target]' type='checkbox'></label></div>";
    7369
     
    384380                    <span class="slope-guests-adults">' . $strings['adults'] . '</span>';
    385381
    386     if ($options['show_children']) {
    387         $html .= '<span style="font-size: 16px"> - </span><span class="slope-children-count" data-sync-value="children"></span>
     382    if (array_key_exists('show_children', $options)) {
     383      $html .= '<span style="font-size: 16px"> - </span><span class="slope-children-count" data-sync-value="children"></span>
    388384              <span class="slope-guests-children">' . $strings['children'] . '</span>';
    389385    }
Note: See TracChangeset for help on using the changeset viewer.