Completed
Branch fix/image-uploader-button (ae85bc)
by
unknown
24:59 queued 22:40
created
public/template_tags.php 1 patch
Indentation   +1057 added lines, -1057 removed lines patch added patch discarded remove patch
@@ -19,13 +19,13 @@  discard block
 block discarded – undo
19 19
  */
20 20
 function is_espresso_event($event = null)
21 21
 {
22
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
23
-        // extract EE_Event object from passed param regardless of what it is (within reason of course)
24
-        $event = EEH_Event_View::get_event($event);
25
-        // do we have a valid event ?
26
-        return $event instanceof EE_Event;
27
-    }
28
-    return false;
22
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
23
+		// extract EE_Event object from passed param regardless of what it is (within reason of course)
24
+		$event = EEH_Event_View::get_event($event);
25
+		// do we have a valid event ?
26
+		return $event instanceof EE_Event;
27
+	}
28
+	return false;
29 29
 }
30 30
 
31 31
 /**
@@ -36,12 +36,12 @@  discard block
 block discarded – undo
36 36
  */
37 37
 function is_espresso_event_single()
38 38
 {
39
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
40
-        global $wp_query;
41
-        // return conditionals set by CPTs
42
-        return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_single : false;
43
-    }
44
-    return false;
39
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
40
+		global $wp_query;
41
+		// return conditionals set by CPTs
42
+		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_single : false;
43
+	}
44
+	return false;
45 45
 }
46 46
 
47 47
 /**
@@ -52,11 +52,11 @@  discard block
 block discarded – undo
52 52
  */
53 53
 function is_espresso_event_archive()
54 54
 {
55
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
56
-        global $wp_query;
57
-        return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_archive : false;
58
-    }
59
-    return false;
55
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
56
+		global $wp_query;
57
+		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_archive : false;
58
+	}
59
+	return false;
60 60
 }
61 61
 
62 62
 /**
@@ -67,11 +67,11 @@  discard block
 block discarded – undo
67 67
  */
68 68
 function is_espresso_event_taxonomy()
69 69
 {
70
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
71
-        global $wp_query;
72
-        return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_taxonomy : false;
73
-    }
74
-    return false;
70
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
71
+		global $wp_query;
72
+		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_event_taxonomy : false;
73
+	}
74
+	return false;
75 75
 }
76 76
 
77 77
 /**
@@ -85,13 +85,13 @@  discard block
 block discarded – undo
85 85
  */
86 86
 function is_espresso_venue($venue = null)
87 87
 {
88
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
89
-        // extract EE_Venue object from passed param regardless of what it is (within reason of course)
90
-        $venue = EEH_Venue_View::get_venue($venue, false);
91
-        // do we have a valid event ?
92
-        return $venue instanceof EE_Venue;
93
-    }
94
-    return false;
88
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
89
+		// extract EE_Venue object from passed param regardless of what it is (within reason of course)
90
+		$venue = EEH_Venue_View::get_venue($venue, false);
91
+		// do we have a valid event ?
92
+		return $venue instanceof EE_Venue;
93
+	}
94
+	return false;
95 95
 }
96 96
 
97 97
 /**
@@ -102,11 +102,11 @@  discard block
 block discarded – undo
102 102
  */
103 103
 function is_espresso_venue_single()
104 104
 {
105
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
106
-        global $wp_query;
107
-        return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_single : false;
108
-    }
109
-    return false;
105
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
106
+		global $wp_query;
107
+		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_single : false;
108
+	}
109
+	return false;
110 110
 }
111 111
 
112 112
 /**
@@ -117,11 +117,11 @@  discard block
 block discarded – undo
117 117
  */
118 118
 function is_espresso_venue_archive()
119 119
 {
120
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
121
-        global $wp_query;
122
-        return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_archive : false;
123
-    }
124
-    return false;
120
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
121
+		global $wp_query;
122
+		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_archive : false;
123
+	}
124
+	return false;
125 125
 }
126 126
 
127 127
 /**
@@ -132,11 +132,11 @@  discard block
 block discarded – undo
132 132
  */
133 133
 function is_espresso_venue_taxonomy()
134 134
 {
135
-    if (can_use_espresso_conditionals(__FUNCTION__)) {
136
-        global $wp_query;
137
-        return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_taxonomy : false;
138
-    }
139
-    return false;
135
+	if (can_use_espresso_conditionals(__FUNCTION__)) {
136
+		global $wp_query;
137
+		return $wp_query instanceof WP_Query ? $wp_query->is_espresso_venue_taxonomy : false;
138
+	}
139
+	return false;
140 140
 }
141 141
 
142 142
 /**
@@ -148,62 +148,62 @@  discard block
 block discarded – undo
148 148
  */
149 149
 function can_use_espresso_conditionals($conditional_tag)
150 150
 {
151
-    if (! did_action('AHEE__EE_System__initialize')) {
152
-        EE_Error::doing_it_wrong(
153
-            __FUNCTION__,
154
-            sprintf(
155
-                esc_html__(
156
-                    'The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.',
157
-                    'event_espresso'
158
-                ),
159
-                $conditional_tag
160
-            ),
161
-            '4.4.0'
162
-        );
163
-        return false;
164
-    }
165
-    return true;
151
+	if (! did_action('AHEE__EE_System__initialize')) {
152
+		EE_Error::doing_it_wrong(
153
+			__FUNCTION__,
154
+			sprintf(
155
+				esc_html__(
156
+					'The "%s" conditional tag can not be used until after the "init" hook has run, but works best when used within a theme\'s template files.',
157
+					'event_espresso'
158
+				),
159
+				$conditional_tag
160
+			),
161
+			'4.4.0'
162
+		);
163
+		return false;
164
+	}
165
+	return true;
166 166
 }
167 167
 
168 168
 
169 169
 /*************************** Event Queries ***************************/
170 170
 
171 171
 if (! function_exists('espresso_get_events')) {
172
-    /**
173
-     *    espresso_get_events
174
-     *
175
-     * @param array $params
176
-     * @return array
177
-     */
178
-    function espresso_get_events($params = [])
179
-    {
180
-        //set default params
181
-        $default_espresso_events_params = [
182
-            'limit'         => 10,
183
-            'show_expired'  => false,
184
-            'month'         => null,
185
-            'category_slug' => null,
186
-            'order_by'      => 'start_date',
187
-            'sort'          => 'ASC',
188
-        ];
189
-        // allow the defaults to be filtered
190
-        $default_espresso_events_params = apply_filters(
191
-            'espresso_get_events__default_espresso_events_params',
192
-            $default_espresso_events_params
193
-        );
194
-        // grab params and merge with defaults, then extract
195
-        $params = array_merge($default_espresso_events_params, $params);
196
-        // run the query
197
-        $events_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery($params);
198
-        // assign results to a variable so we can return it
199
-        $events = $events_query->have_posts() ? $events_query->posts : [];
200
-        // but first reset the query and postdata
201
-        wp_reset_query();
202
-        wp_reset_postdata();
203
-        EED_Events_Archive::remove_all_events_archive_filters();
204
-        unset($events_query);
205
-        return $events;
206
-    }
172
+	/**
173
+	 *    espresso_get_events
174
+	 *
175
+	 * @param array $params
176
+	 * @return array
177
+	 */
178
+	function espresso_get_events($params = [])
179
+	{
180
+		//set default params
181
+		$default_espresso_events_params = [
182
+			'limit'         => 10,
183
+			'show_expired'  => false,
184
+			'month'         => null,
185
+			'category_slug' => null,
186
+			'order_by'      => 'start_date',
187
+			'sort'          => 'ASC',
188
+		];
189
+		// allow the defaults to be filtered
190
+		$default_espresso_events_params = apply_filters(
191
+			'espresso_get_events__default_espresso_events_params',
192
+			$default_espresso_events_params
193
+		);
194
+		// grab params and merge with defaults, then extract
195
+		$params = array_merge($default_espresso_events_params, $params);
196
+		// run the query
197
+		$events_query = new EventEspresso\core\domain\services\wp_queries\EventListQuery($params);
198
+		// assign results to a variable so we can return it
199
+		$events = $events_query->have_posts() ? $events_query->posts : [];
200
+		// but first reset the query and postdata
201
+		wp_reset_query();
202
+		wp_reset_postdata();
203
+		EED_Events_Archive::remove_all_events_archive_filters();
204
+		unset($events_query);
205
+		return $events;
206
+	}
207 207
 }
208 208
 
209 209
 
@@ -218,357 +218,357 @@  discard block
 block discarded – undo
218 218
  */
219 219
 function espresso_load_ticket_selector()
220 220
 {
221
-    EE_Registry::instance()->load_file(EE_MODULES . 'ticket_selector', 'EED_Ticket_Selector', 'module');
221
+	EE_Registry::instance()->load_file(EE_MODULES . 'ticket_selector', 'EED_Ticket_Selector', 'module');
222 222
 }
223 223
 
224 224
 if (! function_exists('espresso_ticket_selector')) {
225
-    /**
226
-     * espresso_ticket_selector
227
-     *
228
-     * @param null $event
229
-     * @throws EE_Error
230
-     * @throws ReflectionException
231
-     */
232
-    function espresso_ticket_selector($event = null)
233
-    {
234
-        if (! apply_filters('FHEE_disable_espresso_ticket_selector', false)) {
235
-            espresso_load_ticket_selector();
236
-            EED_Ticket_Selector::set_definitions();
237
-            echo EED_Ticket_Selector::display_ticket_selector($event); // already escaped
238
-        }
239
-    }
225
+	/**
226
+	 * espresso_ticket_selector
227
+	 *
228
+	 * @param null $event
229
+	 * @throws EE_Error
230
+	 * @throws ReflectionException
231
+	 */
232
+	function espresso_ticket_selector($event = null)
233
+	{
234
+		if (! apply_filters('FHEE_disable_espresso_ticket_selector', false)) {
235
+			espresso_load_ticket_selector();
236
+			EED_Ticket_Selector::set_definitions();
237
+			echo EED_Ticket_Selector::display_ticket_selector($event); // already escaped
238
+		}
239
+	}
240 240
 }
241 241
 
242 242
 
243 243
 if (! function_exists('espresso_view_details_btn')) {
244
-    /**
245
-     * espresso_view_details_btn
246
-     *
247
-     * @param null $event
248
-     * @throws EE_Error
249
-     * @throws ReflectionException
250
-     */
251
-    function espresso_view_details_btn($event = null)
252
-    {
253
-        if (! apply_filters('FHEE_disable_espresso_view_details_btn', false)) {
254
-            espresso_load_ticket_selector();
255
-            echo EED_Ticket_Selector::display_ticket_selector($event, true); // already escaped
256
-        }
257
-    }
244
+	/**
245
+	 * espresso_view_details_btn
246
+	 *
247
+	 * @param null $event
248
+	 * @throws EE_Error
249
+	 * @throws ReflectionException
250
+	 */
251
+	function espresso_view_details_btn($event = null)
252
+	{
253
+		if (! apply_filters('FHEE_disable_espresso_view_details_btn', false)) {
254
+			espresso_load_ticket_selector();
255
+			echo EED_Ticket_Selector::display_ticket_selector($event, true); // already escaped
256
+		}
257
+	}
258 258
 }
259 259
 
260 260
 
261 261
 /*************************** EEH_Event_View ***************************/
262 262
 
263 263
 if (! function_exists('espresso_load_event_list_assets')) {
264
-    /**
265
-     * espresso_load_event_list_assets
266
-     * ensures that event list styles and scripts are loaded
267
-     *
268
-     * @return void
269
-     */
270
-    function espresso_load_event_list_assets()
271
-    {
272
-        $event_list = EED_Events_Archive::instance();
273
-        add_action('AHEE__EE_System__initialize_last', [$event_list, 'load_event_list_assets'], 10);
274
-        add_filter('FHEE_enable_default_espresso_css', '__return_true');
275
-    }
264
+	/**
265
+	 * espresso_load_event_list_assets
266
+	 * ensures that event list styles and scripts are loaded
267
+	 *
268
+	 * @return void
269
+	 */
270
+	function espresso_load_event_list_assets()
271
+	{
272
+		$event_list = EED_Events_Archive::instance();
273
+		add_action('AHEE__EE_System__initialize_last', [$event_list, 'load_event_list_assets'], 10);
274
+		add_filter('FHEE_enable_default_espresso_css', '__return_true');
275
+	}
276 276
 }
277 277
 
278 278
 
279 279
 if (! function_exists('espresso_event_reg_button')) {
280
-    /**
281
-     * espresso_event_reg_button
282
-     * returns the "Register Now" button if event is active,
283
-     * an inactive button like status banner if the event is not active
284
-     * or a "Read More" button if so desired
285
-     *
286
-     * @param null $btn_text_if_active
287
-     * @param bool $btn_text_if_inactive
288
-     * @param bool $EVT_ID
289
-     * @return void
290
-     * @throws EE_Error
291
-     * @throws ReflectionException
292
-     */
293
-    function espresso_event_reg_button($btn_text_if_active = null, $btn_text_if_inactive = false, $EVT_ID = false)
294
-    {
295
-        $event = EEH_Event_View::get_event($EVT_ID);
296
-        if (! $event instanceof EE_Event) {
297
-            return;
298
-        }
299
-        $event_status = $event->get_active_status();
300
-        switch ($event_status) {
301
-            case EE_Datetime::sold_out :
302
-                $btn_text = __('Sold Out', 'event_espresso');
303
-                $class    = 'ee-pink';
304
-                break;
305
-            case EE_Datetime::expired :
306
-                $btn_text = __('Event is Over', 'event_espresso');
307
-                $class    = 'ee-grey';
308
-                break;
309
-            case EE_Datetime::inactive :
310
-                $btn_text = __('Event Not Active', 'event_espresso');
311
-                $class    = 'ee-grey';
312
-                break;
313
-            case EE_Datetime::cancelled :
314
-                $btn_text = __('Event was Cancelled', 'event_espresso');
315
-                $class    = 'ee-red';
316
-                break;
317
-            case EE_Datetime::upcoming :
318
-            case EE_Datetime::active :
319
-            default :
320
-                $btn_text = ! empty($btn_text_if_active)
321
-                    ? $btn_text_if_active
322
-                    : __('Register Now', 'event_espresso');
323
-                $class    = 'ee-green';
324
-        }
325
-        if ($event_status < 1 && ! empty($btn_text_if_inactive)) {
326
-            $btn_text = $btn_text_if_inactive;
327
-            $class    = 'ee-grey';
328
-        }
329
-        ?>
280
+	/**
281
+	 * espresso_event_reg_button
282
+	 * returns the "Register Now" button if event is active,
283
+	 * an inactive button like status banner if the event is not active
284
+	 * or a "Read More" button if so desired
285
+	 *
286
+	 * @param null $btn_text_if_active
287
+	 * @param bool $btn_text_if_inactive
288
+	 * @param bool $EVT_ID
289
+	 * @return void
290
+	 * @throws EE_Error
291
+	 * @throws ReflectionException
292
+	 */
293
+	function espresso_event_reg_button($btn_text_if_active = null, $btn_text_if_inactive = false, $EVT_ID = false)
294
+	{
295
+		$event = EEH_Event_View::get_event($EVT_ID);
296
+		if (! $event instanceof EE_Event) {
297
+			return;
298
+		}
299
+		$event_status = $event->get_active_status();
300
+		switch ($event_status) {
301
+			case EE_Datetime::sold_out :
302
+				$btn_text = __('Sold Out', 'event_espresso');
303
+				$class    = 'ee-pink';
304
+				break;
305
+			case EE_Datetime::expired :
306
+				$btn_text = __('Event is Over', 'event_espresso');
307
+				$class    = 'ee-grey';
308
+				break;
309
+			case EE_Datetime::inactive :
310
+				$btn_text = __('Event Not Active', 'event_espresso');
311
+				$class    = 'ee-grey';
312
+				break;
313
+			case EE_Datetime::cancelled :
314
+				$btn_text = __('Event was Cancelled', 'event_espresso');
315
+				$class    = 'ee-red';
316
+				break;
317
+			case EE_Datetime::upcoming :
318
+			case EE_Datetime::active :
319
+			default :
320
+				$btn_text = ! empty($btn_text_if_active)
321
+					? $btn_text_if_active
322
+					: __('Register Now', 'event_espresso');
323
+				$class    = 'ee-green';
324
+		}
325
+		if ($event_status < 1 && ! empty($btn_text_if_inactive)) {
326
+			$btn_text = $btn_text_if_inactive;
327
+			$class    = 'ee-grey';
328
+		}
329
+		?>
330 330
         <a class="ee-button ee-register-button <?php echo esc_attr($class); ?>"
331 331
            href="<?php espresso_event_link_url($EVT_ID); ?>"
332 332
             <?php echo EED_Events_Archive::link_target(); // already escaped
333
-            ?>
333
+			?>
334 334
         >
335 335
             <?php echo esc_html($btn_text); ?>
336 336
         </a>
337 337
         <?php
338
-    }
338
+	}
339 339
 }
340 340
 
341 341
 
342 342
 if (! function_exists('espresso_display_ticket_selector')) {
343
-    /**
344
-     * espresso_display_ticket_selector
345
-     * whether or not to display the Ticket Selector for an event
346
-     *
347
-     * @param bool $EVT_ID
348
-     * @return boolean
349
-     * @throws EE_Error
350
-     * @throws ReflectionException
351
-     */
352
-    function espresso_display_ticket_selector($EVT_ID = false)
353
-    {
354
-        return EEH_Event_View::display_ticket_selector($EVT_ID);
355
-    }
343
+	/**
344
+	 * espresso_display_ticket_selector
345
+	 * whether or not to display the Ticket Selector for an event
346
+	 *
347
+	 * @param bool $EVT_ID
348
+	 * @return boolean
349
+	 * @throws EE_Error
350
+	 * @throws ReflectionException
351
+	 */
352
+	function espresso_display_ticket_selector($EVT_ID = false)
353
+	{
354
+		return EEH_Event_View::display_ticket_selector($EVT_ID);
355
+	}
356 356
 }
357 357
 
358 358
 
359 359
 if (! function_exists('espresso_event_status_banner')) {
360
-    /**
361
-     * espresso_event_status
362
-     * returns a banner showing the event status if it is sold out, expired, or inactive
363
-     *
364
-     * @param bool $EVT_ID
365
-     * @return string
366
-     * @throws EE_Error
367
-     * @throws ReflectionException
368
-     */
369
-    function espresso_event_status_banner($EVT_ID = false)
370
-    {
371
-        return EEH_Event_View::event_status($EVT_ID);
372
-    }
360
+	/**
361
+	 * espresso_event_status
362
+	 * returns a banner showing the event status if it is sold out, expired, or inactive
363
+	 *
364
+	 * @param bool $EVT_ID
365
+	 * @return string
366
+	 * @throws EE_Error
367
+	 * @throws ReflectionException
368
+	 */
369
+	function espresso_event_status_banner($EVT_ID = false)
370
+	{
371
+		return EEH_Event_View::event_status($EVT_ID);
372
+	}
373 373
 }
374 374
 
375 375
 
376 376
 if (! function_exists('espresso_event_status')) {
377
-    /**
378
-     * espresso_event_status
379
-     * returns the event status if it is sold out, expired, or inactive
380
-     *
381
-     * @param int  $EVT_ID
382
-     * @param bool $echo
383
-     * @return string
384
-     * @throws EE_Error
385
-     * @throws ReflectionException
386
-     */
387
-    function espresso_event_status($EVT_ID = 0, $echo = true)
388
-    {
389
-        return EEH_Event_View::event_active_status($EVT_ID, $echo);
390
-    }
377
+	/**
378
+	 * espresso_event_status
379
+	 * returns the event status if it is sold out, expired, or inactive
380
+	 *
381
+	 * @param int  $EVT_ID
382
+	 * @param bool $echo
383
+	 * @return string
384
+	 * @throws EE_Error
385
+	 * @throws ReflectionException
386
+	 */
387
+	function espresso_event_status($EVT_ID = 0, $echo = true)
388
+	{
389
+		return EEH_Event_View::event_active_status($EVT_ID, $echo);
390
+	}
391 391
 }
392 392
 
393 393
 
394 394
 if (! function_exists('espresso_event_categories')) {
395
-    /**
396
-     * espresso_event_categories
397
-     * returns the terms associated with an event
398
-     *
399
-     * @param int  $EVT_ID
400
-     * @param bool $hide_uncategorized
401
-     * @param bool $echo
402
-     * @return string
403
-     * @throws EE_Error
404
-     * @throws ReflectionException
405
-     */
406
-    function espresso_event_categories($EVT_ID = 0, $hide_uncategorized = true, $echo = true)
407
-    {
408
-        if ($echo) {
409
-            echo EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); // already escaped
410
-            return '';
411
-        }
412
-        return EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized);
413
-    }
395
+	/**
396
+	 * espresso_event_categories
397
+	 * returns the terms associated with an event
398
+	 *
399
+	 * @param int  $EVT_ID
400
+	 * @param bool $hide_uncategorized
401
+	 * @param bool $echo
402
+	 * @return string
403
+	 * @throws EE_Error
404
+	 * @throws ReflectionException
405
+	 */
406
+	function espresso_event_categories($EVT_ID = 0, $hide_uncategorized = true, $echo = true)
407
+	{
408
+		if ($echo) {
409
+			echo EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized); // already escaped
410
+			return '';
411
+		}
412
+		return EEH_Event_View::event_categories($EVT_ID, $hide_uncategorized);
413
+	}
414 414
 }
415 415
 
416 416
 
417 417
 if (! function_exists('espresso_event_tickets_available')) {
418
-    /**
419
-     * espresso_event_tickets_available
420
-     * returns the ticket types available for purchase for an event
421
-     *
422
-     * @param int  $EVT_ID
423
-     * @param bool $echo
424
-     * @param bool $format
425
-     * @return string
426
-     * @throws EE_Error
427
-     * @throws ReflectionException
428
-     */
429
-    function espresso_event_tickets_available($EVT_ID = 0, $echo = true, $format = true)
430
-    {
431
-        $tickets = EEH_Event_View::event_tickets_available($EVT_ID);
432
-        if (is_array($tickets) && ! empty($tickets)) {
433
-            // if formatting then $html will be a string, else it will be an array of ticket objects
434
-            $html =
435
-                $format ? '<ul id="ee-event-tickets-ul-' . esc_attr($EVT_ID) . '" class="ee-event-tickets-ul">' : [];
436
-            foreach ($tickets as $ticket) {
437
-                if ($ticket instanceof EE_Ticket) {
438
-                    if ($format) {
439
-                        $html .= '<li id="ee-event-tickets-li-'
440
-                                 . esc_attr($ticket->ID())
441
-                                 . '" class="ee-event-tickets-li">';
442
-                        $html .= esc_html($ticket->name()) . ' ';
443
-                        $html .= EEH_Template::format_currency(
444
-                            $ticket->get_ticket_total_with_taxes()
445
-                        ); // already escaped
446
-                        $html .= '</li>';
447
-                    } else {
448
-                        $html[] = $ticket;
449
-                    }
450
-                }
451
-            }
452
-            if ($format) {
453
-                $html .= '</ul>';
454
-            }
455
-            if ($echo && $format) {
456
-                echo wp_kses($html, AllowedTags::getAllowedTags());
457
-                return '';
458
-            }
459
-            return $html;
460
-        }
461
-        return '';
462
-    }
418
+	/**
419
+	 * espresso_event_tickets_available
420
+	 * returns the ticket types available for purchase for an event
421
+	 *
422
+	 * @param int  $EVT_ID
423
+	 * @param bool $echo
424
+	 * @param bool $format
425
+	 * @return string
426
+	 * @throws EE_Error
427
+	 * @throws ReflectionException
428
+	 */
429
+	function espresso_event_tickets_available($EVT_ID = 0, $echo = true, $format = true)
430
+	{
431
+		$tickets = EEH_Event_View::event_tickets_available($EVT_ID);
432
+		if (is_array($tickets) && ! empty($tickets)) {
433
+			// if formatting then $html will be a string, else it will be an array of ticket objects
434
+			$html =
435
+				$format ? '<ul id="ee-event-tickets-ul-' . esc_attr($EVT_ID) . '" class="ee-event-tickets-ul">' : [];
436
+			foreach ($tickets as $ticket) {
437
+				if ($ticket instanceof EE_Ticket) {
438
+					if ($format) {
439
+						$html .= '<li id="ee-event-tickets-li-'
440
+								 . esc_attr($ticket->ID())
441
+								 . '" class="ee-event-tickets-li">';
442
+						$html .= esc_html($ticket->name()) . ' ';
443
+						$html .= EEH_Template::format_currency(
444
+							$ticket->get_ticket_total_with_taxes()
445
+						); // already escaped
446
+						$html .= '</li>';
447
+					} else {
448
+						$html[] = $ticket;
449
+					}
450
+				}
451
+			}
452
+			if ($format) {
453
+				$html .= '</ul>';
454
+			}
455
+			if ($echo && $format) {
456
+				echo wp_kses($html, AllowedTags::getAllowedTags());
457
+				return '';
458
+			}
459
+			return $html;
460
+		}
461
+		return '';
462
+	}
463 463
 }
464 464
 
465 465
 if (! function_exists('espresso_event_date_obj')) {
466
-    /**
467
-     * espresso_event_date_obj
468
-     * returns the primary date object for an event
469
-     *
470
-     * @param bool $EVT_ID
471
-     * @return EE_Datetime|null
472
-     * @throws EE_Error
473
-     * @throws ReflectionException
474
-     */
475
-    function espresso_event_date_obj($EVT_ID = false)
476
-    {
477
-        return EEH_Event_View::get_primary_date_obj($EVT_ID);
478
-    }
466
+	/**
467
+	 * espresso_event_date_obj
468
+	 * returns the primary date object for an event
469
+	 *
470
+	 * @param bool $EVT_ID
471
+	 * @return EE_Datetime|null
472
+	 * @throws EE_Error
473
+	 * @throws ReflectionException
474
+	 */
475
+	function espresso_event_date_obj($EVT_ID = false)
476
+	{
477
+		return EEH_Event_View::get_primary_date_obj($EVT_ID);
478
+	}
479 479
 }
480 480
 
481 481
 
482 482
 if (! function_exists('espresso_event_date')) {
483
-    /**
484
-     * espresso_event_date
485
-     * returns the primary date for an event
486
-     *
487
-     * @param string $date_format
488
-     * @param string $time_format
489
-     * @param bool   $EVT_ID
490
-     * @param bool   $echo
491
-     * @return string
492
-     * @throws EE_Error
493
-     * @throws ReflectionException
494
-     */
495
-    function espresso_event_date($date_format = '', $time_format = '', $EVT_ID = false, $echo = true)
496
-    {
497
-        $date_format = ! empty($date_format) ? $date_format : get_option('date_format');
498
-        $time_format = ! empty($time_format) ? $time_format : get_option('time_format');
499
-        $date_format = apply_filters('FHEE__espresso_event_date__date_format', $date_format);
500
-        $time_format = apply_filters('FHEE__espresso_event_date__time_format', $time_format);
501
-        if ($echo) {
502
-            echo EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); // already escaped
503
-            return '';
504
-        }
505
-        return EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID);
506
-
507
-    }
483
+	/**
484
+	 * espresso_event_date
485
+	 * returns the primary date for an event
486
+	 *
487
+	 * @param string $date_format
488
+	 * @param string $time_format
489
+	 * @param bool   $EVT_ID
490
+	 * @param bool   $echo
491
+	 * @return string
492
+	 * @throws EE_Error
493
+	 * @throws ReflectionException
494
+	 */
495
+	function espresso_event_date($date_format = '', $time_format = '', $EVT_ID = false, $echo = true)
496
+	{
497
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
498
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
499
+		$date_format = apply_filters('FHEE__espresso_event_date__date_format', $date_format);
500
+		$time_format = apply_filters('FHEE__espresso_event_date__time_format', $time_format);
501
+		if ($echo) {
502
+			echo EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID); // already escaped
503
+			return '';
504
+		}
505
+		return EEH_Event_View::the_event_date($date_format, $time_format, $EVT_ID);
506
+
507
+	}
508 508
 }
509 509
 
510 510
 
511 511
 if (! function_exists('espresso_list_of_event_dates')) {
512
-    /**
513
-     * espresso_list_of_event_dates
514
-     * returns a unordered list of dates for an event
515
-     *
516
-     * @param int    $EVT_ID
517
-     * @param string $date_format
518
-     * @param string $time_format
519
-     * @param bool   $echo
520
-     * @param null   $show_expired
521
-     * @param bool   $format
522
-     * @param bool   $add_breaks
523
-     * @param null   $limit
524
-     * @return string
525
-     * @throws EE_Error
526
-     * @throws ReflectionException
527
-     */
528
-    function espresso_list_of_event_dates(
529
-        $EVT_ID = 0,
530
-        $date_format = '',
531
-        $time_format = '',
532
-        $echo = true,
533
-        $show_expired = null,
534
-        $format = true,
535
-        $add_breaks = true,
536
-        $limit = null
537
-    ) {
538
-        $allowedtags = AllowedTags::getAllowedTags();
539
-        $date_format = ! empty($date_format) ? $date_format : get_option('date_format');
540
-        $time_format = ! empty($time_format) ? $time_format : get_option('time_format');
541
-        $date_format = apply_filters('FHEE__espresso_list_of_event_dates__date_format', $date_format);
542
-        $time_format = apply_filters('FHEE__espresso_list_of_event_dates__time_format', $time_format);
543
-        $datetimes   = EEH_Event_View::get_all_date_obj($EVT_ID, $show_expired, false, $limit);
544
-        if (! $format) {
545
-            return apply_filters('FHEE__espresso_list_of_event_dates__datetimes', $datetimes);
546
-        }
547
-        $newline = $add_breaks ? '<br />' : '';
548
-        if (is_array($datetimes) && ! empty($datetimes)) {
549
-            global $post;
550
-            $html =
551
-                '<ul id="ee-event-datetimes-ul-' . esc_attr($post->ID) . '" class="ee-event-datetimes-ul ee-clearfix">';
552
-            foreach ($datetimes as $datetime) {
553
-                if ($datetime instanceof EE_Datetime) {
554
-
555
-                    $datetime_name        = $datetime->name();
556
-                    $datetime_html        = ! empty($datetime_name)
557
-                        ? '
512
+	/**
513
+	 * espresso_list_of_event_dates
514
+	 * returns a unordered list of dates for an event
515
+	 *
516
+	 * @param int    $EVT_ID
517
+	 * @param string $date_format
518
+	 * @param string $time_format
519
+	 * @param bool   $echo
520
+	 * @param null   $show_expired
521
+	 * @param bool   $format
522
+	 * @param bool   $add_breaks
523
+	 * @param null   $limit
524
+	 * @return string
525
+	 * @throws EE_Error
526
+	 * @throws ReflectionException
527
+	 */
528
+	function espresso_list_of_event_dates(
529
+		$EVT_ID = 0,
530
+		$date_format = '',
531
+		$time_format = '',
532
+		$echo = true,
533
+		$show_expired = null,
534
+		$format = true,
535
+		$add_breaks = true,
536
+		$limit = null
537
+	) {
538
+		$allowedtags = AllowedTags::getAllowedTags();
539
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
540
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
541
+		$date_format = apply_filters('FHEE__espresso_list_of_event_dates__date_format', $date_format);
542
+		$time_format = apply_filters('FHEE__espresso_list_of_event_dates__time_format', $time_format);
543
+		$datetimes   = EEH_Event_View::get_all_date_obj($EVT_ID, $show_expired, false, $limit);
544
+		if (! $format) {
545
+			return apply_filters('FHEE__espresso_list_of_event_dates__datetimes', $datetimes);
546
+		}
547
+		$newline = $add_breaks ? '<br />' : '';
548
+		if (is_array($datetimes) && ! empty($datetimes)) {
549
+			global $post;
550
+			$html =
551
+				'<ul id="ee-event-datetimes-ul-' . esc_attr($post->ID) . '" class="ee-event-datetimes-ul ee-clearfix">';
552
+			foreach ($datetimes as $datetime) {
553
+				if ($datetime instanceof EE_Datetime) {
554
+
555
+					$datetime_name        = $datetime->name();
556
+					$datetime_html        = ! empty($datetime_name)
557
+						? '
558 558
                         <strong class="ee-event-datetimes-li-date-name">
559 559
                           ' . esc_html($datetime_name) . '
560 560
                        </strong>' . $newline
561
-                        : '';
561
+						: '';
562 562
 
563
-                    $datetime_description = $datetime->description();
564
-                    $datetime_html .= ! empty($datetime_description)
565
-                        ? '
563
+					$datetime_description = $datetime->description();
564
+					$datetime_html .= ! empty($datetime_description)
565
+						? '
566 566
                         <span class="ee-event-datetimes-li-date-desc">
567 567
                             ' . wp_kses($datetime_description, $allowedtags) . '
568 568
                         </span>' . $newline
569
-                        : '';
569
+						: '';
570 570
 
571
-                    $datetime_html .= '
571
+					$datetime_html .= '
572 572
                         <span class="dashicons dashicons-calendar"></span>
573 573
                         <span class="ee-event-datetimes-li-daterange">' . $datetime->date_range($date_format) . '</span>
574 574
                         <br/>
@@ -576,482 +576,482 @@  discard block
 block discarded – undo
576 576
                         <span class="ee-event-datetimes-li-timerange">' . $datetime->time_range($time_format) . '</span>
577 577
                         ';
578 578
 
579
-                    $datetime_html = apply_filters(
580
-                        'FHEE__espresso_list_of_event_dates__datetime_html',
581
-                        $datetime_html,
582
-                        $datetime
583
-                    );
579
+					$datetime_html = apply_filters(
580
+						'FHEE__espresso_list_of_event_dates__datetime_html',
581
+						$datetime_html,
582
+						$datetime
583
+					);
584 584
 
585
-                    $DTD_ID        = esc_attr($datetime->ID());
586
-                    $active_status = esc_attr(' ee-event-datetimes-li-' . $datetime->get_active_status());
585
+					$DTD_ID        = esc_attr($datetime->ID());
586
+					$active_status = esc_attr(' ee-event-datetimes-li-' . $datetime->get_active_status());
587 587
 
588
-                    $html .= '
588
+					$html .= '
589 589
                     <li id="ee-event-datetimes-li-' . $DTD_ID . '" class="ee-event-datetimes-li' . $active_status . '">
590 590
                         ' . $datetime_html . '
591 591
                     </li>';
592
-                }
593
-            }
594
-            $html .= '</ul>';
595
-        } else {
596
-            $html =
597
-                '
592
+				}
593
+			}
594
+			$html .= '</ul>';
595
+		} else {
596
+			$html =
597
+				'
598 598
             <p>
599 599
                 <span class="dashicons dashicons-marker pink-text"></span>
600 600
                 ' . esc_html__(
601
-                    'There are no upcoming dates for this event.',
602
-                    'event_espresso'
603
-                ) . '
601
+					'There are no upcoming dates for this event.',
602
+					'event_espresso'
603
+				) . '
604 604
             </p>
605 605
             <br/>';
606
-        }
607
-        if ($echo) {
608
-            echo wp_kses($html, AllowedTags::getWithFormTags());
609
-            return '';
610
-        }
611
-        return $html;
612
-    }
606
+		}
607
+		if ($echo) {
608
+			echo wp_kses($html, AllowedTags::getWithFormTags());
609
+			return '';
610
+		}
611
+		return $html;
612
+	}
613 613
 }
614 614
 
615 615
 
616 616
 if (! function_exists('espresso_event_end_date')) {
617
-    /**
618
-     * espresso_event_end_date
619
-     * returns the last date for an event
620
-     *
621
-     * @param string $date_format
622
-     * @param string $time_format
623
-     * @param bool   $EVT_ID
624
-     * @param bool   $echo
625
-     * @return string
626
-     * @throws EE_Error
627
-     * @throws ReflectionException
628
-     */
629
-    function espresso_event_end_date($date_format = '', $time_format = '', $EVT_ID = false, $echo = true)
630
-    {
631
-        $date_format = ! empty($date_format) ? $date_format : get_option('date_format');
632
-        $time_format = ! empty($time_format) ? $time_format : get_option('time_format');
633
-        $date_format = apply_filters('FHEE__espresso_event_end_date__date_format', $date_format);
634
-        $time_format = apply_filters('FHEE__espresso_event_end_date__time_format', $time_format);
635
-        if ($echo) {
636
-            echo EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); // already escaped
637
-            return '';
638
-        }
639
-        return EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID);
640
-    }
617
+	/**
618
+	 * espresso_event_end_date
619
+	 * returns the last date for an event
620
+	 *
621
+	 * @param string $date_format
622
+	 * @param string $time_format
623
+	 * @param bool   $EVT_ID
624
+	 * @param bool   $echo
625
+	 * @return string
626
+	 * @throws EE_Error
627
+	 * @throws ReflectionException
628
+	 */
629
+	function espresso_event_end_date($date_format = '', $time_format = '', $EVT_ID = false, $echo = true)
630
+	{
631
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
632
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
633
+		$date_format = apply_filters('FHEE__espresso_event_end_date__date_format', $date_format);
634
+		$time_format = apply_filters('FHEE__espresso_event_end_date__time_format', $time_format);
635
+		if ($echo) {
636
+			echo EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID); // already escaped
637
+			return '';
638
+		}
639
+		return EEH_Event_View::the_event_end_date($date_format, $time_format, $EVT_ID);
640
+	}
641 641
 }
642 642
 
643 643
 if (! function_exists('espresso_event_date_range')) {
644
-    /**
645
-     * espresso_event_date_range
646
-     * returns the first and last chronologically ordered dates for an event (if different)
647
-     *
648
-     * @param string $date_format
649
-     * @param string $time_format
650
-     * @param string $single_date_format
651
-     * @param string $single_time_format
652
-     * @param bool   $EVT_ID
653
-     * @param bool   $echo
654
-     * @return string
655
-     * @throws EE_Error
656
-     * @throws ReflectionException
657
-     */
658
-    function espresso_event_date_range(
659
-        $date_format = '',
660
-        $time_format = '',
661
-        $single_date_format = '',
662
-        $single_time_format = '',
663
-        $EVT_ID = false,
664
-        $echo = true
665
-    ) {
666
-        // set and filter date and time formats when a range is returned
667
-        $date_format = ! empty($date_format) ? $date_format : get_option('date_format');
668
-        $date_format = apply_filters('FHEE__espresso_event_date_range__date_format', $date_format);
669
-        // get the start and end date with NO time portion
670
-        $the_event_date     = EEH_Event_View::the_earliest_event_date($date_format, '', $EVT_ID);
671
-        $the_event_end_date = EEH_Event_View::the_latest_event_date($date_format, '', $EVT_ID);
672
-        // now we can determine if date range spans more than one day
673
-        if ($the_event_date != $the_event_end_date) {
674
-            $time_format = ! empty($time_format) ? $time_format : get_option('time_format');
675
-            $time_format = apply_filters('FHEE__espresso_event_date_range__time_format', $time_format);
676
-            $html        = sprintf(
677
-            /* translators: 1: first event date, 2: last event date */
678
-                esc_html__('%1$s - %2$s', 'event_espresso'),
679
-                EEH_Event_View::the_earliest_event_date($date_format, $time_format, $EVT_ID),
680
-                EEH_Event_View::the_latest_event_date($date_format, $time_format, $EVT_ID)
681
-            );
682
-        } else {
683
-            // set and filter date and time formats when only a single datetime is returned
684
-            $single_date_format = ! empty($single_date_format) ? $single_date_format : get_option('date_format');
685
-            $single_time_format = ! empty($single_time_format) ? $single_time_format : get_option('time_format');
686
-            $single_date_format =
687
-                apply_filters('FHEE__espresso_event_date_range__single_date_format', $single_date_format);
688
-            $single_time_format =
689
-                apply_filters('FHEE__espresso_event_date_range__single_time_format', $single_time_format);
690
-            $html               =
691
-                EEH_Event_View::the_earliest_event_date($single_date_format, $single_time_format, $EVT_ID);
692
-        }
693
-        if ($echo) {
694
-            echo wp_kses($html, AllowedTags::getAllowedTags());
695
-            return '';
696
-        }
697
-        return $html;
698
-    }
644
+	/**
645
+	 * espresso_event_date_range
646
+	 * returns the first and last chronologically ordered dates for an event (if different)
647
+	 *
648
+	 * @param string $date_format
649
+	 * @param string $time_format
650
+	 * @param string $single_date_format
651
+	 * @param string $single_time_format
652
+	 * @param bool   $EVT_ID
653
+	 * @param bool   $echo
654
+	 * @return string
655
+	 * @throws EE_Error
656
+	 * @throws ReflectionException
657
+	 */
658
+	function espresso_event_date_range(
659
+		$date_format = '',
660
+		$time_format = '',
661
+		$single_date_format = '',
662
+		$single_time_format = '',
663
+		$EVT_ID = false,
664
+		$echo = true
665
+	) {
666
+		// set and filter date and time formats when a range is returned
667
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
668
+		$date_format = apply_filters('FHEE__espresso_event_date_range__date_format', $date_format);
669
+		// get the start and end date with NO time portion
670
+		$the_event_date     = EEH_Event_View::the_earliest_event_date($date_format, '', $EVT_ID);
671
+		$the_event_end_date = EEH_Event_View::the_latest_event_date($date_format, '', $EVT_ID);
672
+		// now we can determine if date range spans more than one day
673
+		if ($the_event_date != $the_event_end_date) {
674
+			$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
675
+			$time_format = apply_filters('FHEE__espresso_event_date_range__time_format', $time_format);
676
+			$html        = sprintf(
677
+			/* translators: 1: first event date, 2: last event date */
678
+				esc_html__('%1$s - %2$s', 'event_espresso'),
679
+				EEH_Event_View::the_earliest_event_date($date_format, $time_format, $EVT_ID),
680
+				EEH_Event_View::the_latest_event_date($date_format, $time_format, $EVT_ID)
681
+			);
682
+		} else {
683
+			// set and filter date and time formats when only a single datetime is returned
684
+			$single_date_format = ! empty($single_date_format) ? $single_date_format : get_option('date_format');
685
+			$single_time_format = ! empty($single_time_format) ? $single_time_format : get_option('time_format');
686
+			$single_date_format =
687
+				apply_filters('FHEE__espresso_event_date_range__single_date_format', $single_date_format);
688
+			$single_time_format =
689
+				apply_filters('FHEE__espresso_event_date_range__single_time_format', $single_time_format);
690
+			$html               =
691
+				EEH_Event_View::the_earliest_event_date($single_date_format, $single_time_format, $EVT_ID);
692
+		}
693
+		if ($echo) {
694
+			echo wp_kses($html, AllowedTags::getAllowedTags());
695
+			return '';
696
+		}
697
+		return $html;
698
+	}
699 699
 }
700 700
 
701 701
 if (! function_exists('espresso_next_upcoming_datetime_obj')) {
702
-    /**
703
-     * espresso_next_upcoming_datetime_obj
704
-     * returns the next upcoming datetime object for an event
705
-     *
706
-     * @param int $EVT_ID
707
-     * @return EE_Datetime|null
708
-     * @throws EE_Error
709
-     */
710
-    function espresso_next_upcoming_datetime_obj($EVT_ID = 0)
711
-    {
712
-        return EEH_Event_View::get_next_upcoming_date_obj($EVT_ID);
713
-    }
702
+	/**
703
+	 * espresso_next_upcoming_datetime_obj
704
+	 * returns the next upcoming datetime object for an event
705
+	 *
706
+	 * @param int $EVT_ID
707
+	 * @return EE_Datetime|null
708
+	 * @throws EE_Error
709
+	 */
710
+	function espresso_next_upcoming_datetime_obj($EVT_ID = 0)
711
+	{
712
+		return EEH_Event_View::get_next_upcoming_date_obj($EVT_ID);
713
+	}
714 714
 }
715 715
 
716 716
 if (! function_exists('espresso_next_upcoming_datetime')) {
717
-    /**
718
-     * espresso_next_upcoming_datetime
719
-     * returns the start date and time for the next upcoming event.
720
-     *
721
-     * @param string $date_format
722
-     * @param string $time_format
723
-     * @param int    $EVT_ID
724
-     * @param bool   $echo
725
-     * @return string
726
-     * @throws EE_Error
727
-     * @throws ReflectionException
728
-     */
729
-    function espresso_next_upcoming_datetime($date_format = '', $time_format = '', $EVT_ID = 0, $echo = true)
730
-    {
731
-
732
-        $date_format = ! empty($date_format) ? $date_format : get_option('date_format');
733
-        $date_format = apply_filters('FHEE__espresso_next_upcoming_datetime__date_format', $date_format);
734
-
735
-        $time_format = ! empty($time_format) ? $time_format : get_option('time_format');
736
-        $time_format = apply_filters('FHEE__espresso_next_upcoming_datetime__time_format', $time_format);
737
-
738
-        $datetime_format = trim($date_format . ' ' . $time_format);
739
-
740
-        $datetime = espresso_next_upcoming_datetime_obj($EVT_ID);
741
-
742
-        if (! $datetime instanceof EE_Datetime) {
743
-            return '';
744
-        }
745
-        if ($echo) {
746
-            echo esc_html($datetime->get_i18n_datetime('DTT_EVT_start', $datetime_format));
747
-            return '';
748
-        }
749
-        return $datetime->get_i18n_datetime('DTT_EVT_start', $datetime_format);
750
-    }
717
+	/**
718
+	 * espresso_next_upcoming_datetime
719
+	 * returns the start date and time for the next upcoming event.
720
+	 *
721
+	 * @param string $date_format
722
+	 * @param string $time_format
723
+	 * @param int    $EVT_ID
724
+	 * @param bool   $echo
725
+	 * @return string
726
+	 * @throws EE_Error
727
+	 * @throws ReflectionException
728
+	 */
729
+	function espresso_next_upcoming_datetime($date_format = '', $time_format = '', $EVT_ID = 0, $echo = true)
730
+	{
731
+
732
+		$date_format = ! empty($date_format) ? $date_format : get_option('date_format');
733
+		$date_format = apply_filters('FHEE__espresso_next_upcoming_datetime__date_format', $date_format);
734
+
735
+		$time_format = ! empty($time_format) ? $time_format : get_option('time_format');
736
+		$time_format = apply_filters('FHEE__espresso_next_upcoming_datetime__time_format', $time_format);
737
+
738
+		$datetime_format = trim($date_format . ' ' . $time_format);
739
+
740
+		$datetime = espresso_next_upcoming_datetime_obj($EVT_ID);
741
+
742
+		if (! $datetime instanceof EE_Datetime) {
743
+			return '';
744
+		}
745
+		if ($echo) {
746
+			echo esc_html($datetime->get_i18n_datetime('DTT_EVT_start', $datetime_format));
747
+			return '';
748
+		}
749
+		return $datetime->get_i18n_datetime('DTT_EVT_start', $datetime_format);
750
+	}
751 751
 }
752 752
 
753 753
 if (! function_exists('espresso_event_date_as_calendar_page')) {
754
-    /**
755
-     * espresso_event_date_as_calendar_page
756
-     * returns the primary date for an event, stylized to appear as the page of a calendar
757
-     *
758
-     * @param bool $EVT_ID
759
-     * @return void
760
-     * @throws EE_Error
761
-     * @throws ReflectionException
762
-     */
763
-    function espresso_event_date_as_calendar_page($EVT_ID = false)
764
-    {
765
-        EEH_Event_View::event_date_as_calendar_page($EVT_ID);
766
-    }
754
+	/**
755
+	 * espresso_event_date_as_calendar_page
756
+	 * returns the primary date for an event, stylized to appear as the page of a calendar
757
+	 *
758
+	 * @param bool $EVT_ID
759
+	 * @return void
760
+	 * @throws EE_Error
761
+	 * @throws ReflectionException
762
+	 */
763
+	function espresso_event_date_as_calendar_page($EVT_ID = false)
764
+	{
765
+		EEH_Event_View::event_date_as_calendar_page($EVT_ID);
766
+	}
767 767
 }
768 768
 
769 769
 
770 770
 if (! function_exists('espresso_event_link_url')) {
771
-    /**
772
-     * espresso_event_link_url
773
-     *
774
-     * @param int  $EVT_ID
775
-     * @param bool $echo
776
-     * @return string
777
-     * @throws EE_Error
778
-     * @throws ReflectionException
779
-     */
780
-    function espresso_event_link_url($EVT_ID = 0, $echo = true)
781
-    {
782
-        if ($echo) {
783
-            echo EEH_Event_View::event_link_url($EVT_ID); // already escaped
784
-            return '';
785
-        }
786
-        return EEH_Event_View::event_link_url($EVT_ID);
787
-    }
771
+	/**
772
+	 * espresso_event_link_url
773
+	 *
774
+	 * @param int  $EVT_ID
775
+	 * @param bool $echo
776
+	 * @return string
777
+	 * @throws EE_Error
778
+	 * @throws ReflectionException
779
+	 */
780
+	function espresso_event_link_url($EVT_ID = 0, $echo = true)
781
+	{
782
+		if ($echo) {
783
+			echo EEH_Event_View::event_link_url($EVT_ID); // already escaped
784
+			return '';
785
+		}
786
+		return EEH_Event_View::event_link_url($EVT_ID);
787
+	}
788 788
 }
789 789
 
790 790
 
791 791
 if (! function_exists('espresso_event_has_content_or_excerpt')) {
792
-    /**
793
-     *    espresso_event_has_content_or_excerpt
794
-     *
795
-     * @access    public
796
-     * @param bool $EVT_ID
797
-     * @return    boolean
798
-     * @throws EE_Error
799
-     * @throws ReflectionException
800
-     */
801
-    function espresso_event_has_content_or_excerpt($EVT_ID = false)
802
-    {
803
-        return EEH_Event_View::event_has_content_or_excerpt($EVT_ID);
804
-    }
792
+	/**
793
+	 *    espresso_event_has_content_or_excerpt
794
+	 *
795
+	 * @access    public
796
+	 * @param bool $EVT_ID
797
+	 * @return    boolean
798
+	 * @throws EE_Error
799
+	 * @throws ReflectionException
800
+	 */
801
+	function espresso_event_has_content_or_excerpt($EVT_ID = false)
802
+	{
803
+		return EEH_Event_View::event_has_content_or_excerpt($EVT_ID);
804
+	}
805 805
 }
806 806
 
807 807
 
808 808
 if (! function_exists('espresso_event_content_or_excerpt')) {
809
-    /**
810
-     * espresso_event_content_or_excerpt
811
-     *
812
-     * @param int  $num_words
813
-     * @param null $more
814
-     * @param bool $echo
815
-     * @return string
816
-     */
817
-    function espresso_event_content_or_excerpt($num_words = 55, $more = null, $echo = true)
818
-    {
819
-        if ($echo) {
820
-            echo EEH_Event_View::event_content_or_excerpt($num_words, $more); // already escaped
821
-            return '';
822
-        }
823
-        return EEH_Event_View::event_content_or_excerpt($num_words, $more);
824
-    }
809
+	/**
810
+	 * espresso_event_content_or_excerpt
811
+	 *
812
+	 * @param int  $num_words
813
+	 * @param null $more
814
+	 * @param bool $echo
815
+	 * @return string
816
+	 */
817
+	function espresso_event_content_or_excerpt($num_words = 55, $more = null, $echo = true)
818
+	{
819
+		if ($echo) {
820
+			echo EEH_Event_View::event_content_or_excerpt($num_words, $more); // already escaped
821
+			return '';
822
+		}
823
+		return EEH_Event_View::event_content_or_excerpt($num_words, $more);
824
+	}
825 825
 }
826 826
 
827 827
 
828 828
 if (! function_exists('espresso_event_phone')) {
829
-    /**
830
-     * espresso_event_phone
831
-     *
832
-     * @param int  $EVT_ID
833
-     * @param bool $echo
834
-     * @return string
835
-     * @throws EE_Error
836
-     * @throws ReflectionException
837
-     */
838
-    function espresso_event_phone($EVT_ID = 0, $echo = true)
839
-    {
840
-        if ($echo) {
841
-            echo EEH_Event_View::event_phone($EVT_ID); // already escaped
842
-            return '';
843
-        }
844
-        return EEH_Event_View::event_phone($EVT_ID);
845
-    }
829
+	/**
830
+	 * espresso_event_phone
831
+	 *
832
+	 * @param int  $EVT_ID
833
+	 * @param bool $echo
834
+	 * @return string
835
+	 * @throws EE_Error
836
+	 * @throws ReflectionException
837
+	 */
838
+	function espresso_event_phone($EVT_ID = 0, $echo = true)
839
+	{
840
+		if ($echo) {
841
+			echo EEH_Event_View::event_phone($EVT_ID); // already escaped
842
+			return '';
843
+		}
844
+		return EEH_Event_View::event_phone($EVT_ID);
845
+	}
846 846
 }
847 847
 
848 848
 
849 849
 if (! function_exists('espresso_edit_event_link')) {
850
-    /**
851
-     * espresso_edit_event_link
852
-     * returns a link to edit an event
853
-     *
854
-     * @param int  $EVT_ID
855
-     * @param bool $echo
856
-     * @return string
857
-     * @throws EE_Error
858
-     * @throws ReflectionException
859
-     */
860
-    function espresso_edit_event_link($EVT_ID = 0, $echo = true)
861
-    {
862
-        if ($echo) {
863
-            echo EEH_Event_View::edit_event_link($EVT_ID); // already escaped
864
-            return '';
865
-        }
866
-        return EEH_Event_View::edit_event_link($EVT_ID);
867
-    }
850
+	/**
851
+	 * espresso_edit_event_link
852
+	 * returns a link to edit an event
853
+	 *
854
+	 * @param int  $EVT_ID
855
+	 * @param bool $echo
856
+	 * @return string
857
+	 * @throws EE_Error
858
+	 * @throws ReflectionException
859
+	 */
860
+	function espresso_edit_event_link($EVT_ID = 0, $echo = true)
861
+	{
862
+		if ($echo) {
863
+			echo EEH_Event_View::edit_event_link($EVT_ID); // already escaped
864
+			return '';
865
+		}
866
+		return EEH_Event_View::edit_event_link($EVT_ID);
867
+	}
868 868
 }
869 869
 
870 870
 
871 871
 if (! function_exists('espresso_organization_name')) {
872
-    /**
873
-     * espresso_organization_name
874
-     *
875
-     * @param bool $echo
876
-     * @return string
877
-     * @throws EE_Error
878
-     */
879
-    function espresso_organization_name($echo = true)
880
-    {
881
-        if ($echo) {
882
-            echo EE_Registry::instance()->CFG->organization->get_pretty('name'); // already escaped
883
-            return '';
884
-        }
885
-        return EE_Registry::instance()->CFG->organization->get_pretty('name');
886
-    }
872
+	/**
873
+	 * espresso_organization_name
874
+	 *
875
+	 * @param bool $echo
876
+	 * @return string
877
+	 * @throws EE_Error
878
+	 */
879
+	function espresso_organization_name($echo = true)
880
+	{
881
+		if ($echo) {
882
+			echo EE_Registry::instance()->CFG->organization->get_pretty('name'); // already escaped
883
+			return '';
884
+		}
885
+		return EE_Registry::instance()->CFG->organization->get_pretty('name');
886
+	}
887 887
 }
888 888
 
889 889
 if (! function_exists('espresso_organization_address')) {
890
-    /**
891
-     * espresso_organization_address
892
-     *
893
-     * @param string $type
894
-     * @return string
895
-     */
896
-    function espresso_organization_address($type = 'inline')
897
-    {
898
-        if (EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config) {
899
-            $address = new EventEspresso\core\domain\entities\GenericAddress(
900
-                EE_Registry::instance()->CFG->organization->address_1,
901
-                EE_Registry::instance()->CFG->organization->address_2,
902
-                EE_Registry::instance()->CFG->organization->city,
903
-                EE_Registry::instance()->CFG->organization->STA_ID,
904
-                EE_Registry::instance()->CFG->organization->zip,
905
-                EE_Registry::instance()->CFG->organization->CNT_ISO
906
-            );
907
-            return EEH_Address::format($address, $type);
908
-        }
909
-        return '';
910
-    }
890
+	/**
891
+	 * espresso_organization_address
892
+	 *
893
+	 * @param string $type
894
+	 * @return string
895
+	 */
896
+	function espresso_organization_address($type = 'inline')
897
+	{
898
+		if (EE_Registry::instance()->CFG->organization instanceof EE_Organization_Config) {
899
+			$address = new EventEspresso\core\domain\entities\GenericAddress(
900
+				EE_Registry::instance()->CFG->organization->address_1,
901
+				EE_Registry::instance()->CFG->organization->address_2,
902
+				EE_Registry::instance()->CFG->organization->city,
903
+				EE_Registry::instance()->CFG->organization->STA_ID,
904
+				EE_Registry::instance()->CFG->organization->zip,
905
+				EE_Registry::instance()->CFG->organization->CNT_ISO
906
+			);
907
+			return EEH_Address::format($address, $type);
908
+		}
909
+		return '';
910
+	}
911 911
 }
912 912
 
913 913
 if (! function_exists('espresso_organization_email')) {
914
-    /**
915
-     * espresso_organization_email
916
-     *
917
-     * @param bool $echo
918
-     * @return string
919
-     * @throws EE_Error
920
-     */
921
-    function espresso_organization_email($echo = true)
922
-    {
923
-        if ($echo) {
924
-            echo EE_Registry::instance()->CFG->organization->get_pretty('email'); // already escaped
925
-            return '';
926
-        }
927
-        return EE_Registry::instance()->CFG->organization->get_pretty('email');
928
-    }
914
+	/**
915
+	 * espresso_organization_email
916
+	 *
917
+	 * @param bool $echo
918
+	 * @return string
919
+	 * @throws EE_Error
920
+	 */
921
+	function espresso_organization_email($echo = true)
922
+	{
923
+		if ($echo) {
924
+			echo EE_Registry::instance()->CFG->organization->get_pretty('email'); // already escaped
925
+			return '';
926
+		}
927
+		return EE_Registry::instance()->CFG->organization->get_pretty('email');
928
+	}
929 929
 }
930 930
 
931 931
 if (! function_exists('espresso_organization_logo_url')) {
932
-    /**
933
-     * espresso_organization_logo_url
934
-     *
935
-     * @param bool $echo
936
-     * @return string
937
-     * @throws EE_Error
938
-     */
939
-    function espresso_organization_logo_url($echo = true)
940
-    {
941
-        if ($echo) {
942
-            echo EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); // already escaped
943
-            return '';
944
-        }
945
-        return EE_Registry::instance()->CFG->organization->get_pretty('logo_url');
946
-    }
932
+	/**
933
+	 * espresso_organization_logo_url
934
+	 *
935
+	 * @param bool $echo
936
+	 * @return string
937
+	 * @throws EE_Error
938
+	 */
939
+	function espresso_organization_logo_url($echo = true)
940
+	{
941
+		if ($echo) {
942
+			echo EE_Registry::instance()->CFG->organization->get_pretty('logo_url'); // already escaped
943
+			return '';
944
+		}
945
+		return EE_Registry::instance()->CFG->organization->get_pretty('logo_url');
946
+	}
947 947
 }
948 948
 
949 949
 if (! function_exists('espresso_organization_facebook')) {
950
-    /**
951
-     * espresso_organization_facebook
952
-     *
953
-     * @param bool $echo
954
-     * @return string
955
-     * @throws EE_Error
956
-     */
957
-    function espresso_organization_facebook($echo = true)
958
-    {
959
-        if ($echo) {
960
-            echo EE_Registry::instance()->CFG->organization->get_pretty('facebook'); // already escaped
961
-            return '';
962
-        }
963
-        return EE_Registry::instance()->CFG->organization->get_pretty('facebook');
964
-    }
950
+	/**
951
+	 * espresso_organization_facebook
952
+	 *
953
+	 * @param bool $echo
954
+	 * @return string
955
+	 * @throws EE_Error
956
+	 */
957
+	function espresso_organization_facebook($echo = true)
958
+	{
959
+		if ($echo) {
960
+			echo EE_Registry::instance()->CFG->organization->get_pretty('facebook'); // already escaped
961
+			return '';
962
+		}
963
+		return EE_Registry::instance()->CFG->organization->get_pretty('facebook');
964
+	}
965 965
 }
966 966
 
967 967
 if (! function_exists('espresso_organization_twitter')) {
968
-    /**
969
-     * espresso_organization_twitter
970
-     *
971
-     * @param bool $echo
972
-     * @return string
973
-     * @throws EE_Error
974
-     */
975
-    function espresso_organization_twitter($echo = true)
976
-    {
977
-        if ($echo) {
978
-            echo EE_Registry::instance()->CFG->organization->get_pretty('twitter'); // already escaped
979
-            return '';
980
-        }
981
-        return EE_Registry::instance()->CFG->organization->get_pretty('twitter');
982
-    }
968
+	/**
969
+	 * espresso_organization_twitter
970
+	 *
971
+	 * @param bool $echo
972
+	 * @return string
973
+	 * @throws EE_Error
974
+	 */
975
+	function espresso_organization_twitter($echo = true)
976
+	{
977
+		if ($echo) {
978
+			echo EE_Registry::instance()->CFG->organization->get_pretty('twitter'); // already escaped
979
+			return '';
980
+		}
981
+		return EE_Registry::instance()->CFG->organization->get_pretty('twitter');
982
+	}
983 983
 }
984 984
 
985 985
 if (! function_exists('espresso_organization_linkedin')) {
986
-    /**
987
-     * espresso_organization_linkedin
988
-     *
989
-     * @param bool $echo
990
-     * @return string
991
-     * @throws EE_Error
992
-     */
993
-    function espresso_organization_linkedin($echo = true)
994
-    {
995
-        if ($echo) {
996
-            echo EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); // already escaped
997
-            return '';
998
-        }
999
-        return EE_Registry::instance()->CFG->organization->get_pretty('linkedin');
1000
-    }
986
+	/**
987
+	 * espresso_organization_linkedin
988
+	 *
989
+	 * @param bool $echo
990
+	 * @return string
991
+	 * @throws EE_Error
992
+	 */
993
+	function espresso_organization_linkedin($echo = true)
994
+	{
995
+		if ($echo) {
996
+			echo EE_Registry::instance()->CFG->organization->get_pretty('linkedin'); // already escaped
997
+			return '';
998
+		}
999
+		return EE_Registry::instance()->CFG->organization->get_pretty('linkedin');
1000
+	}
1001 1001
 }
1002 1002
 
1003 1003
 if (! function_exists('espresso_organization_pinterest')) {
1004
-    /**
1005
-     * espresso_organization_pinterest
1006
-     *
1007
-     * @param bool $echo
1008
-     * @return string
1009
-     * @throws EE_Error
1010
-     */
1011
-    function espresso_organization_pinterest($echo = true)
1012
-    {
1013
-        if ($echo) {
1014
-            echo EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); // already escaped
1015
-            return '';
1016
-        }
1017
-        return EE_Registry::instance()->CFG->organization->get_pretty('pinterest');
1018
-    }
1004
+	/**
1005
+	 * espresso_organization_pinterest
1006
+	 *
1007
+	 * @param bool $echo
1008
+	 * @return string
1009
+	 * @throws EE_Error
1010
+	 */
1011
+	function espresso_organization_pinterest($echo = true)
1012
+	{
1013
+		if ($echo) {
1014
+			echo EE_Registry::instance()->CFG->organization->get_pretty('pinterest'); // already escaped
1015
+			return '';
1016
+		}
1017
+		return EE_Registry::instance()->CFG->organization->get_pretty('pinterest');
1018
+	}
1019 1019
 }
1020 1020
 
1021 1021
 if (! function_exists('espresso_organization_google')) {
1022
-    /**
1023
-     * espresso_organization_google
1024
-     *
1025
-     * @param bool $echo
1026
-     * @return string
1027
-     * @throws EE_Error
1028
-     */
1029
-    function espresso_organization_google($echo = true)
1030
-    {
1031
-        if ($echo) {
1032
-            echo EE_Registry::instance()->CFG->organization->get_pretty('google'); // already escaped
1033
-            return '';
1034
-        }
1035
-        return EE_Registry::instance()->CFG->organization->get_pretty('google');
1036
-    }
1022
+	/**
1023
+	 * espresso_organization_google
1024
+	 *
1025
+	 * @param bool $echo
1026
+	 * @return string
1027
+	 * @throws EE_Error
1028
+	 */
1029
+	function espresso_organization_google($echo = true)
1030
+	{
1031
+		if ($echo) {
1032
+			echo EE_Registry::instance()->CFG->organization->get_pretty('google'); // already escaped
1033
+			return '';
1034
+		}
1035
+		return EE_Registry::instance()->CFG->organization->get_pretty('google');
1036
+	}
1037 1037
 }
1038 1038
 
1039 1039
 if (! function_exists('espresso_organization_instagram')) {
1040
-    /**
1041
-     * espresso_organization_instagram
1042
-     *
1043
-     * @param bool $echo
1044
-     * @return string
1045
-     * @throws EE_Error
1046
-     */
1047
-    function espresso_organization_instagram($echo = true)
1048
-    {
1049
-        if ($echo) {
1050
-            echo EE_Registry::instance()->CFG->organization->get_pretty('instagram'); // already escaped
1051
-            return '';
1052
-        }
1053
-        return EE_Registry::instance()->CFG->organization->get_pretty('instagram');
1054
-    }
1040
+	/**
1041
+	 * espresso_organization_instagram
1042
+	 *
1043
+	 * @param bool $echo
1044
+	 * @return string
1045
+	 * @throws EE_Error
1046
+	 */
1047
+	function espresso_organization_instagram($echo = true)
1048
+	{
1049
+		if ($echo) {
1050
+			echo EE_Registry::instance()->CFG->organization->get_pretty('instagram'); // already escaped
1051
+			return '';
1052
+		}
1053
+		return EE_Registry::instance()->CFG->organization->get_pretty('instagram');
1054
+	}
1055 1055
 }
1056 1056
 
1057 1057
 
@@ -1059,345 +1059,345 @@  discard block
 block discarded – undo
1059 1059
 
1060 1060
 
1061 1061
 if (! function_exists('espresso_event_venues')) {
1062
-    /**
1063
-     * espresso_event_venues
1064
-     *
1065
-     * @return array  all venues related to an event
1066
-     * @throws EE_Error
1067
-     * @throws ReflectionException
1068
-     */
1069
-    function espresso_event_venues()
1070
-    {
1071
-        return EEH_Venue_View::get_event_venues();
1072
-    }
1062
+	/**
1063
+	 * espresso_event_venues
1064
+	 *
1065
+	 * @return array  all venues related to an event
1066
+	 * @throws EE_Error
1067
+	 * @throws ReflectionException
1068
+	 */
1069
+	function espresso_event_venues()
1070
+	{
1071
+		return EEH_Venue_View::get_event_venues();
1072
+	}
1073 1073
 }
1074 1074
 
1075 1075
 
1076 1076
 if (! function_exists('espresso_venue_id')) {
1077
-    /**
1078
-     *    espresso_venue_name
1079
-     *
1080
-     * @access    public
1081
-     * @param int $EVT_ID
1082
-     * @return    string
1083
-     * @throws EE_Error
1084
-     * @throws ReflectionException
1085
-     */
1086
-    function espresso_venue_id($EVT_ID = 0)
1087
-    {
1088
-        $venue = EEH_Venue_View::get_venue($EVT_ID);
1089
-        return $venue instanceof EE_Venue ? $venue->ID() : 0;
1090
-    }
1077
+	/**
1078
+	 *    espresso_venue_name
1079
+	 *
1080
+	 * @access    public
1081
+	 * @param int $EVT_ID
1082
+	 * @return    string
1083
+	 * @throws EE_Error
1084
+	 * @throws ReflectionException
1085
+	 */
1086
+	function espresso_venue_id($EVT_ID = 0)
1087
+	{
1088
+		$venue = EEH_Venue_View::get_venue($EVT_ID);
1089
+		return $venue instanceof EE_Venue ? $venue->ID() : 0;
1090
+	}
1091 1091
 }
1092 1092
 
1093 1093
 
1094 1094
 if (! function_exists('espresso_is_venue_private')) {
1095
-    /**
1096
-     * Return whether a venue is private or not.
1097
-     *
1098
-     * @param int $VNU_ID optional, the venue id to check.
1099
-     *
1100
-     * @return bool | null
1101
-     * @throws EE_Error
1102
-     * @throws ReflectionException
1103
-     * @see EEH_Venue_View::get_venue() for more info on expected return results.
1104
-     */
1105
-    function espresso_is_venue_private($VNU_ID = 0)
1106
-    {
1107
-        return EEH_Venue_View::is_venue_private($VNU_ID);
1108
-    }
1095
+	/**
1096
+	 * Return whether a venue is private or not.
1097
+	 *
1098
+	 * @param int $VNU_ID optional, the venue id to check.
1099
+	 *
1100
+	 * @return bool | null
1101
+	 * @throws EE_Error
1102
+	 * @throws ReflectionException
1103
+	 * @see EEH_Venue_View::get_venue() for more info on expected return results.
1104
+	 */
1105
+	function espresso_is_venue_private($VNU_ID = 0)
1106
+	{
1107
+		return EEH_Venue_View::is_venue_private($VNU_ID);
1108
+	}
1109 1109
 }
1110 1110
 
1111 1111
 
1112 1112
 if (! function_exists('espresso_venue_is_password_protected')) {
1113
-    /**
1114
-     * returns true or false if a venue is password protected or not
1115
-     *
1116
-     * @param int $VNU_ID optional, the venue id to check.
1117
-     * @return bool
1118
-     * @throws EE_Error
1119
-     * @throws ReflectionException
1120
-     */
1121
-    function espresso_venue_is_password_protected($VNU_ID = 0)
1122
-    {
1123
-        EE_Registry::instance()->load_helper('Venue_View');
1124
-        return EEH_Venue_View::is_venue_password_protected($VNU_ID);
1125
-    }
1113
+	/**
1114
+	 * returns true or false if a venue is password protected or not
1115
+	 *
1116
+	 * @param int $VNU_ID optional, the venue id to check.
1117
+	 * @return bool
1118
+	 * @throws EE_Error
1119
+	 * @throws ReflectionException
1120
+	 */
1121
+	function espresso_venue_is_password_protected($VNU_ID = 0)
1122
+	{
1123
+		EE_Registry::instance()->load_helper('Venue_View');
1124
+		return EEH_Venue_View::is_venue_password_protected($VNU_ID);
1125
+	}
1126 1126
 }
1127 1127
 
1128 1128
 
1129 1129
 if (! function_exists('espresso_password_protected_venue_form')) {
1130
-    /**
1131
-     * Returns a password form if venue is password protected.
1132
-     *
1133
-     * @param int $VNU_ID optional, the venue id to check.
1134
-     * @return string
1135
-     * @throws EE_Error
1136
-     * @throws ReflectionException
1137
-     */
1138
-    function espresso_password_protected_venue_form($VNU_ID = 0)
1139
-    {
1140
-        EE_Registry::instance()->load_helper('Venue_View');
1141
-        return EEH_Venue_View::password_protected_venue_form($VNU_ID);
1142
-    }
1130
+	/**
1131
+	 * Returns a password form if venue is password protected.
1132
+	 *
1133
+	 * @param int $VNU_ID optional, the venue id to check.
1134
+	 * @return string
1135
+	 * @throws EE_Error
1136
+	 * @throws ReflectionException
1137
+	 */
1138
+	function espresso_password_protected_venue_form($VNU_ID = 0)
1139
+	{
1140
+		EE_Registry::instance()->load_helper('Venue_View');
1141
+		return EEH_Venue_View::password_protected_venue_form($VNU_ID);
1142
+	}
1143 1143
 }
1144 1144
 
1145 1145
 
1146 1146
 if (! function_exists('espresso_venue_name')) {
1147
-    /**
1148
-     *    espresso_venue_name
1149
-     *
1150
-     * @access    public
1151
-     * @param int    $VNU_ID
1152
-     * @param string $link_to - options( details, website, none ) whether to turn Venue name into a clickable link to the Venue's details page or website
1153
-     * @param bool   $echo
1154
-     * @return    string
1155
-     * @throws EE_Error
1156
-     * @throws ReflectionException
1157
-     */
1158
-    function espresso_venue_name($VNU_ID = 0, $link_to = 'details', $echo = true)
1159
-    {
1160
-        if ($echo) {
1161
-            echo EEH_Venue_View::venue_name($link_to, $VNU_ID); // already escaped
1162
-            return '';
1163
-        }
1164
-        return EEH_Venue_View::venue_name($link_to, $VNU_ID);
1165
-    }
1147
+	/**
1148
+	 *    espresso_venue_name
1149
+	 *
1150
+	 * @access    public
1151
+	 * @param int    $VNU_ID
1152
+	 * @param string $link_to - options( details, website, none ) whether to turn Venue name into a clickable link to the Venue's details page or website
1153
+	 * @param bool   $echo
1154
+	 * @return    string
1155
+	 * @throws EE_Error
1156
+	 * @throws ReflectionException
1157
+	 */
1158
+	function espresso_venue_name($VNU_ID = 0, $link_to = 'details', $echo = true)
1159
+	{
1160
+		if ($echo) {
1161
+			echo EEH_Venue_View::venue_name($link_to, $VNU_ID); // already escaped
1162
+			return '';
1163
+		}
1164
+		return EEH_Venue_View::venue_name($link_to, $VNU_ID);
1165
+	}
1166 1166
 }
1167 1167
 
1168 1168
 
1169 1169
 if (! function_exists('espresso_venue_link')) {
1170
-    /**
1171
-     *    espresso_venue_link
1172
-     *
1173
-     * @access    public
1174
-     * @param int    $VNU_ID
1175
-     * @param string $text
1176
-     * @return    string
1177
-     * @throws EE_Error
1178
-     * @throws ReflectionException
1179
-     */
1180
-    function espresso_venue_link($VNU_ID = 0, $text = '')
1181
-    {
1182
-        return EEH_Venue_View::venue_details_link($VNU_ID, $text);
1183
-    }
1170
+	/**
1171
+	 *    espresso_venue_link
1172
+	 *
1173
+	 * @access    public
1174
+	 * @param int    $VNU_ID
1175
+	 * @param string $text
1176
+	 * @return    string
1177
+	 * @throws EE_Error
1178
+	 * @throws ReflectionException
1179
+	 */
1180
+	function espresso_venue_link($VNU_ID = 0, $text = '')
1181
+	{
1182
+		return EEH_Venue_View::venue_details_link($VNU_ID, $text);
1183
+	}
1184 1184
 }
1185 1185
 
1186 1186
 
1187 1187
 if (! function_exists('espresso_venue_description')) {
1188
-    /**
1189
-     *    espresso_venue_description
1190
-     *
1191
-     * @access    public
1192
-     * @param bool $VNU_ID
1193
-     * @param bool $echo
1194
-     * @return    string
1195
-     * @throws EE_Error
1196
-     * @throws ReflectionException
1197
-     */
1198
-    function espresso_venue_description($VNU_ID = false, $echo = true)
1199
-    {
1200
-        if ($echo) {
1201
-            echo EEH_Venue_View::venue_description($VNU_ID); // already escaped
1202
-            return '';
1203
-        }
1204
-        return EEH_Venue_View::venue_description($VNU_ID);
1205
-    }
1188
+	/**
1189
+	 *    espresso_venue_description
1190
+	 *
1191
+	 * @access    public
1192
+	 * @param bool $VNU_ID
1193
+	 * @param bool $echo
1194
+	 * @return    string
1195
+	 * @throws EE_Error
1196
+	 * @throws ReflectionException
1197
+	 */
1198
+	function espresso_venue_description($VNU_ID = false, $echo = true)
1199
+	{
1200
+		if ($echo) {
1201
+			echo EEH_Venue_View::venue_description($VNU_ID); // already escaped
1202
+			return '';
1203
+		}
1204
+		return EEH_Venue_View::venue_description($VNU_ID);
1205
+	}
1206 1206
 }
1207 1207
 
1208 1208
 
1209 1209
 if (! function_exists('espresso_venue_excerpt')) {
1210
-    /**
1211
-     *    espresso_venue_excerpt
1212
-     *
1213
-     * @access    public
1214
-     * @param int  $VNU_ID
1215
-     * @param bool $echo
1216
-     * @return    string
1217
-     * @throws EE_Error
1218
-     * @throws ReflectionException
1219
-     */
1220
-    function espresso_venue_excerpt($VNU_ID = 0, $echo = true)
1221
-    {
1222
-        if ($echo) {
1223
-            echo EEH_Venue_View::venue_excerpt($VNU_ID); // already escaped
1224
-            return '';
1225
-        }
1226
-        return EEH_Venue_View::venue_excerpt($VNU_ID);
1227
-    }
1210
+	/**
1211
+	 *    espresso_venue_excerpt
1212
+	 *
1213
+	 * @access    public
1214
+	 * @param int  $VNU_ID
1215
+	 * @param bool $echo
1216
+	 * @return    string
1217
+	 * @throws EE_Error
1218
+	 * @throws ReflectionException
1219
+	 */
1220
+	function espresso_venue_excerpt($VNU_ID = 0, $echo = true)
1221
+	{
1222
+		if ($echo) {
1223
+			echo EEH_Venue_View::venue_excerpt($VNU_ID); // already escaped
1224
+			return '';
1225
+		}
1226
+		return EEH_Venue_View::venue_excerpt($VNU_ID);
1227
+	}
1228 1228
 }
1229 1229
 
1230 1230
 
1231 1231
 if (! function_exists('espresso_venue_categories')) {
1232
-    /**
1233
-     * espresso_venue_categories
1234
-     * returns the terms associated with a venue
1235
-     *
1236
-     * @param int  $VNU_ID
1237
-     * @param bool $hide_uncategorized
1238
-     * @param bool $echo
1239
-     * @return string
1240
-     * @throws EE_Error
1241
-     * @throws ReflectionException
1242
-     */
1243
-    function espresso_venue_categories($VNU_ID = 0, $hide_uncategorized = true, $echo = true)
1244
-    {
1245
-        if ($echo) {
1246
-            echo EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); // already escaped
1247
-            return '';
1248
-        }
1249
-        return EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized);
1250
-    }
1232
+	/**
1233
+	 * espresso_venue_categories
1234
+	 * returns the terms associated with a venue
1235
+	 *
1236
+	 * @param int  $VNU_ID
1237
+	 * @param bool $hide_uncategorized
1238
+	 * @param bool $echo
1239
+	 * @return string
1240
+	 * @throws EE_Error
1241
+	 * @throws ReflectionException
1242
+	 */
1243
+	function espresso_venue_categories($VNU_ID = 0, $hide_uncategorized = true, $echo = true)
1244
+	{
1245
+		if ($echo) {
1246
+			echo EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized); // already escaped
1247
+			return '';
1248
+		}
1249
+		return EEH_Venue_View::venue_categories($VNU_ID, $hide_uncategorized);
1250
+	}
1251 1251
 }
1252 1252
 
1253 1253
 
1254 1254
 if (! function_exists('espresso_venue_address')) {
1255
-    /**
1256
-     * espresso_venue_address
1257
-     * returns a formatted block of html  for displaying a venue's address
1258
-     *
1259
-     * @param string $type 'inline' or 'multiline'
1260
-     * @param int    $VNU_ID
1261
-     * @param bool   $echo
1262
-     * @return string
1263
-     * @throws EE_Error
1264
-     * @throws ReflectionException
1265
-     */
1266
-    function espresso_venue_address($type = 'multiline', $VNU_ID = 0, $echo = true)
1267
-    {
1268
-        if ($echo) {
1269
-            echo EEH_Venue_View::venue_address($type, $VNU_ID); // already escaped
1270
-            return '';
1271
-        }
1272
-        return EEH_Venue_View::venue_address($type, $VNU_ID);
1273
-    }
1255
+	/**
1256
+	 * espresso_venue_address
1257
+	 * returns a formatted block of html  for displaying a venue's address
1258
+	 *
1259
+	 * @param string $type 'inline' or 'multiline'
1260
+	 * @param int    $VNU_ID
1261
+	 * @param bool   $echo
1262
+	 * @return string
1263
+	 * @throws EE_Error
1264
+	 * @throws ReflectionException
1265
+	 */
1266
+	function espresso_venue_address($type = 'multiline', $VNU_ID = 0, $echo = true)
1267
+	{
1268
+		if ($echo) {
1269
+			echo EEH_Venue_View::venue_address($type, $VNU_ID); // already escaped
1270
+			return '';
1271
+		}
1272
+		return EEH_Venue_View::venue_address($type, $VNU_ID);
1273
+	}
1274 1274
 }
1275 1275
 
1276 1276
 
1277 1277
 if (! function_exists('espresso_venue_raw_address')) {
1278
-    /**
1279
-     * espresso_venue_address
1280
-     * returns an UN-formatted string containing a venue's address
1281
-     *
1282
-     * @param string $type 'inline' or 'multiline'
1283
-     * @param int    $VNU_ID
1284
-     * @param bool   $echo
1285
-     * @return string
1286
-     * @throws EE_Error
1287
-     * @throws ReflectionException
1288
-     */
1289
-    function espresso_venue_raw_address($type = 'multiline', $VNU_ID = 0, $echo = true)
1290
-    {
1291
-        if ($echo) {
1292
-            echo EEH_Venue_View::venue_address($type, $VNU_ID, false, false); // already escaped
1293
-            return '';
1294
-        }
1295
-        return EEH_Venue_View::venue_address($type, $VNU_ID, false, false);
1296
-    }
1278
+	/**
1279
+	 * espresso_venue_address
1280
+	 * returns an UN-formatted string containing a venue's address
1281
+	 *
1282
+	 * @param string $type 'inline' or 'multiline'
1283
+	 * @param int    $VNU_ID
1284
+	 * @param bool   $echo
1285
+	 * @return string
1286
+	 * @throws EE_Error
1287
+	 * @throws ReflectionException
1288
+	 */
1289
+	function espresso_venue_raw_address($type = 'multiline', $VNU_ID = 0, $echo = true)
1290
+	{
1291
+		if ($echo) {
1292
+			echo EEH_Venue_View::venue_address($type, $VNU_ID, false, false); // already escaped
1293
+			return '';
1294
+		}
1295
+		return EEH_Venue_View::venue_address($type, $VNU_ID, false, false);
1296
+	}
1297 1297
 }
1298 1298
 
1299 1299
 
1300 1300
 if (! function_exists('espresso_venue_has_address')) {
1301
-    /**
1302
-     * espresso_venue_has_address
1303
-     * returns TRUE or FALSE if a Venue has address information
1304
-     *
1305
-     * @param int $VNU_ID
1306
-     * @return bool
1307
-     * @throws EE_Error
1308
-     * @throws ReflectionException
1309
-     */
1310
-    function espresso_venue_has_address($VNU_ID = 0)
1311
-    {
1312
-        return EEH_Venue_View::venue_has_address($VNU_ID);
1313
-    }
1301
+	/**
1302
+	 * espresso_venue_has_address
1303
+	 * returns TRUE or FALSE if a Venue has address information
1304
+	 *
1305
+	 * @param int $VNU_ID
1306
+	 * @return bool
1307
+	 * @throws EE_Error
1308
+	 * @throws ReflectionException
1309
+	 */
1310
+	function espresso_venue_has_address($VNU_ID = 0)
1311
+	{
1312
+		return EEH_Venue_View::venue_has_address($VNU_ID);
1313
+	}
1314 1314
 }
1315 1315
 
1316 1316
 
1317 1317
 if (! function_exists('espresso_venue_gmap')) {
1318
-    /**
1319
-     * espresso_venue_gmap
1320
-     * returns a google map for the venue address
1321
-     *
1322
-     * @param int   $VNU_ID
1323
-     * @param bool  $map_ID
1324
-     * @param array $gmap
1325
-     * @param bool  $echo
1326
-     * @return string
1327
-     * @throws EE_Error
1328
-     * @throws ReflectionException
1329
-     */
1330
-    function espresso_venue_gmap($VNU_ID = 0, $map_ID = false, $gmap = [], $echo = true)
1331
-    {
1332
-        if ($echo) {
1333
-            echo EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); // already escaped
1334
-            return '';
1335
-        }
1336
-        return EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap);
1337
-    }
1318
+	/**
1319
+	 * espresso_venue_gmap
1320
+	 * returns a google map for the venue address
1321
+	 *
1322
+	 * @param int   $VNU_ID
1323
+	 * @param bool  $map_ID
1324
+	 * @param array $gmap
1325
+	 * @param bool  $echo
1326
+	 * @return string
1327
+	 * @throws EE_Error
1328
+	 * @throws ReflectionException
1329
+	 */
1330
+	function espresso_venue_gmap($VNU_ID = 0, $map_ID = false, $gmap = [], $echo = true)
1331
+	{
1332
+		if ($echo) {
1333
+			echo EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap); // already escaped
1334
+			return '';
1335
+		}
1336
+		return EEH_Venue_View::venue_gmap($VNU_ID, $map_ID, $gmap);
1337
+	}
1338 1338
 }
1339 1339
 
1340 1340
 
1341 1341
 if (! function_exists('espresso_venue_phone')) {
1342
-    /**
1343
-     * espresso_venue_phone
1344
-     *
1345
-     * @param int  $VNU_ID
1346
-     * @param bool $echo
1347
-     * @return string
1348
-     * @throws EE_Error
1349
-     * @throws ReflectionException
1350
-     */
1351
-    function espresso_venue_phone($VNU_ID = 0, $echo = true)
1352
-    {
1353
-        if ($echo) {
1354
-            echo EEH_Venue_View::venue_phone($VNU_ID); // already escaped
1355
-            return '';
1356
-        }
1357
-        return EEH_Venue_View::venue_phone($VNU_ID);
1358
-    }
1342
+	/**
1343
+	 * espresso_venue_phone
1344
+	 *
1345
+	 * @param int  $VNU_ID
1346
+	 * @param bool $echo
1347
+	 * @return string
1348
+	 * @throws EE_Error
1349
+	 * @throws ReflectionException
1350
+	 */
1351
+	function espresso_venue_phone($VNU_ID = 0, $echo = true)
1352
+	{
1353
+		if ($echo) {
1354
+			echo EEH_Venue_View::venue_phone($VNU_ID); // already escaped
1355
+			return '';
1356
+		}
1357
+		return EEH_Venue_View::venue_phone($VNU_ID);
1358
+	}
1359 1359
 }
1360 1360
 
1361 1361
 
1362 1362
 if (! function_exists('espresso_venue_website')) {
1363
-    /**
1364
-     * espresso_venue_website
1365
-     *
1366
-     * @param int  $VNU_ID
1367
-     * @param bool $echo
1368
-     * @return string
1369
-     * @throws EE_Error
1370
-     * @throws ReflectionException
1371
-     */
1372
-    function espresso_venue_website($VNU_ID = 0, $echo = true)
1373
-    {
1374
-        if ($echo) {
1375
-            echo EEH_Venue_View::venue_website_link($VNU_ID); // already escaped
1376
-            return '';
1377
-        }
1378
-        return EEH_Venue_View::venue_website_link($VNU_ID);
1379
-    }
1363
+	/**
1364
+	 * espresso_venue_website
1365
+	 *
1366
+	 * @param int  $VNU_ID
1367
+	 * @param bool $echo
1368
+	 * @return string
1369
+	 * @throws EE_Error
1370
+	 * @throws ReflectionException
1371
+	 */
1372
+	function espresso_venue_website($VNU_ID = 0, $echo = true)
1373
+	{
1374
+		if ($echo) {
1375
+			echo EEH_Venue_View::venue_website_link($VNU_ID); // already escaped
1376
+			return '';
1377
+		}
1378
+		return EEH_Venue_View::venue_website_link($VNU_ID);
1379
+	}
1380 1380
 }
1381 1381
 
1382 1382
 
1383 1383
 if (! function_exists('espresso_edit_venue_link')) {
1384
-    /**
1385
-     * espresso_edit_venue_link
1386
-     *
1387
-     * @param int  $VNU_ID
1388
-     * @param bool $echo
1389
-     * @return string
1390
-     * @throws EE_Error
1391
-     * @throws ReflectionException
1392
-     */
1393
-    function espresso_edit_venue_link($VNU_ID = 0, $echo = true)
1394
-    {
1395
-        if ($echo) {
1396
-            echo EEH_Venue_View::edit_venue_link($VNU_ID); // already escaped
1397
-            return '';
1398
-        }
1399
-        return EEH_Venue_View::edit_venue_link($VNU_ID);
1400
-    }
1384
+	/**
1385
+	 * espresso_edit_venue_link
1386
+	 *
1387
+	 * @param int  $VNU_ID
1388
+	 * @param bool $echo
1389
+	 * @return string
1390
+	 * @throws EE_Error
1391
+	 * @throws ReflectionException
1392
+	 */
1393
+	function espresso_edit_venue_link($VNU_ID = 0, $echo = true)
1394
+	{
1395
+		if ($echo) {
1396
+			echo EEH_Venue_View::edit_venue_link($VNU_ID); // already escaped
1397
+			return '';
1398
+		}
1399
+		return EEH_Venue_View::edit_venue_link($VNU_ID);
1400
+	}
1401 1401
 }
1402 1402
 
1403 1403
 
Please login to merge, or discard this patch.
espresso.php 1 patch
Indentation   +80 added lines, -80 removed lines patch added patch discarded remove patch
@@ -38,103 +38,103 @@
 block discarded – undo
38 38
  * @since           4.0
39 39
  */
40 40
 if (function_exists('espresso_version')) {
41
-    if (! function_exists('espresso_duplicate_plugin_error')) {
42
-        /**
43
-         *    espresso_duplicate_plugin_error
44
-         *    displays if more than one version of EE is activated at the same time
45
-         */
46
-        function espresso_duplicate_plugin_error()
47
-        {
48
-            ?>
41
+	if (! function_exists('espresso_duplicate_plugin_error')) {
42
+		/**
43
+		 *    espresso_duplicate_plugin_error
44
+		 *    displays if more than one version of EE is activated at the same time
45
+		 */
46
+		function espresso_duplicate_plugin_error()
47
+		{
48
+			?>
49 49
             <div class="error">
50 50
                 <p>
51 51
                     <?php
52
-                    echo esc_html__(
53
-                        'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
-                        'event_espresso'
55
-                    ); ?>
52
+					echo esc_html__(
53
+						'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.',
54
+						'event_espresso'
55
+					); ?>
56 56
                 </p>
57 57
             </div>
58 58
             <?php
59
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
60
-        }
61
-    }
62
-    add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
59
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
60
+		}
61
+	}
62
+	add_action('admin_notices', 'espresso_duplicate_plugin_error', 1);
63 63
 } else {
64
-    define('EE_MIN_PHP_VER_REQUIRED', '5.6.2');
65
-    if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
-        /**
67
-         * espresso_minimum_php_version_error
68
-         *
69
-         * @return void
70
-         */
71
-        function espresso_minimum_php_version_error()
72
-        {
73
-            ?>
64
+	define('EE_MIN_PHP_VER_REQUIRED', '5.6.2');
65
+	if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) {
66
+		/**
67
+		 * espresso_minimum_php_version_error
68
+		 *
69
+		 * @return void
70
+		 */
71
+		function espresso_minimum_php_version_error()
72
+		{
73
+			?>
74 74
             <div class="error">
75 75
                 <p>
76 76
                     <?php
77
-                    printf(
78
-                        esc_html__(
79
-                            'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
-                            'event_espresso'
81
-                        ),
82
-                        EE_MIN_PHP_VER_REQUIRED,
83
-                        PHP_VERSION,
84
-                        '<br/>',
85
-                        '<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
-                    );
87
-                    ?>
77
+					printf(
78
+						esc_html__(
79
+							'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.',
80
+							'event_espresso'
81
+						),
82
+						EE_MIN_PHP_VER_REQUIRED,
83
+						PHP_VERSION,
84
+						'<br/>',
85
+						'<a href="http://php.net/downloads.php">http://php.net/downloads.php</a>'
86
+					);
87
+					?>
88 88
                 </p>
89 89
             </div>
90 90
             <?php
91
-            espresso_deactivate_plugin(plugin_basename(__FILE__));
92
-        }
91
+			espresso_deactivate_plugin(plugin_basename(__FILE__));
92
+		}
93 93
 
94
-        add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
-    } else {
96
-        define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
-        /**
98
-         * espresso_version
99
-         * Returns the plugin version
100
-         *
101
-         * @return string
102
-         */
103
-        function espresso_version()
104
-        {
105
-            return apply_filters('FHEE__espresso__espresso_version', '4.10.33.rc.015');
106
-        }
94
+		add_action('admin_notices', 'espresso_minimum_php_version_error', 1);
95
+	} else {
96
+		define('EVENT_ESPRESSO_MAIN_FILE', __FILE__);
97
+		/**
98
+		 * espresso_version
99
+		 * Returns the plugin version
100
+		 *
101
+		 * @return string
102
+		 */
103
+		function espresso_version()
104
+		{
105
+			return apply_filters('FHEE__espresso__espresso_version', '4.10.33.rc.015');
106
+		}
107 107
 
108
-        /**
109
-         * espresso_plugin_activation
110
-         * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
-         */
112
-        function espresso_plugin_activation()
113
-        {
114
-            update_option('ee_espresso_activation', true);
115
-        }
108
+		/**
109
+		 * espresso_plugin_activation
110
+		 * adds a wp-option to indicate that EE has been activated via the WP admin plugins page
111
+		 */
112
+		function espresso_plugin_activation()
113
+		{
114
+			update_option('ee_espresso_activation', true);
115
+		}
116 116
 
117
-        register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
117
+		register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation');
118 118
 
119
-        require_once __DIR__ . '/core/bootstrap_espresso.php';
120
-        bootstrap_espresso();
121
-    }
119
+		require_once __DIR__ . '/core/bootstrap_espresso.php';
120
+		bootstrap_espresso();
121
+	}
122 122
 }
123 123
 if (! function_exists('espresso_deactivate_plugin')) {
124
-    /**
125
-     *    deactivate_plugin
126
-     * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
-     *
128
-     * @access public
129
-     * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
-     * @return    void
131
-     */
132
-    function espresso_deactivate_plugin($plugin_basename = '')
133
-    {
134
-        if (! function_exists('deactivate_plugins')) {
135
-            require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
-        }
137
-        unset($_GET['activate'], $_REQUEST['activate']);
138
-        deactivate_plugins($plugin_basename);
139
-    }
124
+	/**
125
+	 *    deactivate_plugin
126
+	 * usage:  espresso_deactivate_plugin( plugin_basename( __FILE__ ));
127
+	 *
128
+	 * @access public
129
+	 * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file
130
+	 * @return    void
131
+	 */
132
+	function espresso_deactivate_plugin($plugin_basename = '')
133
+	{
134
+		if (! function_exists('deactivate_plugins')) {
135
+			require_once ABSPATH . 'wp-admin/includes/plugin.php';
136
+		}
137
+		unset($_GET['activate'], $_REQUEST['activate']);
138
+		deactivate_plugins($plugin_basename);
139
+	}
140 140
 }
141 141
\ No newline at end of file
Please login to merge, or discard this patch.
strategies/display/EE_Admin_File_Uploader_Display_Strategy.strategy.php 2 patches
Indentation   +67 added lines, -67 removed lines patch added patch discarded remove patch
@@ -12,79 +12,79 @@
 block discarded – undo
12 12
 class EE_Admin_File_Uploader_Display_Strategy extends EE_Display_Strategy_Base
13 13
 {
14 14
 
15
-    /**
16
-     * Its important this media only get enqueued AFTER init, but before the footer... where the
17
-     * rest of our forms JS gets enqueued. Otherwise the JS gets enqueued fine, and loaded on the page fine,
18
-     * but when you upload an image it gets uploaded fine to the server, but it doesn't display and reports an error
19
-     * (also it doesn't show any of the currently existing media in the modal window that pops up when you click the button
20
-     * to select media).
21
-     * Besides that, no special consideration should be required to make the media uploader appear, besides having
22
-     * this input displayed.
23
-     * @deprecated. enqueue_js should be called automatically now
24
-     */
25
-    public static function enqueue_scripts()
26
-    {
27
-        EE_Error::doing_it_wrong(__FUNCTION__, esc_html__('EE_Admin_File_Uploader_Display_Strategy::enqueue_scripts() no longer needs to be called in order to display the admin uploader input correctly. This is handled now by EE_Admin_File_Uploader_Display_Strategy::enqueue_js() which is called automatically when enqueueing JS and CSS for the form', 'event_espresso'), '4.9.8.rc.015');
28
-        wp_enqueue_media();
29
-        wp_enqueue_script('media-upload');
30
-        wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL . 'scripts/ee-media-uploader.js');
31
-    }
15
+	/**
16
+	 * Its important this media only get enqueued AFTER init, but before the footer... where the
17
+	 * rest of our forms JS gets enqueued. Otherwise the JS gets enqueued fine, and loaded on the page fine,
18
+	 * but when you upload an image it gets uploaded fine to the server, but it doesn't display and reports an error
19
+	 * (also it doesn't show any of the currently existing media in the modal window that pops up when you click the button
20
+	 * to select media).
21
+	 * Besides that, no special consideration should be required to make the media uploader appear, besides having
22
+	 * this input displayed.
23
+	 * @deprecated. enqueue_js should be called automatically now
24
+	 */
25
+	public static function enqueue_scripts()
26
+	{
27
+		EE_Error::doing_it_wrong(__FUNCTION__, esc_html__('EE_Admin_File_Uploader_Display_Strategy::enqueue_scripts() no longer needs to be called in order to display the admin uploader input correctly. This is handled now by EE_Admin_File_Uploader_Display_Strategy::enqueue_js() which is called automatically when enqueueing JS and CSS for the form', 'event_espresso'), '4.9.8.rc.015');
28
+		wp_enqueue_media();
29
+		wp_enqueue_script('media-upload');
30
+		wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL . 'scripts/ee-media-uploader.js');
31
+	}
32 32
 
33
-    /**
34
-     * Enqueues the JS and CSS needed to display this input
35
-     */
36
-    public function enqueue_js()
37
-    {
38
-        wp_enqueue_media();
39
-        wp_enqueue_script('media-upload');
40
-        wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL . 'scripts/ee-media-uploader.js');
41
-        parent::enqueue_js();
42
-    }
33
+	/**
34
+	 * Enqueues the JS and CSS needed to display this input
35
+	 */
36
+	public function enqueue_js()
37
+	{
38
+		wp_enqueue_media();
39
+		wp_enqueue_script('media-upload');
40
+		wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL . 'scripts/ee-media-uploader.js');
41
+		parent::enqueue_js();
42
+	}
43 43
 
44 44
 
45 45
 
46
-    /**
47
-     *
48
-     * @return string of html to display the field
49
-     */
46
+	/**
47
+	 *
48
+	 * @return string of html to display the field
49
+	 */
50 50
 
51
-    public function display()
52
-    {
53
-        // the actual input
54
-        $input = '<input type="text" size="34" ';
55
-        $input .= 'name="' . $this->_input->html_name() . '" ';
56
-        $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" ';
57
-        $input .= 'value="' . $this->_input->raw_value_in_form() . '" ';
58
-        $input .= $this->_input->other_html_attributes() . '>';
59
-        // image uploader
60
-        $uploader = EEH_HTML::link(
61
-            '#',
62
-            '<img src="' . admin_url('images/media-button-image.gif') . '" >',
63
-            esc_html__('click to add an image', 'event_espresso'),
64
-            '',
65
-            'ee_media_upload button'
66
-        );
67
-        // only attempt to show the image if it at least exists
68
-        $image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2) . EEH_HTML::img($this->_input->raw_value(), esc_html__('logo', 'event_espresso'), '', 'ee_media_image') : '';
69
-        // html string
70
-        return EEH_HTML::div($input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area');
71
-    }
51
+	public function display()
52
+	{
53
+		// the actual input
54
+		$input = '<input type="text" size="34" ';
55
+		$input .= 'name="' . $this->_input->html_name() . '" ';
56
+		$input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" ';
57
+		$input .= 'value="' . $this->_input->raw_value_in_form() . '" ';
58
+		$input .= $this->_input->other_html_attributes() . '>';
59
+		// image uploader
60
+		$uploader = EEH_HTML::link(
61
+			'#',
62
+			'<img src="' . admin_url('images/media-button-image.gif') . '" >',
63
+			esc_html__('click to add an image', 'event_espresso'),
64
+			'',
65
+			'ee_media_upload button'
66
+		);
67
+		// only attempt to show the image if it at least exists
68
+		$image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2) . EEH_HTML::img($this->_input->raw_value(), esc_html__('logo', 'event_espresso'), '', 'ee_media_image') : '';
69
+		// html string
70
+		return EEH_HTML::div($input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area');
71
+	}
72 72
 
73 73
 
74 74
 
75
-    /**
76
-     * Asserts an image actually exists as quickly as possible by sending a HEAD
77
-     * request
78
-     * @param string $src
79
-     * @return boolean
80
-     */
81
-    protected function src_exists($src)
82
-    {
83
-        $results = wp_remote_head($src);
84
-        if (is_array($results) && ! $results instanceof WP_Error) {
85
-            return strpos($results['headers']['content-type'], "image") !== false;
86
-        } else {
87
-            return false;
88
-        }
89
-    }
75
+	/**
76
+	 * Asserts an image actually exists as quickly as possible by sending a HEAD
77
+	 * request
78
+	 * @param string $src
79
+	 * @return boolean
80
+	 */
81
+	protected function src_exists($src)
82
+	{
83
+		$results = wp_remote_head($src);
84
+		if (is_array($results) && ! $results instanceof WP_Error) {
85
+			return strpos($results['headers']['content-type'], "image") !== false;
86
+		} else {
87
+			return false;
88
+		}
89
+	}
90 90
 }
Please login to merge, or discard this patch.
Spacing   +9 added lines, -9 removed lines patch added patch discarded remove patch
@@ -27,7 +27,7 @@  discard block
 block discarded – undo
27 27
         EE_Error::doing_it_wrong(__FUNCTION__, esc_html__('EE_Admin_File_Uploader_Display_Strategy::enqueue_scripts() no longer needs to be called in order to display the admin uploader input correctly. This is handled now by EE_Admin_File_Uploader_Display_Strategy::enqueue_js() which is called automatically when enqueueing JS and CSS for the form', 'event_espresso'), '4.9.8.rc.015');
28 28
         wp_enqueue_media();
29 29
         wp_enqueue_script('media-upload');
30
-        wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL . 'scripts/ee-media-uploader.js');
30
+        wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
31 31
     }
32 32
 
33 33
     /**
@@ -37,7 +37,7 @@  discard block
 block discarded – undo
37 37
     {
38 38
         wp_enqueue_media();
39 39
         wp_enqueue_script('media-upload');
40
-        wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL . 'scripts/ee-media-uploader.js');
40
+        wp_enqueue_script('ee-payments', EE_GLOBAL_ASSETS_URL.'scripts/ee-media-uploader.js');
41 41
         parent::enqueue_js();
42 42
     }
43 43
 
@@ -52,22 +52,22 @@  discard block
 block discarded – undo
52 52
     {
53 53
         // the actual input
54 54
         $input = '<input type="text" size="34" ';
55
-        $input .= 'name="' . $this->_input->html_name() . '" ';
56
-        $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url ' . $this->_input->html_class() . '" ' : 'class="large-text ee_media_url" ';
57
-        $input .= 'value="' . $this->_input->raw_value_in_form() . '" ';
58
-        $input .= $this->_input->other_html_attributes() . '>';
55
+        $input .= 'name="'.$this->_input->html_name().'" ';
56
+        $input .= $this->_input->html_class() != '' ? 'class="large-text ee_media_url '.$this->_input->html_class().'" ' : 'class="large-text ee_media_url" ';
57
+        $input .= 'value="'.$this->_input->raw_value_in_form().'" ';
58
+        $input .= $this->_input->other_html_attributes().'>';
59 59
         // image uploader
60 60
         $uploader = EEH_HTML::link(
61 61
             '#',
62
-            '<img src="' . admin_url('images/media-button-image.gif') . '" >',
62
+            '<img src="'.admin_url('images/media-button-image.gif').'" >',
63 63
             esc_html__('click to add an image', 'event_espresso'),
64 64
             '',
65 65
             'ee_media_upload button'
66 66
         );
67 67
         // only attempt to show the image if it at least exists
68
-        $image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2) . EEH_HTML::img($this->_input->raw_value(), esc_html__('logo', 'event_espresso'), '', 'ee_media_image') : '';
68
+        $image = $this->src_exists($this->_input->raw_value()) ? EEH_HTML::br(2).EEH_HTML::img($this->_input->raw_value(), esc_html__('logo', 'event_espresso'), '', 'ee_media_image') : '';
69 69
         // html string
70
-        return EEH_HTML::div($input . EEH_HTML::nbsp() . $uploader . $image, '', 'ee_media_uploader_area');
70
+        return EEH_HTML::div($input.EEH_HTML::nbsp().$uploader.$image, '', 'ee_media_uploader_area');
71 71
     }
72 72
 
73 73
 
Please login to merge, or discard this patch.