@@ -1,11 +1,11 @@ |
||
| 1 | 1 | <?php |
| 2 | 2 | /** |
| 3 | - * Shared functions |
|
| 4 | - * |
|
| 5 | - * Functions shared by both back end and front end components. |
|
| 6 | - * |
|
| 7 | - * @package SimpleCalendar/Functions |
|
| 8 | - */ |
|
| 3 | + * Shared functions |
|
| 4 | + * |
|
| 5 | + * Functions shared by both back end and front end components. |
|
| 6 | + * |
|
| 7 | + * @package SimpleCalendar/Functions |
|
| 8 | + */ |
|
| 9 | 9 | |
| 10 | 10 | if ( ! defined( 'ABSPATH' ) ) { |
| 11 | 11 | exit; |
@@ -594,21 +594,21 @@ discard block |
||
| 594 | 594 | if ( ! $event->whole_day ) { |
| 595 | 595 | |
| 596 | 596 | $time_start = $this->calendar->datetime_separator . |
| 597 | - ' <span class="simcal-event-start simcal-event-start-time" ' . |
|
| 598 | - 'data-event-start="' . $start->getTimestamp() . '" ' . |
|
| 599 | - 'data-event-format="' . $this->calendar->time_format . '" ' . |
|
| 600 | - 'itemprop="startDate" data-content="' . $start->toIso8601String() . '">' . |
|
| 601 | - date_i18n( $this->calendar->time_format, $start->getTimestamp() ) . |
|
| 602 | - '</span> '; |
|
| 597 | + ' <span class="simcal-event-start simcal-event-start-time" ' . |
|
| 598 | + 'data-event-start="' . $start->getTimestamp() . '" ' . |
|
| 599 | + 'data-event-format="' . $this->calendar->time_format . '" ' . |
|
| 600 | + 'itemprop="startDate" data-content="' . $start->toIso8601String() . '">' . |
|
| 601 | + date_i18n( $this->calendar->time_format, $start->getTimestamp() ) . |
|
| 602 | + '</span> '; |
|
| 603 | 603 | |
| 604 | 604 | if ( $end instanceof Carbon ) { |
| 605 | 605 | |
| 606 | 606 | $time_end = ' <span class="simcal-event-end simcal-event-end-time" ' . |
| 607 | - 'data-event-end="' . $end->getTimestamp() . '" ' . |
|
| 608 | - 'data-event-format="' . $this->calendar->time_format . '" ' . |
|
| 609 | - 'itemprop="endDate" data-content="' . $end->toIso8601String() . '">' . |
|
| 610 | - date_i18n( $this->calendar->time_format, $end->getTimestamp() ) . |
|
| 611 | - '</span> '; |
|
| 607 | + 'data-event-end="' . $end->getTimestamp() . '" ' . |
|
| 608 | + 'data-event-format="' . $this->calendar->time_format . '" ' . |
|
| 609 | + 'itemprop="endDate" data-content="' . $end->toIso8601String() . '">' . |
|
| 610 | + date_i18n( $this->calendar->time_format, $end->getTimestamp() ) . |
|
| 611 | + '</span> '; |
|
| 612 | 612 | |
| 613 | 613 | } |
| 614 | 614 | |
@@ -617,23 +617,23 @@ discard block |
||
| 617 | 617 | if ( $event->multiple_days ) { |
| 618 | 618 | |
| 619 | 619 | $output = ' <span class="simcal-event-start simcal-event-start-date" ' . |
| 620 | - 'data-event-start="' . $start->getTimestamp() . '" ' . |
|
| 621 | - 'data-event-format="' . $this->calendar->date_format . '" ' . |
|
| 622 | - 'itemprop="startDate" data-content="' . $start->toIso8601String() . '">' . |
|
| 623 | - date_i18n( $this->calendar->date_format, $start->getTimestamp() ) . |
|
| 624 | - '</span> ' . |
|
| 625 | - $time_start; |
|
| 620 | + 'data-event-start="' . $start->getTimestamp() . '" ' . |
|
| 621 | + 'data-event-format="' . $this->calendar->date_format . '" ' . |
|
| 622 | + 'itemprop="startDate" data-content="' . $start->toIso8601String() . '">' . |
|
| 623 | + date_i18n( $this->calendar->date_format, $start->getTimestamp() ) . |
|
| 624 | + '</span> ' . |
|
| 625 | + $time_start; |
|
| 626 | 626 | |
| 627 | 627 | if ( $end instanceof Carbon ) { |
| 628 | 628 | |
| 629 | 629 | $output .= '-' . |
| 630 | - ' <span class="simcal-event-start simcal-event-end-date" ' . |
|
| 631 | - 'data-event-start="' . $end->getTimestamp() . '" ' . |
|
| 632 | - 'data-event-format="' . $this->calendar->date_format . '" ' . |
|
| 633 | - 'itemprop="endDate" data-content="' . $end->toIso8601String() . '">' . |
|
| 634 | - date_i18n( $this->calendar->date_format, $end->getTimestamp() ) . |
|
| 635 | - '</span> ' . |
|
| 636 | - $time_end; |
|
| 630 | + ' <span class="simcal-event-start simcal-event-end-date" ' . |
|
| 631 | + 'data-event-start="' . $end->getTimestamp() . '" ' . |
|
| 632 | + 'data-event-format="' . $this->calendar->date_format . '" ' . |
|
| 633 | + 'itemprop="endDate" data-content="' . $end->toIso8601String() . '">' . |
|
| 634 | + date_i18n( $this->calendar->date_format, $end->getTimestamp() ) . |
|
| 635 | + '</span> ' . |
|
| 636 | + $time_end; |
|
| 637 | 637 | } |
| 638 | 638 | |
| 639 | 639 | } else { |
@@ -641,12 +641,12 @@ discard block |
||
| 641 | 641 | $time_end = ! empty( $time_start ) && ! empty( $time_end ) ? ' - ' . $time_end : ''; |
| 642 | 642 | |
| 643 | 643 | $output = ' <span class="simcal-event-start simcal-event-start-date" ' . |
| 644 | - 'data-event-start="' . $start->getTimestamp() . '" ' . |
|
| 645 | - 'data-event-format="' . $this->calendar->date_format . '">' . |
|
| 646 | - date_i18n( $this->calendar->date_format, $start->getTimestamp() ) . |
|
| 647 | - '</span> ' . |
|
| 648 | - $time_start . |
|
| 649 | - $time_end; |
|
| 644 | + 'data-event-start="' . $start->getTimestamp() . '" ' . |
|
| 645 | + 'data-event-format="' . $this->calendar->date_format . '">' . |
|
| 646 | + date_i18n( $this->calendar->date_format, $start->getTimestamp() ) . |
|
| 647 | + '</span> ' . |
|
| 648 | + $time_start . |
|
| 649 | + $time_end; |
|
| 650 | 650 | |
| 651 | 651 | } |
| 652 | 652 | |
@@ -705,11 +705,11 @@ discard block |
||
| 705 | 705 | } |
| 706 | 706 | |
| 707 | 707 | return '<span class="simcal-event-' . $bound . ' ' . 'simcal-event-' . $bound . '-' . $format . '" ' . |
| 708 | - 'data-event-' . $bound . '="' . $event_dt->getTimestamp() . '" ' . |
|
| 709 | - 'data-event-format="' . $dt_format . '" ' . |
|
| 710 | - 'itemprop="' . $bound . 'Date" data-content="' . $event_dt->toIso8601String() . '">' . |
|
| 711 | - $value . |
|
| 712 | - '</span>'; |
|
| 708 | + 'data-event-' . $bound . '="' . $event_dt->getTimestamp() . '" ' . |
|
| 709 | + 'data-event-format="' . $dt_format . '" ' . |
|
| 710 | + 'itemprop="' . $bound . 'Date" data-content="' . $event_dt->toIso8601String() . '">' . |
|
| 711 | + $value . |
|
| 712 | + '</span>'; |
|
| 713 | 713 | } |
| 714 | 714 | |
| 715 | 715 | /** |
@@ -928,35 +928,35 @@ discard block |
||
| 928 | 928 | $tagregexp = implode( '|', array_values( $this->tags ) ); |
| 929 | 929 | |
| 930 | 930 | return '/' |
| 931 | - . '\\[' // Opening bracket |
|
| 932 | - . '(\\[?)' // 1: Optional second opening bracket for escaping tags: [[tag]] |
|
| 933 | - . "($tagregexp)" // 2: Tag name |
|
| 934 | - . '(?![\\w-])' // Not followed by word character or hyphen |
|
| 935 | - . '(' // 3: Unroll the loop: Inside the opening tag |
|
| 936 | - . '[^\\]\\/]*' // Not a closing bracket or forward slash |
|
| 937 | - . '(?:' |
|
| 938 | - . '\\/(?!\\])' // A forward slash not followed by a closing bracket |
|
| 939 | - . '[^\\]\\/]*' // Not a closing bracket or forward slash |
|
| 940 | - . ')*?' |
|
| 941 | - . ')' |
|
| 942 | - . '(?:' |
|
| 943 | - . '(\\/)' // 4: Self closing tag ... |
|
| 944 | - . '\\]' // ... and closing bracket |
|
| 945 | - . '|' |
|
| 946 | - . '\\]' // Closing bracket |
|
| 947 | - . '(?:' |
|
| 948 | - . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing tags |
|
| 949 | - . '[^\\[]*+' // Not an opening bracket |
|
| 950 | - . '(?:' |
|
| 951 | - . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing tag |
|
| 952 | - . '[^\\[]*+' // Not an opening bracket |
|
| 953 | - . ')*+' |
|
| 954 | - . ')' |
|
| 955 | - . '\\[\\/\\2\\]' // Closing tag |
|
| 956 | - . ')?' |
|
| 957 | - . ')' |
|
| 958 | - . '(\\]?)' // 6: Optional second closing bracket for escaping tags: [[tag]] |
|
| 959 | - . '/s'; |
|
| 931 | + . '\\[' // Opening bracket |
|
| 932 | + . '(\\[?)' // 1: Optional second opening bracket for escaping tags: [[tag]] |
|
| 933 | + . "($tagregexp)" // 2: Tag name |
|
| 934 | + . '(?![\\w-])' // Not followed by word character or hyphen |
|
| 935 | + . '(' // 3: Unroll the loop: Inside the opening tag |
|
| 936 | + . '[^\\]\\/]*' // Not a closing bracket or forward slash |
|
| 937 | + . '(?:' |
|
| 938 | + . '\\/(?!\\])' // A forward slash not followed by a closing bracket |
|
| 939 | + . '[^\\]\\/]*' // Not a closing bracket or forward slash |
|
| 940 | + . ')*?' |
|
| 941 | + . ')' |
|
| 942 | + . '(?:' |
|
| 943 | + . '(\\/)' // 4: Self closing tag ... |
|
| 944 | + . '\\]' // ... and closing bracket |
|
| 945 | + . '|' |
|
| 946 | + . '\\]' // Closing bracket |
|
| 947 | + . '(?:' |
|
| 948 | + . '(' // 5: Unroll the loop: Optionally, anything between the opening and closing tags |
|
| 949 | + . '[^\\[]*+' // Not an opening bracket |
|
| 950 | + . '(?:' |
|
| 951 | + . '\\[(?!\\/\\2\\])' // An opening bracket not followed by the closing tag |
|
| 952 | + . '[^\\[]*+' // Not an opening bracket |
|
| 953 | + . ')*+' |
|
| 954 | + . ')' |
|
| 955 | + . '\\[\\/\\2\\]' // Closing tag |
|
| 956 | + . ')?' |
|
| 957 | + . ')' |
|
| 958 | + . '(\\]?)' // 6: Optional second closing bracket for escaping tags: [[tag]] |
|
| 959 | + . '/s'; |
|
| 960 | 960 | } |
| 961 | 961 | |
| 962 | 962 | } |
@@ -108,7 +108,7 @@ |
||
| 108 | 108 | // Google query args. |
| 109 | 109 | $this->google_calendar_id = $this->esc_google_calendar_id( get_post_meta( $this->post_id, '_google_calendar_id', true ) ); |
| 110 | 110 | $this->google_events_recurring = esc_attr( get_post_meta( $this->post_id, '_google_events_recurring', true ) ); |
| 111 | - // note that google_search_query is used in a URL param and not as HTML output, so don't use esc_attr() on it |
|
| 111 | + // note that google_search_query is used in a URL param and not as HTML output, so don't use esc_attr() on it |
|
| 112 | 112 | $this->google_search_query = get_post_meta( $this->post_id, '_google_events_search_query', true ); |
| 113 | 113 | $this->google_max_results = max( absint( get_post_meta( $this->post_id, '_google_events_max_results', true ) ), 1 ); |
| 114 | 114 | |