Plugin Directory

Changeset 1557771


Ignore:
Timestamp:
12/19/2016 06:17:50 PM (9 years ago)
Author:
Houghtelin
Message:

df9dad1 Merge pull request #137 from Gueststream-Inc/fix_getavail_error

Location:
vrpconnector/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • vrpconnector/trunk/README.txt

    r1540787 r1557771  
    33Tags: Vacation Rental Platform, Gueststream, VRP Connector, ISILink, HomeAway, Escapia, Barefoot, VRMGR
    44Requires at least: 3.0.1
    5 Tested up to: 4.6.1
     5Tested up to: 4.7
    66Stable tag: trunk
    77License: GPLv2 or later
     
    5353
    5454== Changelog ==
     55= 1.4.5 =
     56* Cleaning up code style in Theme files to better match WordPress code style standards.
     57* Fixing PHP Notice in library on get unit availability request.
     58
    5559= 1.4.4 =
    5660* Added support for Yoast SEO plugin to display page titles and meta descriptions.
  • vrpconnector/trunk/VRPConnector.php

    r1540787 r1557771  
    55 * Description: Vacation Rental Platform Connector.
    66 * Author: Gueststream
    7  * Version: 1.4.4
     7 * Version: 1.4.5
    88 * Author URI: http://www.gueststream.com/
    99 *
  • vrpconnector/trunk/lib/VRPConnector.php

    r1553895 r1557771  
    850850        ];
    851851
    852         foreach ( $unitData->avail as $v ) {
    853 
    854             $fromDateTS = strtotime( '+1 Day', strtotime( $v->start_date ) );
    855             $toDateTS   = strtotime( $v->end_date );
    856 
    857             array_push( $unitBookedDates['noCheckin'], date( 'n-j-Y', strtotime( $v->start_date ) ) );
    858 
    859             for ( $currentDateTS = $fromDateTS; $currentDateTS < $toDateTS; $currentDateTS += ( 60 * 60 * 24 ) ) {
    860                 $currentDateStr = date( 'n-j-Y', $currentDateTS );
    861                 array_push( $unitBookedDates['bookedDates'], $currentDateStr );
     852        if ( isset( $unitData->avail ) && is_array( $unitData->avail ) ) {
     853            foreach ( $unitData->avail as $v ) {
     854
     855                $fromDateTS = strtotime( '+1 Day', strtotime( $v->start_date ) );
     856                $toDateTS   = strtotime( $v->end_date );
     857
     858                array_push( $unitBookedDates['noCheckin'], date( 'n-j-Y', strtotime( $v->start_date ) ) );
     859
     860                for ( $currentDateTS = $fromDateTS; $currentDateTS < $toDateTS; $currentDateTS += ( 60 * 60 * 24 ) ) {
     861                    $currentDateStr = date( 'n-j-Y', $currentDateTS );
     862                    array_push( $unitBookedDates['bookedDates'], $currentDateStr );
     863                }
    862864            }
    863865        }
Note: See TracChangeset for help on using the changeset viewer.