WordPress.org

Plugin Directory


Ignore:
Timestamp:
06/23/17 10:18:52 (4 weeks ago)
Author:
bastho
Message:

4.5.2

  • Retro compatibility in shortcodes callback
  • Display time on multi-day events
File:
1 edited

Legend:

Unmodified
Added
Removed
  • event-post/tags/4.5/eventpost.php

    r1626410 r1684161  
    44  Plugin URI: http://event-post.com 
    55  Description: Add calendar and/or geolocation metadata on posts. For a better experience, we recommand to use it with <a href="https://wordpress.org/plugins/shortcode-ui/" target="_blank">Shortcake (shortcode UI)</a> installed. 
    6   Version: 4.5.1 
     6  Version: 4.5.2 
    77  Author: N.O.U.S. Open Useful and Simple 
    88  Contributors: bastho,ecolosites 
     
    593593        //Display dates 
    594594        $dates="\t\t\t\t".'<div class="event_date" data-start="' . $this->human_date($time_start) . '" data-end="' . $this->human_date($time_end) . '">'; 
    595         if (date('d/m/Y', $time_start) == date('d/m/Y', $time_end)) { 
     595        if (date('d/m/Y', $time_start) == date('d/m/Y', $time_end)) { // same day 
    596596            $dates.= "\n\t\t\t\t\t\t\t".'<time itemprop="dtstart" datetime="' . date_i18n('c', $time_start) . '">' 
    597597                    . '<span class="date date-single">' . $this->human_date($time_end, $this->settings['dateformat']) . "</span>"; 
     
    607607            } 
    608608            $dates.="\n\t\t\t\t\t\t\t".'</time>'; 
    609         } else { 
     609        } else { // not same day 
    610610            $dates.= ' 
    611611                <span class="linking_word linking_word-from">' . __('from', 'event-post') . '</span> 
    612                 <time class="date date-start" itemprop="dtstart" datetime="' . date('c', $time_start) . '">' . $this->human_date($time_start, $this->settings['dateformat']) . '</time> 
     612                <time class="date date-start" itemprop="dtstart" datetime="' . date('c', $time_start) . '">' . $this->human_date($time_start, $this->settings['dateformat']); 
     613            if (date('H:i:s', $time_start) != '00:00:00' || date('H:i:s', $time_end) != '00:00:00'){ 
     614              $dates.= ', ' . date_i18n($this->settings['timeformat'], $time_start); 
     615            } 
     616            $dates.='</time> 
    613617                <span class="linking_word linking_word-to">' . __('to', 'event-post') . '</span> 
    614                 <time class="date date-end" itemprop="dtend" datetime="' . date('c', $time_end) . '">' . $this->human_date($time_end, $this->settings['dateformat']) . '</time> 
    615             '; 
     618                <time class="date date-end" itemprop="dtend" datetime="' . date('c', $time_end) . '">' . $this->human_date($time_end, $this->settings['dateformat']); 
     619            if (date('H:i:s', $time_start) != '00:00:00' || date('H:i:s', $time_end) != '00:00:00') { 
     620              $dates.=  ', ' . date_i18n($this->settings['timeformat'], $time_end); 
     621            } 
     622            $dates.='</time>'; 
    616623        } 
    617624        $dates.="\n\t\t\t\t\t\t".'</div><!-- .event_date -->'; 
Note: See TracChangeset for help on using the changeset viewer.