| @@ -1,36 +1,35 @@ | ||
| 1 | 1 | <?php |
| 2 | -/** | |
| 3 | - * Shortcuts for useful functions in templates | |
| 4 | - * | |
| 5 | - * @package event-post | |
| 6 | - * @version 5.10.0 | |
| 7 | - * @since 5.0.0 | |
| 8 | - */ | |
| 9 | 2 | |
| 3 | + | |
| 10 | 4 | if(!function_exists('get_the_dates')){ |
| 11 | 5 | /** |
| 12 | 6 | * Returns the HTML string of the given event's date range. |
| 13 | 7 | * If no post reference is given, the current post will be used |
| 14 | 8 | * |
| 9 | + * @global \EventPost $EventPost | |
| 15 | 10 | * @param mixte $post |
| 16 | - * | |
| 17 | - * @global \EventPost $EventPost | |
| 18 | - * | |
| 11 | + * @uses EventPost:print_date | |
| 19 | 12 | * @return string |
| 20 | 13 | * |
| 21 | - * @example: | |
| 14 | + * example: | |
| 22 | 15 | * <pre> |
| 23 | - * <div class="event_date" data-start="april 6 2017 12am" data-end="april 6 2017 1pm"> | |
| 24 | - * <time itemprop="dtstart" datetime="2017-04-06T12:08:00+00:00"> | |
| 25 | - * <span class="date date-single">april 6 2017, 8am</span> | |
| 26 | - * <span class="linking_word linking_word-from">from</span> | |
| 27 | - * <span class="time time-start">12h am</span> | |
| 28 | - * <span class="linking_word linking_word-to">to</span> | |
| 29 | - * <span class="time time-end">1h am</span> | |
| 30 | - * </time> | |
| 31 | - * </div> | |
| 16 | + <div class="event_date" data-start="april 6 2017 12am" data-end="april 6 2017 1pm"> | |
| 17 | + <time itemprop="dtstart" datetime="2017-04-06T12:08:00+00:00"> | |
| 18 | + <span class="date date-single">april 6 2017, 8am</span> | |
| 19 | + <span class="linking_word linking_word-from">from</span> | |
| 20 | + <span class="time time-start">12h am</span> | |
| 21 | + <span class="linking_word linking_word-to">to</span> | |
| 22 | + <span class="time time-end">1h am</span> | |
| 23 | + </time> | |
| 24 | + </div> | |
| 25 | + </pre> | |
| 26 | + * | |
| 27 | + * @example | |
| 28 | + * <pre> | |
| 29 | + * <?php echo get_the_dates(); ?> | |
| 32 | 30 | * </pre> |
| 31 | + * | |
| 33 | 32 | */ |
| 34 | 33 | function get_the_dates($_post=null){ |
| 35 | 34 | global $EventPost, $post; |
| 36 | 35 | if(!$_post){ |
| @@ -41,10 +40,14 @@ | ||
| 41 | 40 | } |
| 42 | 41 | if(!function_exists('the_dates')){ |
| 43 | 42 | /** |
| 44 | 43 | * Outputs the HTML generated by `get_the_dates` |
| 45 | - * | |
| 46 | 44 | * @param mixte $post |
| 45 | + * @uses get_the_dates | |
| 46 | + * @example | |
| 47 | + * <pre> | |
| 48 | + * <?php the_dates(); ?> | |
| 49 | + * </pre> | |
| 47 | 50 | */ |
| 48 | 51 | function the_dates($post=null){ |
| 49 | 52 | echo get_the_dates($post); |
| 50 | 53 | } |
| @@ -51,14 +54,11 @@ | ||
| 51 | 54 | } |
| 52 | 55 | |
| 53 | 56 | if(!function_exists('get_the_date_start')){ |
| 54 | 57 | /** |
| 55 | - * Returns the HTML of the start date of an event | |
| 56 | 58 | * |
| 59 | + * @global \EventPost $EventPost | |
| 57 | 60 | * @param type $post |
| 58 | - * | |
| 59 | - * @global \EventPost $EventPost | |
| 60 | - * | |
| 61 | 61 | * @return string |
| 62 | 62 | */ |
| 63 | 63 | function get_the_date_start($post=null){ |
| 64 | 64 | global $EventPost; |
| @@ -67,9 +67,8 @@ | ||
| 67 | 67 | } |
| 68 | 68 | } |
| 69 | 69 | if(!function_exists('the_date_start')){ |
| 70 | 70 | /** |
| 71 | - * Outputs the HTML of the start date of an event | |
| 72 | 71 | * |
| 73 | 72 | * @param type $post |
| 74 | 73 | */ |
| 75 | 74 | function the_date_start($post=null){ |
| @@ -78,14 +77,11 @@ | ||
| 78 | 77 | } |
| 79 | 78 | |
| 80 | 79 | if(!function_exists('get_the_date_end')){ |
| 81 | 80 | /** |
| 82 | - * Returns the HTML of the end date of an event | |
| 83 | 81 | * |
| 82 | + * @global \EventPost $EventPost | |
| 84 | 83 | * @param type $post |
| 85 | - * | |
| 86 | - * @global \EventPost $EventPost | |
| 87 | - * | |
| 88 | 84 | * @return string |
| 89 | 85 | */ |
| 90 | 86 | function get_the_date_end($post=null){ |
| 91 | 87 | global $EventPost; |
| @@ -94,15 +90,9 @@ | ||
| 94 | 90 | } |
| 95 | 91 | } |
| 96 | 92 | if(!function_exists('the_date_end')){ |
| 97 | 93 | /** |
| 98 | - * Outputs the HTML of the start date of an event | |
| 99 | 94 | * |
| 100 | - * @param type $post | |
| 101 | - * | |
| 102 | - * @global \EventPost $EventPost | |
| 103 | - * | |
| 104 | - * @return string | |
| 105 | 95 | */ |
| 106 | 96 | function the_date_end($post=null){ |
| 107 | 97 | echo get_the_date_end($post); |
| 108 | 98 | } |
| @@ -109,14 +99,11 @@ | ||
| 109 | 99 | } |
| 110 | 100 | |
| 111 | 101 | if(!function_exists('get_the_location')){ |
| 112 | 102 | /** |
| 113 | - * Returns the HTML of the location date of an event | |
| 114 | 103 | * |
| 104 | + * @global \EventPost $EventPost | |
| 115 | 105 | * @param type $post |
| 116 | - * | |
| 117 | - * @global \EventPost $EventPost | |
| 118 | - * | |
| 119 | 106 | * @return string |
| 120 | 107 | */ |
| 121 | 108 | function get_the_location($post=null){ |
| 122 | 109 | global $EventPost; |
| @@ -124,9 +111,8 @@ | ||
| 124 | 111 | } |
| 125 | 112 | } |
| 126 | 113 | if(!function_exists('the_location')){ |
| 127 | 114 | /** |
| 128 | - * Outputs the HTML of the location date of an event | |
| 129 | 115 | * |
| 130 | 116 | * @param type $post |
| 131 | 117 | */ |
| 132 | 118 | function the_location($post=null){ |
| @@ -131,5 +117,5 @@ | ||
| 131 | 117 | */ |
| 132 | 118 | function the_location($post=null){ |
| 133 | 119 | echo get_the_location($post); |
| 134 | 120 | } |
| 135 | -} | |
| 121 | +} | |