Plugin Directory

Changeset 3288448


Ignore:
Timestamp:
05/06/2025 12:46:57 PM (7 months ago)
Author:
benitolopez
Message:

Releasing version 2.15.0

Location:
wp-hotelier/trunk
Files:
9 edited

Legend:

Unmodified
Added
Removed
  • wp-hotelier/trunk/hotelier.php

    r3239349 r3288448  
    44 * Plugin URI:        https://wphotelier.com/?utm_source=wpadmin&utm_medium=plugin&utm_campaign=wphotelierplugin
    55 * Description:       Hotel booking plugin for WordPress.
    6  * Version:           2.14.4
     6 * Version:           2.15.0
    77 * Author:            WP Hotelier
    88 * Author URI:        https://wphotelier.com/
    99 * Requires at least: 4.0
    10  * Tested up to:      6.6
     10 * Tested up to:      6.8
    1111 * License:           GPLv3
    1212 * License URI:       http://www.gnu.org/licenses/gpl-3.0.html
     
    3232     * @var string
    3333     */
    34     public $version = '2.14.4';
     34    public $version = '2.15.0';
    3535
    3636    /**
  • wp-hotelier/trunk/includes/admin/meta-boxes/views/reservation/html-meta-box-reservation-single-item.php

    r2575390 r3288448  
    125125    <?php foreach ( $extras as $extra_id => $extra_data ) : ?>
    126126        <?php
     127        $extra_id    = apply_filters( 'translate_object_id', $extra_id, 'extra', true );
    127128        $extra       = htl_get_extra( $extra_id );
    128129        $extra_qty   = isset( $extra_data['qty'] ) ? $extra_data['qty'] : 1;
  • wp-hotelier/trunk/includes/class-htl-info.php

    r1974323 r3288448  
    106106
    107107    /**
    108      * Gets hotel checkin hours.
     108     * Helper function to format hotel hours.
    109109     *
    110      * @return string
     110     * @param array $hours The hours settings array
     111     * @param string $filter_name The name of the filter to apply
     112     * @return string Formatted time string
    111113     */
    112     public static function get_hotel_checkin() {
    113         $checkin        = htl_get_option( 'hotel_checkin', array() );
    114         $from           = isset( $checkin[ 'from' ] ) ? $checkin[ 'from' ] : 0;
    115         $to             = isset( $checkin[ 'to' ] ) ? $checkin[ 'to' ] : 0;
     114    private static function format_hotel_hours( $hours, $filter_name ) {
     115        $from           = isset( $hours['from'] ) ? $hours['from'] : 0;
     116        $to             = isset( $hours['to'] ) ? $hours['to'] : 0;
    116117        $formatted_from = $from > 24 ? $from - 25 : $from;
    117118        $formatted_from = sprintf( '%02d', $formatted_from );
     
    120121        $formatted_to   = sprintf( '%02d', $formatted_to );
    121122        $formatted_to   .= $to > 24 ? ':30' : ':00';
     123       
     124        // Check if from and to times are the same
     125        if ( $from === $to ) {
     126            $formatted_hours = date_i18n( get_option( 'time_format' ), strtotime( $formatted_from ) );
     127        } else {
     128            $formatted_hours = date_i18n( get_option( 'time_format' ), strtotime( $formatted_from ) ) . ' - ' . date_i18n( get_option( 'time_format' ), strtotime( $formatted_to ) );
     129        }
    122130
    123         $hotel_checkin  = date_i18n( get_option( 'time_format' ), strtotime( $formatted_from ) ) . ' - ' . date_i18n( get_option( 'time_format' ), strtotime( $formatted_to ) );
     131        return apply_filters( $filter_name, $formatted_hours, $from, $to );
     132    }
    124133
    125         return apply_filters( 'hotelier_get_hotel_checkin', $hotel_checkin, $from, $to );
     134    /**
     135     * Gets hotel checkin hours.
     136     *
     137     * @return string
     138     */
     139    public static function get_hotel_checkin() {
     140        $checkin = htl_get_option( 'hotel_checkin', array() );
     141        return self::format_hotel_hours( $checkin, 'hotelier_get_hotel_checkin' );
    126142    }
    127143
     
    132148     */
    133149    public static function get_hotel_checkout() {
    134         $checkout       = htl_get_option( 'hotel_checkout', array() );
    135         $from           = isset( $checkout[ 'from' ] ) ? $checkout[ 'from' ] : 0;
    136         $to             = isset( $checkout[ 'to' ] ) ? $checkout[ 'to' ] : 0;
    137         $formatted_from = $from > 24 ? $from - 25 : $from;
    138         $formatted_from = sprintf( '%02d', $formatted_from );
    139         $formatted_from .= $from > 24 ? ':30' : ':00';
    140         $formatted_to   = $to > 24 ? $to - 25 : $to;
    141         $formatted_to   = sprintf( '%02d', $formatted_to );
    142         $formatted_to   .= $to > 24 ? ':30' : ':00';
    143         $hotel_checkout = date_i18n( get_option( 'time_format' ), strtotime( $formatted_from ) ) . ' - ' . date_i18n( get_option( 'time_format' ), strtotime( $formatted_to ) );
    144 
    145         return apply_filters( 'hotelier_get_hotel_checkout', $hotel_checkout, $from, $to );
     150        $checkout = htl_get_option( 'hotel_checkout', array() );
     151        return self::format_hotel_hours( $checkout, 'hotelier_get_hotel_checkout' );
    146152    }
    147153
  • wp-hotelier/trunk/includes/htl-extra-functions.php

    r3076051 r3288448  
    4848    );
    4949
     50    $extras = apply_filters( 'hotelier_get_all_extras_ids', $extras );
     51
    5052    set_transient( 'hotelier_extras_ids', $extras, DAY_IN_SECONDS * 30 );
    5153
  • wp-hotelier/trunk/includes/privacy/class-htl-privacy.php

    r1882581 r3288448  
    66 * @category Class
    77 * @package  Hotelier/Classes
    8  * @version  1.6.0
     8 * @version  2.15.0
    99 */
    1010
     
    4242        include_once 'class-htl-privacy-exporters.php';
    4343
    44         $this->init();
     44        add_action( 'init', array( $this, 'init' ) );
    4545    }
    4646
     
    4848     * Hook in events.
    4949     */
    50     protected function init() {
     50    public function init() {
    5151        add_filter( 'wp_privacy_personal_data_exporters', array( $this, 'register_exporters' ), 5 );
    5252        add_filter( 'wp_privacy_personal_data_erasers', array( $this, 'register_erasers' ) );
  • wp-hotelier/trunk/languages/wp-hotelier.pot

    r3239349 r3288448  
    21562156msgstr ""
    21572157
    2158 #: ../includes/htl-extra-functions.php:137
     2158#: ../includes/htl-extra-functions.php:139
    21592159msgid "This extra does not exists."
    21602160msgstr ""
    21612161
    2162 #: ../includes/htl-extra-functions.php:147
     2162#: ../includes/htl-extra-functions.php:149
    21632163msgid "This extra is not enabled."
    21642164msgstr ""
     
    46014601msgstr ""
    46024602
    4603 #: ../includes/admin/meta-boxes/views/reservation/html-meta-box-reservation-single-item.php:150
     4603#: ../includes/admin/meta-boxes/views/reservation/html-meta-box-reservation-single-item.php:151
    46044604msgid "This room does not exist anymore"
    46054605msgstr ""
  • wp-hotelier/trunk/readme.txt

    r3239349 r3288448  
    33Tags: booking, hotel, booking system, hostel, reservations, reservations, b&b, rooms, wphotelier
    44Requires at least: 4.1
    5 Tested up to: 6.7
    6 Stable tag: 2.14.4
     5Tested up to: 6.8
     6Stable tag: 2.15.0
    77License: GPLv3
    88License URI: http://www.gnu.org/licenses/gpl-3.0.html
     
    131131== Changelog ==
    132132
     133= 2.15.0 - 2025-05-06 =
     134* Add - Support for WordPress 6.8.
     135* Fix - PHP warning for text domain not loaded correctly.
     136
    133137= 2.14.4 - 2025-02-12 =
    134138* Fix - Reservation tables not showing correct info for paid deposits.
  • wp-hotelier/trunk/templates/booking/reservation-table-extras.php

    r2575390 r3288448  
    1818<?php foreach ( $extras as $extra_id => $extra_data ) : ?>
    1919    <?php
     20    $extra_id    = apply_filters( 'translate_object_id', $extra_id, 'extra', true );
    2021    $extra       = htl_get_extra( $extra_id );
    2122    $extra_qty   = isset( $extra_data['qty'] ) ? $extra_data['qty'] : 1;
  • wp-hotelier/trunk/templates/reservation/item-extras.php

    r2575390 r3288448  
    3131<?php foreach ( $extras as $extra_id => $extra_data ) : ?>
    3232    <?php
     33    $extra_id    = apply_filters( 'translate_object_id', $extra_id, 'extra', true );
    3334    $extra       = htl_get_extra( $extra_id );
    3435    $extra_qty   = isset( $extra_data['qty'] ) ? $extra_data['qty'] : 1;
Note: See TracChangeset for help on using the changeset viewer.