Plugin Directory

Changeset 3033837


Ignore:
Timestamp:
02/09/2024 11:11:44 PM (2 years ago)
Author:
wplugged
Message:

Version 1.9.0

Location:
webhotelier/trunk
Files:
6 added
5 edited

Legend:

Unmodified
Added
Removed
  • webhotelier/trunk/README.txt

    r3030111 r3033837  
    55Requires at least: 4.9
    66Tested up to: 6.4
    7 Stable tag: 1.8.2
     7Stable tag: 1.9.0
    88Requires PHP: 5.6
    99License: GPLv2 or later
     
    5454
    5555== Changelog ==
     56
     57= 1.9.0=
     58* Complete refactoring of the Gutenberg block
     59* Fixes a shortcode bug related to the opening and closing dates
     60* Fixes a bug occuring solely on Safari
    5661
    5762= 1.8.2=
  • webhotelier/trunk/includes/class-wp-webhotelier-shortcode.php

    r2991660 r3033837  
    9898        $wp_webhotelier_atts = shortcode_atts($default_shortcode_atts, $atts, $tag);
    9999
    100         $wp_webhotelier_atts['opening-date'] = (new DateTimeImmutable())->createFromFormat('d/m', $wp_webhotelier_atts['opening-closing-dates']['from'])->format('Y-m-d');
    101         $wp_webhotelier_atts['closing-date'] = (new DateTimeImmutable())->createFromFormat('d/m', $wp_webhotelier_atts['opening-closing-dates']['to'])->format('Y-m-d');
     100        if (is_array($wp_webhotelier_atts['opening-closing-dates'])) {
     101            $wp_webhotelier_atts['opening-date'] = (new DateTimeImmutable())->createFromFormat('d/m', $wp_webhotelier_atts['opening-closing-dates']['from'])->format('Y-m-d');
     102            $wp_webhotelier_atts['closing-date'] = (new DateTimeImmutable())->createFromFormat('d/m', $wp_webhotelier_atts['opening-closing-dates']['to'])->format('Y-m-d');
     103        }
     104        if (is_string($wp_webhotelier_atts['opening-closing-dates']) && strpos($wp_webhotelier_atts['opening-closing-dates'], ' to ') !== false) {
     105            $dates                               = explode(' to ', $wp_webhotelier_atts['opening-closing-dates']);
     106            $wp_webhotelier_atts['opening-date'] = $dates[0];
     107            $wp_webhotelier_atts['closing-date'] = $dates[1];
     108        }
     109
    102110        $wp_webhotelier_atts['default-date'] = Wp_Webhotelier_Helper::createDefaultDate($wp_webhotelier_atts['opening-date'], $wp_webhotelier_atts['closing-date'], $wp_webhotelier_atts['days-after-checkin-allowed']);
    103        
     111
    104112        //setting the id of the current view (and my_id for the page) of the loaded shortcode
    105113        $this->my_shortcode_id_num = ++self::$shortcode_class_id;
  • webhotelier/trunk/includes/class-wp-webhotelier-widget.php

    r2833480 r3033837  
    3636    {
    3737        parent::__construct(
    38             'wp_webhotelier_widget',                                                                                    // Base ID
    39             esc_html__('Webhotelier Availability Form', 'wp_webhotelier'),                                              // Name
    40             ['description' => esc_html__('Display a Webhotelier Availability Form as a widget', 'wp_webhotelier')] // Args
     38            'wp_webhotelier_widget',                                                                                // Base ID
     39            esc_html__('Webhotelier Widget Form', 'wp_webhotelier'),                                                // Name
     40            ['description' => esc_html__('Display a Webhotelier Availability Form as a widget', 'wp_webhotelier')]  // Args
    4141        );
    4242    }
     
    162162        }
    163163        $new_instance                 = array_filter($new_instance, 'strlen');
    164         $new_instance['opening-date'] = current_time('Y') . '-' . $new_instance['opening-month'] . '-' . $new_instance['opening-day'];
    165         $new_instance['closing-date'] = current_time('Y') . '-' . $new_instance['closing-month'] . '-' . $new_instance['closing-day'];
     164        $new_instance['opening-date'] = current_time('Y') . '-' . str_pad($new_instance['opening-month'], 2, 0, STR_PAD_LEFT)  . '-' . str_pad($new_instance['opening-day'], 2, 0, STR_PAD_LEFT);
     165        $new_instance['closing-date'] = current_time('Y') . '-' . str_pad($new_instance['closing-month'], 2, 0, STR_PAD_LEFT)  . '-' . str_pad($new_instance['closing-day'], 2, 0, STR_PAD_LEFT);
    166166        return $new_instance;
    167167    }
  • webhotelier/trunk/includes/class-wp-webhotelier.php

    r2656404 r3033837  
    119119         * The class responsible for adding the Gutenberg block.
    120120         */
    121         require_once plugin_dir_path(dirname(__FILE__)) . 'blocks/wp-webhotelier-block.php';
     121        require_once plugin_dir_path(dirname(__FILE__)) . 'block/wp-webhotelier-block.php';
    122122
    123123        $this->loader = new Wp_Webhotelier_Loader();
  • webhotelier/trunk/wp-webhotelier.php

    r3030111 r3033837  
    66 * Plugin URI:        https://wplugged.com/docs/webhotelier-for-wordpress/
    77 * Description:       Create and manage WebHotelier Forms easily through your WordPress
    8  * Version:           1.8.2
     8 * Version:           1.9.0
    99 * Author:            WPlugged
    1010 * Author URI:        https://wplugged.com
     
    2323 * Current plugin version.
    2424 */
    25 define('WP_WEBHOTELIER_VERSION', '1.8.2');
     25define('WP_WEBHOTELIER_VERSION', '1.9.0');
    2626
    2727
Note: See TracChangeset for help on using the changeset viewer.