Completed
Branch FET-10486-add-timestamp-checki... (786b14)
by
unknown
79:06 queued 65:28
created
public/Espresso_Arabica_2014/content-espresso_events-header.php 1 patch
Spacing   +2 added lines, -2 removed lines patch added patch discarded remove patch
@@ -5,9 +5,9 @@
 block discarded – undo
5 5
 ?>
6 6
 <header class="event-header">
7 7
 	<?php echo "<{$tag}  id=\"event-details-{$tag}-{$post->ID}\" class=\"entry-title\">"; ?>
8
-		<a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target();?>>
8
+		<a class="ee-event-header-lnk" href="<?php the_permalink(); ?>"<?php echo \EED_Events_Archive::link_target(); ?>>
9 9
             <?php the_title(); ?>
10 10
         </a>
11 11
 	<?php echo "</{$tag}"; ?>
12
-	<?php if ( ! is_archive() && has_excerpt( $post->ID )): the_excerpt(); endif;?>
12
+	<?php if ( ! is_archive() && has_excerpt($post->ID)): the_excerpt(); endif; ?>
13 13
 </header>
Please login to merge, or discard this patch.
core/db_classes/EE_Ticket.class.php 3 patches
Doc Comments   +2 added lines, -1 removed lines patch added patch discarded remove patch
@@ -128,7 +128,8 @@
 block discarded – undo
128 128
      *
129 129
      * @param bool        $display   true = we'll return a localized string, otherwise we just return the value of the relevant status const
130 130
      * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing
131
-     * @return mixed status int if the display string isn't requested
131
+     * @param boolean $remaining
132
+     * @return string status int if the display string isn't requested
132 133
      * @throws \EE_Error
133 134
      */
134 135
 	public function ticket_status( $display = FALSE, $remaining = null ) {
Please login to merge, or discard this patch.
Indentation   +566 added lines, -566 removed lines patch added patch discarded remove patch
@@ -61,15 +61,15 @@  discard block
 block discarded – undo
61 61
 
62 62
 
63 63
 
64
-    /**
65
-     * @param array  $props_n_values          incoming values
66
-     * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
67
-     *                                        used.)
68
-     * @param array  $date_formats            incoming date_formats in an array where the first value is the
69
-     *                                        date_format and the second value is the time format
70
-     * @return EE_Ticket
71
-     * @throws \EE_Error
72
-     */
64
+	/**
65
+	 * @param array  $props_n_values          incoming values
66
+	 * @param string $timezone                incoming timezone (if not set the timezone set for the website will be
67
+	 *                                        used.)
68
+	 * @param array  $date_formats            incoming date_formats in an array where the first value is the
69
+	 *                                        date_format and the second value is the time format
70
+	 * @return EE_Ticket
71
+	 * @throws \EE_Error
72
+	 */
73 73
 	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
74 74
 		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
75 75
 		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
@@ -77,36 +77,36 @@  discard block
 block discarded – undo
77 77
 
78 78
 
79 79
 
80
-    /**
81
-     * @param array  $props_n_values  incoming values from the database
82
-     * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
83
-     *                                the website will be used.
84
-     * @return EE_Ticket
85
-     * @throws \EE_Error
86
-     */
80
+	/**
81
+	 * @param array  $props_n_values  incoming values from the database
82
+	 * @param string $timezone        incoming timezone as set by the model.  If not set the timezone for
83
+	 *                                the website will be used.
84
+	 * @return EE_Ticket
85
+	 * @throws \EE_Error
86
+	 */
87 87
 	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
88 88
 		return new self( $props_n_values, TRUE, $timezone );
89 89
 	}
90 90
 
91 91
 
92 92
 
93
-    /**
94
-     * @return bool
95
-     * @throws \EE_Error
96
-     */
93
+	/**
94
+	 * @return bool
95
+	 * @throws \EE_Error
96
+	 */
97 97
 	public function parent() {
98 98
 		return $this->get( 'TKT_parent' );
99 99
 	}
100 100
 
101 101
 
102 102
 
103
-    /**
104
-     * return if a ticket has quantities available for purchase
105
-     *
106
-     * @param  int $DTT_ID the primary key for a particular datetime
107
-     * @return boolean
108
-     * @throws \EE_Error
109
-     */
103
+	/**
104
+	 * return if a ticket has quantities available for purchase
105
+	 *
106
+	 * @param  int $DTT_ID the primary key for a particular datetime
107
+	 * @return boolean
108
+	 * @throws \EE_Error
109
+	 */
110 110
 	public function available( $DTT_ID = 0 ) {
111 111
 		// are we checking availability for a particular datetime ?
112 112
 		if ( $DTT_ID ) {
@@ -123,14 +123,14 @@  discard block
 block discarded – undo
123 123
 
124 124
 
125 125
 
126
-    /**
127
-     * Using the start date and end date this method calculates whether the ticket is On Sale, Pending, or Expired
128
-     *
129
-     * @param bool        $display   true = we'll return a localized string, otherwise we just return the value of the relevant status const
130
-     * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing
131
-     * @return mixed status int if the display string isn't requested
132
-     * @throws \EE_Error
133
-     */
126
+	/**
127
+	 * Using the start date and end date this method calculates whether the ticket is On Sale, Pending, or Expired
128
+	 *
129
+	 * @param bool        $display   true = we'll return a localized string, otherwise we just return the value of the relevant status const
130
+	 * @param bool | null $remaining if it is already known that tickets are available, then simply pass a bool to save further processing
131
+	 * @return mixed status int if the display string isn't requested
132
+	 * @throws \EE_Error
133
+	 */
134 134
 	public function ticket_status( $display = FALSE, $remaining = null ) {
135 135
 		$remaining = is_bool( $remaining ) ? $remaining : $this->is_remaining();
136 136
 		if ( ! $remaining ) {
@@ -153,14 +153,14 @@  discard block
 block discarded – undo
153 153
 
154 154
 
155 155
 
156
-    /**
157
-     * The purpose of this method is to simply return a boolean for whether there are any tickets remaining for sale considering ALL the factors used for figuring that out.
158
-     *
159
-     * @access public
160
-     * @param  int $DTT_ID if an int above 0 is included here then we get a specific dtt.
161
-     * @return boolean         true = tickets remaining, false not.
162
-     * @throws \EE_Error
163
-     */
156
+	/**
157
+	 * The purpose of this method is to simply return a boolean for whether there are any tickets remaining for sale considering ALL the factors used for figuring that out.
158
+	 *
159
+	 * @access public
160
+	 * @param  int $DTT_ID if an int above 0 is included here then we get a specific dtt.
161
+	 * @return boolean         true = tickets remaining, false not.
162
+	 * @throws \EE_Error
163
+	 */
164 164
 	public function is_remaining( $DTT_ID = 0 ) {
165 165
 		$num_remaining = $this->remaining( $DTT_ID );
166 166
 		if ( $num_remaining === 0 ) {
@@ -174,76 +174,76 @@  discard block
 block discarded – undo
174 174
 
175 175
 
176 176
 
177
-    /**
178
-     * return the total number of tickets available for purchase
179
-     *
180
-     * @param  int $DTT_ID the primary key for a particular datetime.
181
-     *                     set to 0 for all related datetimes
182
-     * @return int
183
-     * @throws \EE_Error
184
-     */
177
+	/**
178
+	 * return the total number of tickets available for purchase
179
+	 *
180
+	 * @param  int $DTT_ID the primary key for a particular datetime.
181
+	 *                     set to 0 for all related datetimes
182
+	 * @return int
183
+	 * @throws \EE_Error
184
+	 */
185 185
 	public function remaining( $DTT_ID = 0 ) {
186 186
 		return $this->real_quantity_on_ticket('saleable', $DTT_ID );
187 187
 	}
188 188
 
189 189
 
190 190
 
191
-    /**
192
-     * Gets min
193
-     *
194
-     * @return int
195
-     * @throws \EE_Error
196
-     */
191
+	/**
192
+	 * Gets min
193
+	 *
194
+	 * @return int
195
+	 * @throws \EE_Error
196
+	 */
197 197
 	public function min() {
198 198
 		return $this->get( 'TKT_min' );
199 199
 	}
200 200
 
201 201
 
202 202
 
203
-    /**
204
-     * return if a ticket is no longer available cause its available dates have expired.
205
-     *
206
-     * @return boolean
207
-     * @throws \EE_Error
208
-     */
203
+	/**
204
+	 * return if a ticket is no longer available cause its available dates have expired.
205
+	 *
206
+	 * @return boolean
207
+	 * @throws \EE_Error
208
+	 */
209 209
 	public function is_expired() {
210 210
 		return ( $this->get_raw( 'TKT_end_date' ) < time() );
211 211
 	}
212 212
 
213 213
 
214 214
 
215
-    /**
216
-     * Return if a ticket is yet to go on sale or not
217
-     *
218
-     * @return boolean
219
-     * @throws \EE_Error
220
-     */
215
+	/**
216
+	 * Return if a ticket is yet to go on sale or not
217
+	 *
218
+	 * @return boolean
219
+	 * @throws \EE_Error
220
+	 */
221 221
 	public function is_pending() {
222 222
 		return ( $this->get_raw( 'TKT_start_date' ) > time() );
223 223
 	}
224 224
 
225 225
 
226 226
 
227
-    /**
228
-     * Return if a ticket is on sale or not
229
-     *
230
-     * @return boolean
231
-     * @throws \EE_Error
232
-     */
227
+	/**
228
+	 * Return if a ticket is on sale or not
229
+	 *
230
+	 * @return boolean
231
+	 * @throws \EE_Error
232
+	 */
233 233
 	public function is_on_sale() {
234 234
 		return ( $this->get_raw( 'TKT_start_date' ) < time() && $this->get_raw( 'TKT_end_date' ) > time() );
235 235
 	}
236 236
 
237 237
 
238 238
 
239
-    /**
240
-     * This returns the chronologically last datetime that this ticket is associated with
241
-     *
242
-     * @param string $dt_frmt
243
-     * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31
244
-     * @return string
245
-     * @throws \EE_Error
246
-     */
239
+	/**
240
+	 * This returns the chronologically last datetime that this ticket is associated with
241
+	 *
242
+	 * @param string $dt_frmt
243
+	 * @param string $conjunction - conjunction junction what's your function ? this string joins the start date with the end date ie: Jan 01 "to" Dec 31
244
+	 * @return string
245
+	 * @throws \EE_Error
246
+	 */
247 247
 	public function date_range( $dt_frmt = '', $conjunction = ' - ' ) {
248 248
 		$first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date( $dt_frmt ) : '';
249 249
 		$last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date( $dt_frmt ) : '';
@@ -253,12 +253,12 @@  discard block
 block discarded – undo
253 253
 
254 254
 
255 255
 
256
-    /**
257
-     * This returns the chronologically first datetime that this ticket is associated with
258
-     *
259
-     * @return EE_Datetime
260
-     * @throws \EE_Error
261
-     */
256
+	/**
257
+	 * This returns the chronologically first datetime that this ticket is associated with
258
+	 *
259
+	 * @return EE_Datetime
260
+	 * @throws \EE_Error
261
+	 */
262 262
 	public function first_datetime() {
263 263
 		$datetimes = $this->datetimes( array( 'limit' => 1 ) );
264 264
 		return reset( $datetimes );
@@ -266,14 +266,14 @@  discard block
 block discarded – undo
266 266
 
267 267
 
268 268
 
269
-    /**
270
-     * Gets all the datetimes this ticket can be used for attending.
271
-     * Unless otherwise specified, orders datetimes by start date.
272
-     *
273
-     * @param array $query_params see EEM_Base::get_all()
274
-     * @return EE_Datetime[]|EE_Base_Class[]
275
-     * @throws \EE_Error
276
-     */
269
+	/**
270
+	 * Gets all the datetimes this ticket can be used for attending.
271
+	 * Unless otherwise specified, orders datetimes by start date.
272
+	 *
273
+	 * @param array $query_params see EEM_Base::get_all()
274
+	 * @return EE_Datetime[]|EE_Base_Class[]
275
+	 * @throws \EE_Error
276
+	 */
277 277
 	public function datetimes( $query_params = array() ) {
278 278
 		if ( ! isset( $query_params[ 'order_by' ] ) ) {
279 279
 			$query_params[ 'order_by' ][ 'DTT_order' ] = 'ASC';
@@ -283,12 +283,12 @@  discard block
 block discarded – undo
283 283
 
284 284
 
285 285
 
286
-    /**
287
-     * This returns the chronologically last datetime that this ticket is associated with
288
-     *
289
-     * @return EE_Datetime
290
-     * @throws \EE_Error
291
-     */
286
+	/**
287
+	 * This returns the chronologically last datetime that this ticket is associated with
288
+	 *
289
+	 * @return EE_Datetime
290
+	 * @throws \EE_Error
291
+	 */
292 292
 	public function last_datetime() {
293 293
 		$datetimes = $this->datetimes( array( 'limit' => 1, 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) ) );
294 294
 		return end( $datetimes );
@@ -296,19 +296,19 @@  discard block
 block discarded – undo
296 296
 
297 297
 
298 298
 
299
-    /**
300
-     * This returns the total tickets sold depending on the given parameters.
301
-     *
302
-     * @param  string $what   Can be one of two options: 'ticket', 'datetime'.
303
-     *                        'ticket' = total ticket sales for all datetimes this ticket is related to
304
-     *                        'datetime' = total ticket sales for a specified datetime (required $dtt_id)
305
-     *                        'datetime' = total ticket sales in the datetime_ticket table.
306
-     *                        If $dtt_id is not given then we return an array of sales indexed by datetime.
307
-     *                        If $dtt_id IS given then we return the tickets sold for that given datetime.
308
-     * @param  int    $dtt_id [optional] include the dtt_id with $what = 'datetime'.
309
-     * @return mixed (array|int)          how many tickets have sold
310
-     * @throws \EE_Error
311
-     */
299
+	/**
300
+	 * This returns the total tickets sold depending on the given parameters.
301
+	 *
302
+	 * @param  string $what   Can be one of two options: 'ticket', 'datetime'.
303
+	 *                        'ticket' = total ticket sales for all datetimes this ticket is related to
304
+	 *                        'datetime' = total ticket sales for a specified datetime (required $dtt_id)
305
+	 *                        'datetime' = total ticket sales in the datetime_ticket table.
306
+	 *                        If $dtt_id is not given then we return an array of sales indexed by datetime.
307
+	 *                        If $dtt_id IS given then we return the tickets sold for that given datetime.
308
+	 * @param  int    $dtt_id [optional] include the dtt_id with $what = 'datetime'.
309
+	 * @return mixed (array|int)          how many tickets have sold
310
+	 * @throws \EE_Error
311
+	 */
312 312
 	public function tickets_sold( $what = 'ticket', $dtt_id = NULL ) {
313 313
 		$total = 0;
314 314
 		$tickets_sold = $this->_all_tickets_sold();
@@ -333,12 +333,12 @@  discard block
 block discarded – undo
333 333
 
334 334
 
335 335
 
336
-    /**
337
-     * This returns an array indexed by datetime_id for tickets sold with this ticket.
338
-     *
339
-     * @return EE_Ticket[]
340
-     * @throws \EE_Error
341
-     */
336
+	/**
337
+	 * This returns an array indexed by datetime_id for tickets sold with this ticket.
338
+	 *
339
+	 * @return EE_Ticket[]
340
+	 * @throws \EE_Error
341
+	 */
342 342
 	protected function _all_tickets_sold() {
343 343
 		$datetimes = $this->get_many_related( 'Datetime' );
344 344
 		$tickets_sold = array();
@@ -354,29 +354,29 @@  discard block
 block discarded – undo
354 354
 
355 355
 
356 356
 
357
-    /**
358
-     * This returns the base price object for the ticket.
359
-     *
360
-     * @param  bool $return_array whether to return as an array indexed by price id or just the object.
361
-     * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[]
362
-     * @throws \EE_Error
363
-     */
357
+	/**
358
+	 * This returns the base price object for the ticket.
359
+	 *
360
+	 * @param  bool $return_array whether to return as an array indexed by price id or just the object.
361
+	 * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[]
362
+	 * @throws \EE_Error
363
+	 */
364 364
 	public function base_price( $return_array = FALSE ) {
365 365
 		$_where = array( 'Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price );
366 366
 		return $return_array
367
-            ? $this->get_many_related( 'Price', array( $_where ) )
368
-            : $this->get_first_related( 'Price', array( $_where ) );
367
+			? $this->get_many_related( 'Price', array( $_where ) )
368
+			: $this->get_first_related( 'Price', array( $_where ) );
369 369
 	}
370 370
 
371 371
 
372 372
 
373
-    /**
374
-     * This returns ONLY the price modifiers for the ticket (i.e. no taxes or base price)
375
-     *
376
-     * @access public
377
-     * @return EE_Price[]
378
-     * @throws \EE_Error
379
-     */
373
+	/**
374
+	 * This returns ONLY the price modifiers for the ticket (i.e. no taxes or base price)
375
+	 *
376
+	 * @access public
377
+	 * @return EE_Price[]
378
+	 * @throws \EE_Error
379
+	 */
380 380
 	public function price_modifiers() {
381 381
 		$query_params = array( 0 => array( 'Price_Type.PBT_ID' => array( 'NOT IN', array( EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax ) ) ) );
382 382
 		return $this->prices( $query_params );
@@ -384,132 +384,132 @@  discard block
 block discarded – undo
384 384
 
385 385
 
386 386
 
387
-    /**
388
-     * Gets all the prices that combine to form the final price of this ticket
389
-     *
390
-     * @param array $query_params like EEM_Base::get_all
391
-     * @return EE_Price[]|EE_Base_Class[]
392
-     * @throws \EE_Error
393
-     */
387
+	/**
388
+	 * Gets all the prices that combine to form the final price of this ticket
389
+	 *
390
+	 * @param array $query_params like EEM_Base::get_all
391
+	 * @return EE_Price[]|EE_Base_Class[]
392
+	 * @throws \EE_Error
393
+	 */
394 394
 	public function prices( $query_params = array() ) {
395 395
 		return $this->get_many_related( 'Price', $query_params );
396 396
 	}
397 397
 
398 398
 
399 399
 
400
-    /**
401
-     * Gets all the ticket applicabilities (ie, relations between datetimes and tickets)
402
-     *
403
-     * @param array $query_params see EEM_Base::get_all()
404
-     * @return EE_Datetime_Ticket|EE_Base_Class[]
405
-     * @throws \EE_Error
406
-     */
400
+	/**
401
+	 * Gets all the ticket applicabilities (ie, relations between datetimes and tickets)
402
+	 *
403
+	 * @param array $query_params see EEM_Base::get_all()
404
+	 * @return EE_Datetime_Ticket|EE_Base_Class[]
405
+	 * @throws \EE_Error
406
+	 */
407 407
 	public function datetime_tickets( $query_params = array() ) {
408 408
 		return $this->get_many_related( 'Datetime_Ticket', $query_params );
409 409
 	}
410 410
 
411 411
 
412 412
 
413
-    /**
414
-     * Gets all the datetimes from the db ordered by DTT_order
415
-     *
416
-     * @param boolean $show_expired
417
-     * @param boolean $show_deleted
418
-     * @return EE_Datetime[]
419
-     * @throws \EE_Error
420
-     */
413
+	/**
414
+	 * Gets all the datetimes from the db ordered by DTT_order
415
+	 *
416
+	 * @param boolean $show_expired
417
+	 * @param boolean $show_deleted
418
+	 * @return EE_Datetime[]
419
+	 * @throws \EE_Error
420
+	 */
421 421
 	public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE ) {
422 422
 		return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_ticket_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted );
423 423
 	}
424 424
 
425 425
 
426 426
 
427
-    /**
428
-     * Gets ID
429
-     *
430
-     * @return string
431
-     * @throws \EE_Error
432
-     */
427
+	/**
428
+	 * Gets ID
429
+	 *
430
+	 * @return string
431
+	 * @throws \EE_Error
432
+	 */
433 433
 	public function ID() {
434 434
 		return $this->get( 'TKT_ID' );
435 435
 	}
436 436
 
437 437
 
438 438
 
439
-    /**
440
-     * get the author of the ticket.
441
-     *
442
-     * @since 4.5.0
443
-     * @return int
444
-     * @throws \EE_Error
445
-     */
439
+	/**
440
+	 * get the author of the ticket.
441
+	 *
442
+	 * @since 4.5.0
443
+	 * @return int
444
+	 * @throws \EE_Error
445
+	 */
446 446
 	public function wp_user() {
447 447
 		return $this->get('TKT_wp_user');
448 448
 	}
449 449
 
450 450
 
451 451
 
452
-    /**
453
-     * Gets the template for the ticket
454
-     *
455
-     * @return EE_Ticket_Template|EE_Base_Class
456
-     * @throws \EE_Error
457
-     */
452
+	/**
453
+	 * Gets the template for the ticket
454
+	 *
455
+	 * @return EE_Ticket_Template|EE_Base_Class
456
+	 * @throws \EE_Error
457
+	 */
458 458
 	public function template() {
459 459
 		return $this->get_first_related( 'Ticket_Template' );
460 460
 	}
461 461
 
462 462
 
463 463
 
464
-    /**
465
-     * Simply returns an array of EE_Price objects that are taxes.
466
-     *
467
-     * @return EE_Price[]
468
-     * @throws \EE_Error
469
-     */
464
+	/**
465
+	 * Simply returns an array of EE_Price objects that are taxes.
466
+	 *
467
+	 * @return EE_Price[]
468
+	 * @throws \EE_Error
469
+	 */
470 470
 	public function get_ticket_taxes_for_admin() {
471 471
 		return EE_Taxes::get_taxes_for_admin();
472 472
 	}
473 473
 
474 474
 
475 475
 
476
-    /**
477
-     * @return float
478
-     * @throws \EE_Error
479
-     */
476
+	/**
477
+	 * @return float
478
+	 * @throws \EE_Error
479
+	 */
480 480
 	public function ticket_price() {
481 481
 		return $this->get( 'TKT_price' );
482 482
 	}
483 483
 
484 484
 
485 485
 
486
-    /**
487
-     * @return mixed
488
-     * @throws \EE_Error
489
-     */
486
+	/**
487
+	 * @return mixed
488
+	 * @throws \EE_Error
489
+	 */
490 490
 	public function pretty_price() {
491 491
 		return $this->get_pretty( 'TKT_price' );
492 492
 	}
493 493
 
494 494
 
495 495
 
496
-    /**
497
-     * @return bool
498
-     * @throws \EE_Error
499
-     */
496
+	/**
497
+	 * @return bool
498
+	 * @throws \EE_Error
499
+	 */
500 500
 	public function is_free() {
501 501
 		return $this->get_ticket_total_with_taxes() === 0;
502 502
 	}
503 503
 
504 504
 
505 505
 
506
-    /**
507
-     * get_ticket_total_with_taxes
508
-     *
509
-     * @param bool $no_cache
510
-     * @return float
511
-     * @throws \EE_Error
512
-     */
506
+	/**
507
+	 * get_ticket_total_with_taxes
508
+	 *
509
+	 * @param bool $no_cache
510
+	 * @return float
511
+	 * @throws \EE_Error
512
+	 */
513 513
 	public function get_ticket_total_with_taxes( $no_cache = FALSE ) {
514 514
 		if ($this->_ticket_total_with_taxes === null || $no_cache ) {
515 515
 			$this->_ticket_total_with_taxes = $this->get_ticket_subtotal() + $this->get_ticket_taxes_total_for_admin();
@@ -526,201 +526,201 @@  discard block
 block discarded – undo
526 526
 
527 527
 
528 528
 
529
-    /**
530
-     * @return float
531
-     * @throws \EE_Error
532
-     */
529
+	/**
530
+	 * @return float
531
+	 * @throws \EE_Error
532
+	 */
533 533
 	public function get_ticket_subtotal() {
534 534
 		return EE_Taxes::get_subtotal_for_admin( $this );
535 535
 	}
536 536
 
537 537
 
538 538
 
539
-    /**
540
-     * Returns the total taxes applied to this ticket
541
-     *
542
-     * @return float
543
-     * @throws \EE_Error
544
-     */
539
+	/**
540
+	 * Returns the total taxes applied to this ticket
541
+	 *
542
+	 * @return float
543
+	 * @throws \EE_Error
544
+	 */
545 545
 	public function get_ticket_taxes_total_for_admin() {
546 546
 		return EE_Taxes::get_total_taxes_for_admin( $this );
547 547
 	}
548 548
 
549 549
 
550 550
 
551
-    /**
552
-     * Sets name
553
-     *
554
-     * @param string $name
555
-     * @throws \EE_Error
556
-     */
551
+	/**
552
+	 * Sets name
553
+	 *
554
+	 * @param string $name
555
+	 * @throws \EE_Error
556
+	 */
557 557
 	public function set_name( $name ) {
558 558
 		$this->set( 'TKT_name', $name );
559 559
 	}
560 560
 
561 561
 
562 562
 
563
-    /**
564
-     * Gets description
565
-     *
566
-     * @return string
567
-     * @throws \EE_Error
568
-     */
563
+	/**
564
+	 * Gets description
565
+	 *
566
+	 * @return string
567
+	 * @throws \EE_Error
568
+	 */
569 569
 	public function description() {
570 570
 		return $this->get( 'TKT_description' );
571 571
 	}
572 572
 
573 573
 
574 574
 
575
-    /**
576
-     * Sets description
577
-     *
578
-     * @param string $description
579
-     * @throws \EE_Error
580
-     */
575
+	/**
576
+	 * Sets description
577
+	 *
578
+	 * @param string $description
579
+	 * @throws \EE_Error
580
+	 */
581 581
 	public function set_description( $description ) {
582 582
 		$this->set( 'TKT_description', $description );
583 583
 	}
584 584
 
585 585
 
586 586
 
587
-    /**
588
-     * Gets start_date
589
-     *
590
-     * @param string $dt_frmt
591
-     * @param string $tm_frmt
592
-     * @return string
593
-     * @throws \EE_Error
594
-     */
587
+	/**
588
+	 * Gets start_date
589
+	 *
590
+	 * @param string $dt_frmt
591
+	 * @param string $tm_frmt
592
+	 * @return string
593
+	 * @throws \EE_Error
594
+	 */
595 595
 	public function start_date( $dt_frmt = '', $tm_frmt = '' ) {
596 596
 		return $this->_get_datetime( 'TKT_start_date', $dt_frmt, $tm_frmt );
597 597
 	}
598 598
 
599 599
 
600 600
 
601
-    /**
602
-     * Sets start_date
603
-     *
604
-     * @param string $start_date
605
-     * @return void
606
-     * @throws \EE_Error
607
-     */
601
+	/**
602
+	 * Sets start_date
603
+	 *
604
+	 * @param string $start_date
605
+	 * @return void
606
+	 * @throws \EE_Error
607
+	 */
608 608
 	public function set_start_date( $start_date ) {
609 609
 		$this->_set_date_time( 'B', $start_date, 'TKT_start_date' );
610 610
 	}
611 611
 
612 612
 
613 613
 
614
-    /**
615
-     * Gets end_date
616
-     *
617
-     * @param string $dt_frmt
618
-     * @param string $tm_frmt
619
-     * @return string
620
-     * @throws \EE_Error
621
-     */
614
+	/**
615
+	 * Gets end_date
616
+	 *
617
+	 * @param string $dt_frmt
618
+	 * @param string $tm_frmt
619
+	 * @return string
620
+	 * @throws \EE_Error
621
+	 */
622 622
 	public function end_date( $dt_frmt = '', $tm_frmt = '' ) {
623 623
 		return $this->_get_datetime( 'TKT_end_date', $dt_frmt, $tm_frmt );
624 624
 	}
625 625
 
626 626
 
627 627
 
628
-    /**
629
-     * Sets end_date
630
-     *
631
-     * @param string $end_date
632
-     * @return void
633
-     * @throws \EE_Error
634
-     */
628
+	/**
629
+	 * Sets end_date
630
+	 *
631
+	 * @param string $end_date
632
+	 * @return void
633
+	 * @throws \EE_Error
634
+	 */
635 635
 	public function set_end_date( $end_date ) {
636 636
 		$this->_set_date_time( 'B', $end_date, 'TKT_end_date' );
637 637
 	}
638 638
 
639 639
 
640 640
 
641
-    /**
642
-     * Sets sell until time
643
-     *
644
-     * @since 4.5.0
645
-     * @param string $time a string representation of the sell until time (ex 9am or 7:30pm)
646
-     * @throws \EE_Error
647
-     */
641
+	/**
642
+	 * Sets sell until time
643
+	 *
644
+	 * @since 4.5.0
645
+	 * @param string $time a string representation of the sell until time (ex 9am or 7:30pm)
646
+	 * @throws \EE_Error
647
+	 */
648 648
 	public function set_end_time( $time ) {
649 649
 		$this->_set_time_for( $time, 'TKT_end_date' );
650 650
 	}
651 651
 
652 652
 
653 653
 
654
-    /**
655
-     * Sets min
656
-     *
657
-     * @param int $min
658
-     * @return void
659
-     * @throws \EE_Error
660
-     */
654
+	/**
655
+	 * Sets min
656
+	 *
657
+	 * @param int $min
658
+	 * @return void
659
+	 * @throws \EE_Error
660
+	 */
661 661
 	public function set_min( $min ) {
662 662
 		$this->set( 'TKT_min', $min );
663 663
 	}
664 664
 
665 665
 
666 666
 
667
-    /**
668
-     * Gets max
669
-     *
670
-     * @return int
671
-     * @throws \EE_Error
672
-     */
667
+	/**
668
+	 * Gets max
669
+	 *
670
+	 * @return int
671
+	 * @throws \EE_Error
672
+	 */
673 673
 	public function max() {
674 674
 		return $this->get( 'TKT_max' );
675 675
 	}
676 676
 
677 677
 
678 678
 
679
-    /**
680
-     * Sets max
681
-     *
682
-     * @param int $max
683
-     * @return void
684
-     * @throws \EE_Error
685
-     */
679
+	/**
680
+	 * Sets max
681
+	 *
682
+	 * @param int $max
683
+	 * @return void
684
+	 * @throws \EE_Error
685
+	 */
686 686
 	public function set_max( $max ) {
687 687
 		$this->set( 'TKT_max', $max );
688 688
 	}
689 689
 
690 690
 
691 691
 
692
-    /**
693
-     * Sets price
694
-     *
695
-     * @param float $price
696
-     * @return void
697
-     * @throws \EE_Error
698
-     */
692
+	/**
693
+	 * Sets price
694
+	 *
695
+	 * @param float $price
696
+	 * @return void
697
+	 * @throws \EE_Error
698
+	 */
699 699
 	public function set_price( $price ) {
700 700
 		$this->set( 'TKT_price', $price );
701 701
 	}
702 702
 
703 703
 
704 704
 
705
-    /**
706
-     * Gets sold
707
-     *
708
-     * @return int
709
-     * @throws \EE_Error
710
-     */
705
+	/**
706
+	 * Gets sold
707
+	 *
708
+	 * @return int
709
+	 * @throws \EE_Error
710
+	 */
711 711
 	public function sold() {
712 712
 		return $this->get_raw( 'TKT_sold' );
713 713
 	}
714 714
 
715 715
 
716 716
 
717
-    /**
718
-     * Sets sold
719
-     *
720
-     * @param int $sold
721
-     * @return void
722
-     * @throws \EE_Error
723
-     */
717
+	/**
718
+	 * Sets sold
719
+	 *
720
+	 * @param int $sold
721
+	 * @return void
722
+	 * @throws \EE_Error
723
+	 */
724 724
 	public function set_sold( $sold ) {
725 725
 		// sold can not go below zero
726 726
 		$sold = max( 0, $sold );
@@ -729,13 +729,13 @@  discard block
 block discarded – undo
729 729
 
730 730
 
731 731
 
732
-    /**
733
-     * increments sold by amount passed by $qty
734
-     *
735
-     * @param int $qty
736
-     * @return void
737
-     * @throws \EE_Error
738
-     */
732
+	/**
733
+	 * increments sold by amount passed by $qty
734
+	 *
735
+	 * @param int $qty
736
+	 * @return void
737
+	 * @throws \EE_Error
738
+	 */
739 739
 	public function increase_sold( $qty = 1 ) {
740 740
 		$sold = $this->sold() + $qty;
741 741
 		// remove ticket reservation, but don't adjust datetime reservations,  because that will happen
@@ -747,13 +747,13 @@  discard block
 block discarded – undo
747 747
 
748 748
 
749 749
 
750
-    /**
751
-     * Increases sold on related datetimes
752
-     *
753
-     * @param int $qty
754
-     * @return void
755
-     * @throws \EE_Error
756
-     */
750
+	/**
751
+	 * Increases sold on related datetimes
752
+	 *
753
+	 * @param int $qty
754
+	 * @return void
755
+	 * @throws \EE_Error
756
+	 */
757 757
 	protected function _increase_sold_for_datetimes( $qty = 1 ) {
758 758
 		$datetimes = $this->datetimes();
759 759
 		if ( is_array( $datetimes ) ) {
@@ -768,13 +768,13 @@  discard block
 block discarded – undo
768 768
 
769 769
 
770 770
 
771
-    /**
772
-     * decrements (subtracts) sold by amount passed by $qty
773
-     *
774
-     * @param int $qty
775
-     * @return void
776
-     * @throws \EE_Error
777
-     */
771
+	/**
772
+	 * decrements (subtracts) sold by amount passed by $qty
773
+	 *
774
+	 * @param int $qty
775
+	 * @return void
776
+	 * @throws \EE_Error
777
+	 */
778 778
 	public function decrease_sold( $qty = 1 ) {
779 779
 		$sold = $this->sold() - $qty;
780 780
 		$this->_decrease_sold_for_datetimes( $qty );
@@ -783,13 +783,13 @@  discard block
 block discarded – undo
783 783
 
784 784
 
785 785
 
786
-    /**
787
-     * Decreases sold on related datetimes
788
-     *
789
-     * @param int $qty
790
-     * @return void
791
-     * @throws \EE_Error
792
-     */
786
+	/**
787
+	 * Decreases sold on related datetimes
788
+	 *
789
+	 * @param int $qty
790
+	 * @return void
791
+	 * @throws \EE_Error
792
+	 */
793 793
 	protected function _decrease_sold_for_datetimes( $qty = 1 ) {
794 794
 		$datetimes = $this->datetimes();
795 795
 		if ( is_array( $datetimes ) ) {
@@ -804,25 +804,25 @@  discard block
 block discarded – undo
804 804
 
805 805
 
806 806
 
807
-    /**
808
-     * Gets qty of reserved tickets
809
-     *
810
-     * @return int
811
-     * @throws \EE_Error
812
-     */
807
+	/**
808
+	 * Gets qty of reserved tickets
809
+	 *
810
+	 * @return int
811
+	 * @throws \EE_Error
812
+	 */
813 813
 	public function reserved() {
814 814
 		return $this->get_raw( 'TKT_reserved' );
815 815
 	}
816 816
 
817 817
 
818 818
 
819
-    /**
820
-     * Sets reserved
821
-     *
822
-     * @param int $reserved
823
-     * @return void
824
-     * @throws \EE_Error
825
-     */
819
+	/**
820
+	 * Sets reserved
821
+	 *
822
+	 * @param int $reserved
823
+	 * @return void
824
+	 * @throws \EE_Error
825
+	 */
826 826
 	public function set_reserved( $reserved ) {
827 827
 		// reserved can not go below zero
828 828
 		$reserved = max( 0, (int) $reserved );
@@ -831,13 +831,13 @@  discard block
 block discarded – undo
831 831
 
832 832
 
833 833
 
834
-    /**
835
-     * increments reserved by amount passed by $qty
836
-     *
837
-     * @param int $qty
838
-     * @return void
839
-     * @throws \EE_Error
840
-     */
834
+	/**
835
+	 * increments reserved by amount passed by $qty
836
+	 *
837
+	 * @param int $qty
838
+	 * @return void
839
+	 * @throws \EE_Error
840
+	 */
841 841
 	public function increase_reserved( $qty = 1 ) {
842 842
 		$qty = absint( $qty );
843 843
 		$reserved = $this->reserved() + $qty;
@@ -847,13 +847,13 @@  discard block
 block discarded – undo
847 847
 
848 848
 
849 849
 
850
-    /**
851
-     * Increases sold on related datetimes
852
-     *
853
-     * @param int $qty
854
-     * @return void
855
-     * @throws \EE_Error
856
-     */
850
+	/**
851
+	 * Increases sold on related datetimes
852
+	 *
853
+	 * @param int $qty
854
+	 * @return void
855
+	 * @throws \EE_Error
856
+	 */
857 857
 	protected function _increase_reserved_for_datetimes( $qty = 1 ) {
858 858
 		$datetimes = $this->datetimes();
859 859
 		if ( is_array( $datetimes ) ) {
@@ -868,14 +868,14 @@  discard block
 block discarded – undo
868 868
 
869 869
 
870 870
 
871
-    /**
872
-     * decrements (subtracts) reserved by amount passed by $qty
873
-     *
874
-     * @param int  $qty
875
-     * @param bool $adjust_datetimes
876
-     * @return void
877
-     * @throws \EE_Error
878
-     */
871
+	/**
872
+	 * decrements (subtracts) reserved by amount passed by $qty
873
+	 *
874
+	 * @param int  $qty
875
+	 * @param bool $adjust_datetimes
876
+	 * @return void
877
+	 * @throws \EE_Error
878
+	 */
879 879
 	public function decrease_reserved( $qty = 1, $adjust_datetimes = true ) {
880 880
 		$reserved = $this->reserved() - absint( $qty );
881 881
 		if ( $adjust_datetimes ) {
@@ -886,13 +886,13 @@  discard block
 block discarded – undo
886 886
 
887 887
 
888 888
 
889
-    /**
890
-     * Increases sold on related datetimes
891
-     *
892
-     * @param int $qty
893
-     * @return void
894
-     * @throws \EE_Error
895
-     */
889
+	/**
890
+	 * Increases sold on related datetimes
891
+	 *
892
+	 * @param int $qty
893
+	 * @return void
894
+	 * @throws \EE_Error
895
+	 */
896 896
 	protected function _decrease_reserved_for_datetimes( $qty = 1 ) {
897 897
 		$datetimes = $this->datetimes();
898 898
 		if ( is_array( $datetimes ) ) {
@@ -907,18 +907,18 @@  discard block
 block discarded – undo
907 907
 
908 908
 
909 909
 
910
-    /**
911
-     * Gets ticket quantity
912
-     *
913
-     * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
914
-     *                            therefore $context can be one of three values: '', 'reg_limit', or 'saleable'
915
-     *                            '' (default) quantity is the actual db value for TKT_qty, unaffected by other objects
916
-     *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
917
-     *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
918
-     *                            is therefore the truest measure of tickets that can be purchased at the moment
919
-     * @return int
920
-     * @throws \EE_Error
921
-     */
910
+	/**
911
+	 * Gets ticket quantity
912
+	 *
913
+	 * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
914
+	 *                            therefore $context can be one of three values: '', 'reg_limit', or 'saleable'
915
+	 *                            '' (default) quantity is the actual db value for TKT_qty, unaffected by other objects
916
+	 *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
917
+	 *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
918
+	 *                            is therefore the truest measure of tickets that can be purchased at the moment
919
+	 * @return int
920
+	 * @throws \EE_Error
921
+	 */
922 922
 	public function qty( $context = '' ) {
923 923
 		switch ( $context ) {
924 924
 			case 'reg_limit' :
@@ -932,19 +932,19 @@  discard block
 block discarded – undo
932 932
 
933 933
 
934 934
 
935
-    /**
936
-     * Gets ticket quantity
937
-     *
938
-     * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
939
-     *                            therefore $context can be one of two values: 'reg_limit', or 'saleable'
940
-     *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
941
-     *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
942
-     *                            is therefore the truest measure of tickets that can be purchased at the moment
943
-     * @param  int   $DTT_ID      the primary key for a particular datetime.
944
-     *                            set to 0 for all related datetimes
945
-     * @return int
946
-     * @throws \EE_Error
947
-     */
935
+	/**
936
+	 * Gets ticket quantity
937
+	 *
938
+	 * @param string $context     ticket quantity is somewhat subjective depending on the exact information sought
939
+	 *                            therefore $context can be one of two values: 'reg_limit', or 'saleable'
940
+	 *                            REG LIMIT: caps qty based on DTT_reg_limit for ALL related datetimes
941
+	 *                            SALEABLE: also considers datetime sold and returns zero if ANY DTT is sold out, and
942
+	 *                            is therefore the truest measure of tickets that can be purchased at the moment
943
+	 * @param  int   $DTT_ID      the primary key for a particular datetime.
944
+	 *                            set to 0 for all related datetimes
945
+	 * @return int
946
+	 * @throws \EE_Error
947
+	 */
948 948
 	public function real_quantity_on_ticket( $context = 'reg_limit', $DTT_ID = 0 ) {
949 949
 		$raw = $this->get_raw( 'TKT_qty' );
950 950
 		// return immediately if it's zero
@@ -1027,212 +1027,212 @@  discard block
 block discarded – undo
1027 1027
 
1028 1028
 
1029 1029
 
1030
-    /**
1031
-     * Gets uses
1032
-     *
1033
-     * @return int
1034
-     * @throws \EE_Error
1035
-     */
1030
+	/**
1031
+	 * Gets uses
1032
+	 *
1033
+	 * @return int
1034
+	 * @throws \EE_Error
1035
+	 */
1036 1036
 	public function uses() {
1037 1037
 		return $this->get( 'TKT_uses' );
1038 1038
 	}
1039 1039
 
1040 1040
 
1041 1041
 
1042
-    /**
1043
-     * Sets uses
1044
-     *
1045
-     * @param int $uses
1046
-     * @return void
1047
-     * @throws \EE_Error
1048
-     */
1042
+	/**
1043
+	 * Sets uses
1044
+	 *
1045
+	 * @param int $uses
1046
+	 * @return void
1047
+	 * @throws \EE_Error
1048
+	 */
1049 1049
 	public function set_uses( $uses ) {
1050 1050
 		$this->set( 'TKT_uses', $uses );
1051 1051
 	}
1052 1052
 
1053 1053
 
1054 1054
 
1055
-    /**
1056
-     * returns whether ticket is required or not.
1057
-     *
1058
-     * @return boolean
1059
-     * @throws \EE_Error
1060
-     */
1055
+	/**
1056
+	 * returns whether ticket is required or not.
1057
+	 *
1058
+	 * @return boolean
1059
+	 * @throws \EE_Error
1060
+	 */
1061 1061
 	public function required() {
1062 1062
 		return $this->get( 'TKT_required' );
1063 1063
 	}
1064 1064
 
1065 1065
 
1066 1066
 
1067
-    /**
1068
-     * sets the TKT_required property
1069
-     *
1070
-     * @param boolean $required
1071
-     * @return void
1072
-     * @throws \EE_Error
1073
-     */
1067
+	/**
1068
+	 * sets the TKT_required property
1069
+	 *
1070
+	 * @param boolean $required
1071
+	 * @return void
1072
+	 * @throws \EE_Error
1073
+	 */
1074 1074
 	public function set_required( $required ) {
1075 1075
 		$this->set( 'TKT_required', $required );
1076 1076
 	}
1077 1077
 
1078 1078
 
1079 1079
 
1080
-    /**
1081
-     * Gets taxable
1082
-     *
1083
-     * @return boolean
1084
-     * @throws \EE_Error
1085
-     */
1080
+	/**
1081
+	 * Gets taxable
1082
+	 *
1083
+	 * @return boolean
1084
+	 * @throws \EE_Error
1085
+	 */
1086 1086
 	public function taxable() {
1087 1087
 		return $this->get( 'TKT_taxable' );
1088 1088
 	}
1089 1089
 
1090 1090
 
1091 1091
 
1092
-    /**
1093
-     * Sets taxable
1094
-     *
1095
-     * @param boolean $taxable
1096
-     * @return void
1097
-     * @throws \EE_Error
1098
-     */
1092
+	/**
1093
+	 * Sets taxable
1094
+	 *
1095
+	 * @param boolean $taxable
1096
+	 * @return void
1097
+	 * @throws \EE_Error
1098
+	 */
1099 1099
 	public function set_taxable( $taxable ) {
1100 1100
 		$this->set( 'TKT_taxable', $taxable );
1101 1101
 	}
1102 1102
 
1103 1103
 
1104 1104
 
1105
-    /**
1106
-     * Gets is_default
1107
-     *
1108
-     * @return boolean
1109
-     * @throws \EE_Error
1110
-     */
1105
+	/**
1106
+	 * Gets is_default
1107
+	 *
1108
+	 * @return boolean
1109
+	 * @throws \EE_Error
1110
+	 */
1111 1111
 	public function is_default() {
1112 1112
 		return $this->get( 'TKT_is_default' );
1113 1113
 	}
1114 1114
 
1115 1115
 
1116 1116
 
1117
-    /**
1118
-     * Sets is_default
1119
-     *
1120
-     * @param boolean $is_default
1121
-     * @return void
1122
-     * @throws \EE_Error
1123
-     */
1117
+	/**
1118
+	 * Sets is_default
1119
+	 *
1120
+	 * @param boolean $is_default
1121
+	 * @return void
1122
+	 * @throws \EE_Error
1123
+	 */
1124 1124
 	public function set_is_default( $is_default ) {
1125 1125
 		$this->set( 'TKT_is_default', $is_default );
1126 1126
 	}
1127 1127
 
1128 1128
 
1129 1129
 
1130
-    /**
1131
-     * Gets order
1132
-     *
1133
-     * @return int
1134
-     * @throws \EE_Error
1135
-     */
1130
+	/**
1131
+	 * Gets order
1132
+	 *
1133
+	 * @return int
1134
+	 * @throws \EE_Error
1135
+	 */
1136 1136
 	public function order() {
1137 1137
 		return $this->get( 'TKT_order' );
1138 1138
 	}
1139 1139
 
1140 1140
 
1141 1141
 
1142
-    /**
1143
-     * Sets order
1144
-     *
1145
-     * @param int $order
1146
-     * @return void
1147
-     * @throws \EE_Error
1148
-     */
1142
+	/**
1143
+	 * Sets order
1144
+	 *
1145
+	 * @param int $order
1146
+	 * @return void
1147
+	 * @throws \EE_Error
1148
+	 */
1149 1149
 	public function set_order( $order ) {
1150 1150
 		$this->set( 'TKT_order', $order );
1151 1151
 	}
1152 1152
 
1153 1153
 
1154 1154
 
1155
-    /**
1156
-     * Gets row
1157
-     *
1158
-     * @return int
1159
-     * @throws \EE_Error
1160
-     */
1155
+	/**
1156
+	 * Gets row
1157
+	 *
1158
+	 * @return int
1159
+	 * @throws \EE_Error
1160
+	 */
1161 1161
 	public function row() {
1162 1162
 		return $this->get( 'TKT_row' );
1163 1163
 	}
1164 1164
 
1165 1165
 
1166 1166
 
1167
-    /**
1168
-     * Sets row
1169
-     *
1170
-     * @param int $row
1171
-     * @return void
1172
-     * @throws \EE_Error
1173
-     */
1167
+	/**
1168
+	 * Sets row
1169
+	 *
1170
+	 * @param int $row
1171
+	 * @return void
1172
+	 * @throws \EE_Error
1173
+	 */
1174 1174
 	public function set_row( $row ) {
1175 1175
 		$this->set( 'TKT_row', $row );
1176 1176
 	}
1177 1177
 
1178 1178
 
1179 1179
 
1180
-    /**
1181
-     * Gets deleted
1182
-     *
1183
-     * @return boolean
1184
-     * @throws \EE_Error
1185
-     */
1180
+	/**
1181
+	 * Gets deleted
1182
+	 *
1183
+	 * @return boolean
1184
+	 * @throws \EE_Error
1185
+	 */
1186 1186
 	public function deleted() {
1187 1187
 		return $this->get( 'TKT_deleted' );
1188 1188
 	}
1189 1189
 
1190 1190
 
1191 1191
 
1192
-    /**
1193
-     * Sets deleted
1194
-     *
1195
-     * @param boolean $deleted
1196
-     * @return void
1197
-     * @throws \EE_Error
1198
-     */
1192
+	/**
1193
+	 * Sets deleted
1194
+	 *
1195
+	 * @param boolean $deleted
1196
+	 * @return void
1197
+	 * @throws \EE_Error
1198
+	 */
1199 1199
 	public function set_deleted( $deleted ) {
1200 1200
 		$this->set( 'TKT_deleted', $deleted );
1201 1201
 	}
1202 1202
 
1203 1203
 
1204 1204
 
1205
-    /**
1206
-     * Gets parent
1207
-     *
1208
-     * @return int
1209
-     * @throws \EE_Error
1210
-     */
1205
+	/**
1206
+	 * Gets parent
1207
+	 *
1208
+	 * @return int
1209
+	 * @throws \EE_Error
1210
+	 */
1211 1211
 	public function parent_ID() {
1212 1212
 		return $this->get( 'TKT_parent' );
1213 1213
 	}
1214 1214
 
1215 1215
 
1216 1216
 
1217
-    /**
1218
-     * Sets parent
1219
-     *
1220
-     * @param int $parent
1221
-     * @return void
1222
-     * @throws \EE_Error
1223
-     */
1217
+	/**
1218
+	 * Sets parent
1219
+	 *
1220
+	 * @param int $parent
1221
+	 * @return void
1222
+	 * @throws \EE_Error
1223
+	 */
1224 1224
 	public function set_parent_ID( $parent ) {
1225 1225
 		$this->set( 'TKT_parent', $parent );
1226 1226
 	}
1227 1227
 
1228 1228
 
1229 1229
 
1230
-    /**
1231
-     * Gets a string which is handy for showing in gateways etc that describes the ticket.
1232
-     *
1233
-     * @return string
1234
-     * @throws \EE_Error
1235
-     */
1230
+	/**
1231
+	 * Gets a string which is handy for showing in gateways etc that describes the ticket.
1232
+	 *
1233
+	 * @return string
1234
+	 * @throws \EE_Error
1235
+	 */
1236 1236
 	public function name_and_info() {
1237 1237
 		$times = array();
1238 1238
 		foreach ( $this->datetimes() as $datetime ) {
@@ -1243,50 +1243,50 @@  discard block
 block discarded – undo
1243 1243
 
1244 1244
 
1245 1245
 
1246
-    /**
1247
-     * Gets name
1248
-     *
1249
-     * @return string
1250
-     * @throws \EE_Error
1251
-     */
1246
+	/**
1247
+	 * Gets name
1248
+	 *
1249
+	 * @return string
1250
+	 * @throws \EE_Error
1251
+	 */
1252 1252
 	public function name() {
1253 1253
 		return $this->get( 'TKT_name' );
1254 1254
 	}
1255 1255
 
1256 1256
 
1257 1257
 
1258
-    /**
1259
-     * Gets price
1260
-     *
1261
-     * @return float
1262
-     * @throws \EE_Error
1263
-     */
1258
+	/**
1259
+	 * Gets price
1260
+	 *
1261
+	 * @return float
1262
+	 * @throws \EE_Error
1263
+	 */
1264 1264
 	public function price() {
1265 1265
 		return $this->get( 'TKT_price' );
1266 1266
 	}
1267 1267
 
1268 1268
 
1269 1269
 
1270
-    /**
1271
-     * Gets all the registrations for this ticket
1272
-     *
1273
-     * @param array $query_params like EEM_Base::get_all's
1274
-     * @return EE_Registration[]|EE_Base_Class[]
1275
-     * @throws \EE_Error
1276
-     */
1270
+	/**
1271
+	 * Gets all the registrations for this ticket
1272
+	 *
1273
+	 * @param array $query_params like EEM_Base::get_all's
1274
+	 * @return EE_Registration[]|EE_Base_Class[]
1275
+	 * @throws \EE_Error
1276
+	 */
1277 1277
 	public function registrations( $query_params = array() ) {
1278 1278
 		return $this->get_many_related( 'Registration', $query_params );
1279 1279
 	}
1280 1280
 
1281 1281
 
1282 1282
 
1283
-    /**
1284
-     * Updates the TKT_sold attribute (and saves) based on the number of APPROVED registrations for this ticket.
1285
-     * into account
1286
-     *
1287
-     * @return int
1288
-     * @throws \EE_Error
1289
-     */
1283
+	/**
1284
+	 * Updates the TKT_sold attribute (and saves) based on the number of APPROVED registrations for this ticket.
1285
+	 * into account
1286
+	 *
1287
+	 * @return int
1288
+	 * @throws \EE_Error
1289
+	 */
1290 1290
 	public function update_tickets_sold() {
1291 1291
 		$count_regs_for_this_ticket = $this->count_registrations( array( array( 'STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0 ) ) );
1292 1292
 		$this->set_sold( $count_regs_for_this_ticket );
@@ -1318,21 +1318,21 @@  discard block
 block discarded – undo
1318 1318
 
1319 1319
 
1320 1320
 
1321
-    /**
1322
-     * Implementation of the EEI_Event_Relation interface method
1323
-     *
1324
-     * @see EEI_Event_Relation for comments
1325
-     * @return EE_Event
1326
-     * @throws \EE_Error
1327
-     * @throws UnexpectedEntityException
1328
-     */
1321
+	/**
1322
+	 * Implementation of the EEI_Event_Relation interface method
1323
+	 *
1324
+	 * @see EEI_Event_Relation for comments
1325
+	 * @return EE_Event
1326
+	 * @throws \EE_Error
1327
+	 * @throws UnexpectedEntityException
1328
+	 */
1329 1329
 	public function get_related_event() {
1330 1330
 		//get one datetime to use for getting the event
1331 1331
 		$datetime = $this->first_datetime();
1332 1332
 		if ( ! $datetime instanceof \EE_Datetime ) {
1333 1333
 			throw new UnexpectedEntityException(
1334 1334
 				$datetime,
1335
-                'EE_Datetime',
1335
+				'EE_Datetime',
1336 1336
 				sprintf(
1337 1337
 					__( 'The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'),
1338 1338
 					$this->name()
@@ -1343,7 +1343,7 @@  discard block
 block discarded – undo
1343 1343
 		if ( ! $event instanceof \EE_Event ) {
1344 1344
 			throw new UnexpectedEntityException(
1345 1345
 				$event,
1346
-                'EE_Event',
1346
+				'EE_Event',
1347 1347
 				sprintf(
1348 1348
 					__( 'The ticket (%s) is not associated with a valid event.', 'event_espresso'),
1349 1349
 					$this->name()
@@ -1355,14 +1355,14 @@  discard block
 block discarded – undo
1355 1355
 
1356 1356
 
1357 1357
 
1358
-    /**
1359
-     * Implementation of the EEI_Event_Relation interface method
1360
-     *
1361
-     * @see EEI_Event_Relation for comments
1362
-     * @return string
1363
-     * @throws UnexpectedEntityException
1364
-     * @throws \EE_Error
1365
-     */
1358
+	/**
1359
+	 * Implementation of the EEI_Event_Relation interface method
1360
+	 *
1361
+	 * @see EEI_Event_Relation for comments
1362
+	 * @return string
1363
+	 * @throws UnexpectedEntityException
1364
+	 * @throws \EE_Error
1365
+	 */
1366 1366
 	public function get_event_name() {
1367 1367
 		$event = $this->get_related_event();
1368 1368
 		return $event instanceof EE_Event ? $event->name() : '';
@@ -1370,14 +1370,14 @@  discard block
 block discarded – undo
1370 1370
 
1371 1371
 
1372 1372
 
1373
-    /**
1374
-     * Implementation of the EEI_Event_Relation interface method
1375
-     *
1376
-     * @see EEI_Event_Relation for comments
1377
-     * @return int
1378
-     * @throws UnexpectedEntityException
1379
-     * @throws \EE_Error
1380
-     */
1373
+	/**
1374
+	 * Implementation of the EEI_Event_Relation interface method
1375
+	 *
1376
+	 * @see EEI_Event_Relation for comments
1377
+	 * @return int
1378
+	 * @throws UnexpectedEntityException
1379
+	 * @throws \EE_Error
1380
+	 */
1381 1381
 	public function get_event_ID() {
1382 1382
 		$event = $this->get_related_event();
1383 1383
 		return $event instanceof EE_Event ? $event->ID() : 0;
Please login to merge, or discard this patch.
Spacing   +205 added lines, -205 removed lines patch added patch discarded remove patch
@@ -1,7 +1,7 @@  discard block
 block discarded – undo
1 1
 <?php use EventEspresso\core\exceptions\UnexpectedEntityException;
2 2
 
3
-if ( !defined( 'EVENT_ESPRESSO_VERSION' ) ) {
4
-	exit( 'No direct script access allowed' );
3
+if ( ! defined('EVENT_ESPRESSO_VERSION')) {
4
+	exit('No direct script access allowed');
5 5
 }
6 6
 /**
7 7
  * Event Espresso
@@ -70,9 +70,9 @@  discard block
 block discarded – undo
70 70
      * @return EE_Ticket
71 71
      * @throws \EE_Error
72 72
      */
73
-	public static function new_instance( $props_n_values = array(), $timezone = null, $date_formats = array() ) {
74
-		$has_object = parent::_check_for_object( $props_n_values, __CLASS__, $timezone, $date_formats );
75
-		return $has_object ? $has_object : new self( $props_n_values, false, $timezone, $date_formats );
73
+	public static function new_instance($props_n_values = array(), $timezone = null, $date_formats = array()) {
74
+		$has_object = parent::_check_for_object($props_n_values, __CLASS__, $timezone, $date_formats);
75
+		return $has_object ? $has_object : new self($props_n_values, false, $timezone, $date_formats);
76 76
 	}
77 77
 
78 78
 
@@ -84,8 +84,8 @@  discard block
 block discarded – undo
84 84
      * @return EE_Ticket
85 85
      * @throws \EE_Error
86 86
      */
87
-	public static function new_instance_from_db( $props_n_values = array(), $timezone = null ) {
88
-		return new self( $props_n_values, TRUE, $timezone );
87
+	public static function new_instance_from_db($props_n_values = array(), $timezone = null) {
88
+		return new self($props_n_values, TRUE, $timezone);
89 89
 	}
90 90
 
91 91
 
@@ -95,7 +95,7 @@  discard block
 block discarded – undo
95 95
      * @throws \EE_Error
96 96
      */
97 97
 	public function parent() {
98
-		return $this->get( 'TKT_parent' );
98
+		return $this->get('TKT_parent');
99 99
 	}
100 100
 
101 101
 
@@ -107,13 +107,13 @@  discard block
 block discarded – undo
107 107
      * @return boolean
108 108
      * @throws \EE_Error
109 109
      */
110
-	public function available( $DTT_ID = 0 ) {
110
+	public function available($DTT_ID = 0) {
111 111
 		// are we checking availability for a particular datetime ?
112
-		if ( $DTT_ID ) {
112
+		if ($DTT_ID) {
113 113
 			// get that datetime object
114
-			$datetime = $this->get_first_related( 'Datetime', array( array( 'DTT_ID' => $DTT_ID ) ) );
114
+			$datetime = $this->get_first_related('Datetime', array(array('DTT_ID' => $DTT_ID)));
115 115
 			// if  ticket sales for this datetime have exceeded the reg limit...
116
-			if ( $datetime instanceof EE_Datetime && $datetime->sold_out() ) {
116
+			if ($datetime instanceof EE_Datetime && $datetime->sold_out()) {
117 117
 				return FALSE;
118 118
 			}
119 119
 		}
@@ -131,22 +131,22 @@  discard block
 block discarded – undo
131 131
      * @return mixed status int if the display string isn't requested
132 132
      * @throws \EE_Error
133 133
      */
134
-	public function ticket_status( $display = FALSE, $remaining = null ) {
135
-		$remaining = is_bool( $remaining ) ? $remaining : $this->is_remaining();
136
-		if ( ! $remaining ) {
137
-			return $display ? EEH_Template::pretty_status( EE_Ticket::sold_out, FALSE, 'sentence' ) : EE_Ticket::sold_out;
134
+	public function ticket_status($display = FALSE, $remaining = null) {
135
+		$remaining = is_bool($remaining) ? $remaining : $this->is_remaining();
136
+		if ( ! $remaining) {
137
+			return $display ? EEH_Template::pretty_status(EE_Ticket::sold_out, FALSE, 'sentence') : EE_Ticket::sold_out;
138 138
 		}
139
-		if ( $this->get( 'TKT_deleted' ) ) {
140
-			return $display ? EEH_Template::pretty_status( EE_Ticket::archived, FALSE, 'sentence' ) : EE_Ticket::archived;
139
+		if ($this->get('TKT_deleted')) {
140
+			return $display ? EEH_Template::pretty_status(EE_Ticket::archived, FALSE, 'sentence') : EE_Ticket::archived;
141 141
 		}
142
-		if ( $this->is_expired() ) {
143
-			return $display ? EEH_Template::pretty_status( EE_Ticket::expired, FALSE, 'sentence' ) : EE_Ticket::expired;
142
+		if ($this->is_expired()) {
143
+			return $display ? EEH_Template::pretty_status(EE_Ticket::expired, FALSE, 'sentence') : EE_Ticket::expired;
144 144
 		}
145
-		if ( $this->is_pending() ) {
146
-			return $display ? EEH_Template::pretty_status( EE_Ticket::pending, FALSE, 'sentence' ) : EE_Ticket::pending;
145
+		if ($this->is_pending()) {
146
+			return $display ? EEH_Template::pretty_status(EE_Ticket::pending, FALSE, 'sentence') : EE_Ticket::pending;
147 147
 		}
148
-		if ( $this->is_on_sale() ) {
149
-			return $display ? EEH_Template::pretty_status( EE_Ticket::onsale, FALSE, 'sentence' ) : EE_Ticket::onsale;
148
+		if ($this->is_on_sale()) {
149
+			return $display ? EEH_Template::pretty_status(EE_Ticket::onsale, FALSE, 'sentence') : EE_Ticket::onsale;
150 150
 		}
151 151
 		return '';
152 152
 	}
@@ -161,12 +161,12 @@  discard block
 block discarded – undo
161 161
      * @return boolean         true = tickets remaining, false not.
162 162
      * @throws \EE_Error
163 163
      */
164
-	public function is_remaining( $DTT_ID = 0 ) {
165
-		$num_remaining = $this->remaining( $DTT_ID );
166
-		if ( $num_remaining === 0 ) {
164
+	public function is_remaining($DTT_ID = 0) {
165
+		$num_remaining = $this->remaining($DTT_ID);
166
+		if ($num_remaining === 0) {
167 167
 			return FALSE;
168 168
 		}
169
-		if ( $num_remaining > 0 && $num_remaining < $this->min() ) {
169
+		if ($num_remaining > 0 && $num_remaining < $this->min()) {
170 170
 			return FALSE;
171 171
 		}
172 172
 		return TRUE;
@@ -182,8 +182,8 @@  discard block
 block discarded – undo
182 182
      * @return int
183 183
      * @throws \EE_Error
184 184
      */
185
-	public function remaining( $DTT_ID = 0 ) {
186
-		return $this->real_quantity_on_ticket('saleable', $DTT_ID );
185
+	public function remaining($DTT_ID = 0) {
186
+		return $this->real_quantity_on_ticket('saleable', $DTT_ID);
187 187
 	}
188 188
 
189 189
 
@@ -195,7 +195,7 @@  discard block
 block discarded – undo
195 195
      * @throws \EE_Error
196 196
      */
197 197
 	public function min() {
198
-		return $this->get( 'TKT_min' );
198
+		return $this->get('TKT_min');
199 199
 	}
200 200
 
201 201
 
@@ -207,7 +207,7 @@  discard block
 block discarded – undo
207 207
      * @throws \EE_Error
208 208
      */
209 209
 	public function is_expired() {
210
-		return ( $this->get_raw( 'TKT_end_date' ) < time() );
210
+		return ($this->get_raw('TKT_end_date') < time());
211 211
 	}
212 212
 
213 213
 
@@ -219,7 +219,7 @@  discard block
 block discarded – undo
219 219
      * @throws \EE_Error
220 220
      */
221 221
 	public function is_pending() {
222
-		return ( $this->get_raw( 'TKT_start_date' ) > time() );
222
+		return ($this->get_raw('TKT_start_date') > time());
223 223
 	}
224 224
 
225 225
 
@@ -231,7 +231,7 @@  discard block
 block discarded – undo
231 231
      * @throws \EE_Error
232 232
      */
233 233
 	public function is_on_sale() {
234
-		return ( $this->get_raw( 'TKT_start_date' ) < time() && $this->get_raw( 'TKT_end_date' ) > time() );
234
+		return ($this->get_raw('TKT_start_date') < time() && $this->get_raw('TKT_end_date') > time());
235 235
 	}
236 236
 
237 237
 
@@ -244,11 +244,11 @@  discard block
 block discarded – undo
244 244
      * @return string
245 245
      * @throws \EE_Error
246 246
      */
247
-	public function date_range( $dt_frmt = '', $conjunction = ' - ' ) {
248
-		$first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date( $dt_frmt ) : '';
249
-		$last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date( $dt_frmt ) : '';
247
+	public function date_range($dt_frmt = '', $conjunction = ' - ') {
248
+		$first_date = $this->first_datetime() instanceof EE_Datetime ? $this->first_datetime()->start_date($dt_frmt) : '';
249
+		$last_date = $this->last_datetime() instanceof EE_Datetime ? $this->last_datetime()->end_date($dt_frmt) : '';
250 250
 
251
-		return $first_date && $last_date ? $first_date . $conjunction  . $last_date : '';
251
+		return $first_date && $last_date ? $first_date.$conjunction.$last_date : '';
252 252
 	}
253 253
 
254 254
 
@@ -260,8 +260,8 @@  discard block
 block discarded – undo
260 260
      * @throws \EE_Error
261 261
      */
262 262
 	public function first_datetime() {
263
-		$datetimes = $this->datetimes( array( 'limit' => 1 ) );
264
-		return reset( $datetimes );
263
+		$datetimes = $this->datetimes(array('limit' => 1));
264
+		return reset($datetimes);
265 265
 	}
266 266
 
267 267
 
@@ -274,11 +274,11 @@  discard block
 block discarded – undo
274 274
      * @return EE_Datetime[]|EE_Base_Class[]
275 275
      * @throws \EE_Error
276 276
      */
277
-	public function datetimes( $query_params = array() ) {
278
-		if ( ! isset( $query_params[ 'order_by' ] ) ) {
279
-			$query_params[ 'order_by' ][ 'DTT_order' ] = 'ASC';
277
+	public function datetimes($query_params = array()) {
278
+		if ( ! isset($query_params['order_by'])) {
279
+			$query_params['order_by']['DTT_order'] = 'ASC';
280 280
 		}
281
-		return $this->get_many_related( 'Datetime', $query_params );
281
+		return $this->get_many_related('Datetime', $query_params);
282 282
 	}
283 283
 
284 284
 
@@ -290,8 +290,8 @@  discard block
 block discarded – undo
290 290
      * @throws \EE_Error
291 291
      */
292 292
 	public function last_datetime() {
293
-		$datetimes = $this->datetimes( array( 'limit' => 1, 'order_by' => array( 'DTT_EVT_start' => 'DESC' ) ) );
294
-		return end( $datetimes );
293
+		$datetimes = $this->datetimes(array('limit' => 1, 'order_by' => array('DTT_EVT_start' => 'DESC')));
294
+		return end($datetimes);
295 295
 	}
296 296
 
297 297
 
@@ -309,22 +309,22 @@  discard block
 block discarded – undo
309 309
      * @return mixed (array|int)          how many tickets have sold
310 310
      * @throws \EE_Error
311 311
      */
312
-	public function tickets_sold( $what = 'ticket', $dtt_id = NULL ) {
312
+	public function tickets_sold($what = 'ticket', $dtt_id = NULL) {
313 313
 		$total = 0;
314 314
 		$tickets_sold = $this->_all_tickets_sold();
315
-		switch ( $what ) {
315
+		switch ($what) {
316 316
 			case 'ticket' :
317
-				return $tickets_sold[ 'ticket' ];
317
+				return $tickets_sold['ticket'];
318 318
 				break;
319 319
 			case 'datetime' :
320
-				if ( empty( $tickets_sold[ 'datetime' ] ) ) {
320
+				if (empty($tickets_sold['datetime'])) {
321 321
 					return $total;
322 322
 				}
323
-				if ( ! empty( $dtt_id ) && ! isset( $tickets_sold[ 'datetime' ][ $dtt_id ] ) ) {
324
-					EE_Error::add_error( __( 'You\'ve requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included.  Are you SURE that is a datetime related to this ticket?', 'event_espresso' ), __FILE__, __FUNCTION__, __LINE__ );
323
+				if ( ! empty($dtt_id) && ! isset($tickets_sold['datetime'][$dtt_id])) {
324
+					EE_Error::add_error(__('You\'ve requested the amount of tickets sold for a given ticket and datetime, however there are no records for the datetime id you included.  Are you SURE that is a datetime related to this ticket?', 'event_espresso'), __FILE__, __FUNCTION__, __LINE__);
325 325
 					return $total;
326 326
 				}
327
-				return empty( $dtt_id ) ? $tickets_sold[ 'datetime' ] : $tickets_sold[ 'datetime' ][ $dtt_id ];
327
+				return empty($dtt_id) ? $tickets_sold['datetime'] : $tickets_sold['datetime'][$dtt_id];
328 328
 				break;
329 329
 			default:
330 330
 				return $total;
@@ -340,15 +340,15 @@  discard block
 block discarded – undo
340 340
      * @throws \EE_Error
341 341
      */
342 342
 	protected function _all_tickets_sold() {
343
-		$datetimes = $this->get_many_related( 'Datetime' );
343
+		$datetimes = $this->get_many_related('Datetime');
344 344
 		$tickets_sold = array();
345
-		if ( ! empty( $datetimes ) ) {
346
-			foreach ( $datetimes as $datetime ) {
347
-				$tickets_sold[ 'datetime' ][ $datetime->ID() ] = $datetime->get( 'DTT_sold' );
345
+		if ( ! empty($datetimes)) {
346
+			foreach ($datetimes as $datetime) {
347
+				$tickets_sold['datetime'][$datetime->ID()] = $datetime->get('DTT_sold');
348 348
 			}
349 349
 		}
350 350
 		//Tickets sold
351
-		$tickets_sold[ 'ticket' ] = $this->sold();
351
+		$tickets_sold['ticket'] = $this->sold();
352 352
 		return $tickets_sold;
353 353
 	}
354 354
 
@@ -361,11 +361,11 @@  discard block
 block discarded – undo
361 361
      * @return EE_Price|EE_Base_Class|EE_Price[]|EE_Base_Class[]
362 362
      * @throws \EE_Error
363 363
      */
364
-	public function base_price( $return_array = FALSE ) {
365
-		$_where = array( 'Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price );
364
+	public function base_price($return_array = FALSE) {
365
+		$_where = array('Price_Type.PBT_ID' => EEM_Price_Type::base_type_base_price);
366 366
 		return $return_array
367
-            ? $this->get_many_related( 'Price', array( $_where ) )
368
-            : $this->get_first_related( 'Price', array( $_where ) );
367
+            ? $this->get_many_related('Price', array($_where))
368
+            : $this->get_first_related('Price', array($_where));
369 369
 	}
370 370
 
371 371
 
@@ -378,8 +378,8 @@  discard block
 block discarded – undo
378 378
      * @throws \EE_Error
379 379
      */
380 380
 	public function price_modifiers() {
381
-		$query_params = array( 0 => array( 'Price_Type.PBT_ID' => array( 'NOT IN', array( EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax ) ) ) );
382
-		return $this->prices( $query_params );
381
+		$query_params = array(0 => array('Price_Type.PBT_ID' => array('NOT IN', array(EEM_Price_Type::base_type_base_price, EEM_Price_Type::base_type_tax))));
382
+		return $this->prices($query_params);
383 383
 	}
384 384
 
385 385
 
@@ -391,8 +391,8 @@  discard block
 block discarded – undo
391 391
      * @return EE_Price[]|EE_Base_Class[]
392 392
      * @throws \EE_Error
393 393
      */
394
-	public function prices( $query_params = array() ) {
395
-		return $this->get_many_related( 'Price', $query_params );
394
+	public function prices($query_params = array()) {
395
+		return $this->get_many_related('Price', $query_params);
396 396
 	}
397 397
 
398 398
 
@@ -404,8 +404,8 @@  discard block
 block discarded – undo
404 404
      * @return EE_Datetime_Ticket|EE_Base_Class[]
405 405
      * @throws \EE_Error
406 406
      */
407
-	public function datetime_tickets( $query_params = array() ) {
408
-		return $this->get_many_related( 'Datetime_Ticket', $query_params );
407
+	public function datetime_tickets($query_params = array()) {
408
+		return $this->get_many_related('Datetime_Ticket', $query_params);
409 409
 	}
410 410
 
411 411
 
@@ -418,8 +418,8 @@  discard block
 block discarded – undo
418 418
      * @return EE_Datetime[]
419 419
      * @throws \EE_Error
420 420
      */
421
-	public function datetimes_ordered( $show_expired = TRUE, $show_deleted = FALSE ) {
422
-		return EEM_Datetime::instance( $this->_timezone )->get_datetimes_for_ticket_ordered_by_DTT_order( $this->ID(), $show_expired, $show_deleted );
421
+	public function datetimes_ordered($show_expired = TRUE, $show_deleted = FALSE) {
422
+		return EEM_Datetime::instance($this->_timezone)->get_datetimes_for_ticket_ordered_by_DTT_order($this->ID(), $show_expired, $show_deleted);
423 423
 	}
424 424
 
425 425
 
@@ -431,7 +431,7 @@  discard block
 block discarded – undo
431 431
      * @throws \EE_Error
432 432
      */
433 433
 	public function ID() {
434
-		return $this->get( 'TKT_ID' );
434
+		return $this->get('TKT_ID');
435 435
 	}
436 436
 
437 437
 
@@ -456,7 +456,7 @@  discard block
 block discarded – undo
456 456
      * @throws \EE_Error
457 457
      */
458 458
 	public function template() {
459
-		return $this->get_first_related( 'Ticket_Template' );
459
+		return $this->get_first_related('Ticket_Template');
460 460
 	}
461 461
 
462 462
 
@@ -478,7 +478,7 @@  discard block
 block discarded – undo
478 478
      * @throws \EE_Error
479 479
      */
480 480
 	public function ticket_price() {
481
-		return $this->get( 'TKT_price' );
481
+		return $this->get('TKT_price');
482 482
 	}
483 483
 
484 484
 
@@ -488,7 +488,7 @@  discard block
 block discarded – undo
488 488
      * @throws \EE_Error
489 489
      */
490 490
 	public function pretty_price() {
491
-		return $this->get_pretty( 'TKT_price' );
491
+		return $this->get_pretty('TKT_price');
492 492
 	}
493 493
 
494 494
 
@@ -510,8 +510,8 @@  discard block
 block discarded – undo
510 510
      * @return float
511 511
      * @throws \EE_Error
512 512
      */
513
-	public function get_ticket_total_with_taxes( $no_cache = FALSE ) {
514
-		if ($this->_ticket_total_with_taxes === null || $no_cache ) {
513
+	public function get_ticket_total_with_taxes($no_cache = FALSE) {
514
+		if ($this->_ticket_total_with_taxes === null || $no_cache) {
515 515
 			$this->_ticket_total_with_taxes = $this->get_ticket_subtotal() + $this->get_ticket_taxes_total_for_admin();
516 516
 		}
517 517
 		return (float) $this->_ticket_total_with_taxes;
@@ -520,7 +520,7 @@  discard block
 block discarded – undo
520 520
 
521 521
 
522 522
 	public function ensure_TKT_Price_correct() {
523
-		$this->set( 'TKT_price', EE_Taxes::get_subtotal_for_admin( $this ) );
523
+		$this->set('TKT_price', EE_Taxes::get_subtotal_for_admin($this));
524 524
 		$this->save();
525 525
 	}
526 526
 
@@ -531,7 +531,7 @@  discard block
 block discarded – undo
531 531
      * @throws \EE_Error
532 532
      */
533 533
 	public function get_ticket_subtotal() {
534
-		return EE_Taxes::get_subtotal_for_admin( $this );
534
+		return EE_Taxes::get_subtotal_for_admin($this);
535 535
 	}
536 536
 
537 537
 
@@ -543,7 +543,7 @@  discard block
 block discarded – undo
543 543
      * @throws \EE_Error
544 544
      */
545 545
 	public function get_ticket_taxes_total_for_admin() {
546
-		return EE_Taxes::get_total_taxes_for_admin( $this );
546
+		return EE_Taxes::get_total_taxes_for_admin($this);
547 547
 	}
548 548
 
549 549
 
@@ -554,8 +554,8 @@  discard block
 block discarded – undo
554 554
      * @param string $name
555 555
      * @throws \EE_Error
556 556
      */
557
-	public function set_name( $name ) {
558
-		$this->set( 'TKT_name', $name );
557
+	public function set_name($name) {
558
+		$this->set('TKT_name', $name);
559 559
 	}
560 560
 
561 561
 
@@ -567,7 +567,7 @@  discard block
 block discarded – undo
567 567
      * @throws \EE_Error
568 568
      */
569 569
 	public function description() {
570
-		return $this->get( 'TKT_description' );
570
+		return $this->get('TKT_description');
571 571
 	}
572 572
 
573 573
 
@@ -578,8 +578,8 @@  discard block
 block discarded – undo
578 578
      * @param string $description
579 579
      * @throws \EE_Error
580 580
      */
581
-	public function set_description( $description ) {
582
-		$this->set( 'TKT_description', $description );
581
+	public function set_description($description) {
582
+		$this->set('TKT_description', $description);
583 583
 	}
584 584
 
585 585
 
@@ -592,8 +592,8 @@  discard block
 block discarded – undo
592 592
      * @return string
593 593
      * @throws \EE_Error
594 594
      */
595
-	public function start_date( $dt_frmt = '', $tm_frmt = '' ) {
596
-		return $this->_get_datetime( 'TKT_start_date', $dt_frmt, $tm_frmt );
595
+	public function start_date($dt_frmt = '', $tm_frmt = '') {
596
+		return $this->_get_datetime('TKT_start_date', $dt_frmt, $tm_frmt);
597 597
 	}
598 598
 
599 599
 
@@ -605,8 +605,8 @@  discard block
 block discarded – undo
605 605
      * @return void
606 606
      * @throws \EE_Error
607 607
      */
608
-	public function set_start_date( $start_date ) {
609
-		$this->_set_date_time( 'B', $start_date, 'TKT_start_date' );
608
+	public function set_start_date($start_date) {
609
+		$this->_set_date_time('B', $start_date, 'TKT_start_date');
610 610
 	}
611 611
 
612 612
 
@@ -619,8 +619,8 @@  discard block
 block discarded – undo
619 619
      * @return string
620 620
      * @throws \EE_Error
621 621
      */
622
-	public function end_date( $dt_frmt = '', $tm_frmt = '' ) {
623
-		return $this->_get_datetime( 'TKT_end_date', $dt_frmt, $tm_frmt );
622
+	public function end_date($dt_frmt = '', $tm_frmt = '') {
623
+		return $this->_get_datetime('TKT_end_date', $dt_frmt, $tm_frmt);
624 624
 	}
625 625
 
626 626
 
@@ -632,8 +632,8 @@  discard block
 block discarded – undo
632 632
      * @return void
633 633
      * @throws \EE_Error
634 634
      */
635
-	public function set_end_date( $end_date ) {
636
-		$this->_set_date_time( 'B', $end_date, 'TKT_end_date' );
635
+	public function set_end_date($end_date) {
636
+		$this->_set_date_time('B', $end_date, 'TKT_end_date');
637 637
 	}
638 638
 
639 639
 
@@ -645,8 +645,8 @@  discard block
 block discarded – undo
645 645
      * @param string $time a string representation of the sell until time (ex 9am or 7:30pm)
646 646
      * @throws \EE_Error
647 647
      */
648
-	public function set_end_time( $time ) {
649
-		$this->_set_time_for( $time, 'TKT_end_date' );
648
+	public function set_end_time($time) {
649
+		$this->_set_time_for($time, 'TKT_end_date');
650 650
 	}
651 651
 
652 652
 
@@ -658,8 +658,8 @@  discard block
 block discarded – undo
658 658
      * @return void
659 659
      * @throws \EE_Error
660 660
      */
661
-	public function set_min( $min ) {
662
-		$this->set( 'TKT_min', $min );
661
+	public function set_min($min) {
662
+		$this->set('TKT_min', $min);
663 663
 	}
664 664
 
665 665
 
@@ -671,7 +671,7 @@  discard block
 block discarded – undo
671 671
      * @throws \EE_Error
672 672
      */
673 673
 	public function max() {
674
-		return $this->get( 'TKT_max' );
674
+		return $this->get('TKT_max');
675 675
 	}
676 676
 
677 677
 
@@ -683,8 +683,8 @@  discard block
 block discarded – undo
683 683
      * @return void
684 684
      * @throws \EE_Error
685 685
      */
686
-	public function set_max( $max ) {
687
-		$this->set( 'TKT_max', $max );
686
+	public function set_max($max) {
687
+		$this->set('TKT_max', $max);
688 688
 	}
689 689
 
690 690
 
@@ -696,8 +696,8 @@  discard block
 block discarded – undo
696 696
      * @return void
697 697
      * @throws \EE_Error
698 698
      */
699
-	public function set_price( $price ) {
700
-		$this->set( 'TKT_price', $price );
699
+	public function set_price($price) {
700
+		$this->set('TKT_price', $price);
701 701
 	}
702 702
 
703 703
 
@@ -709,7 +709,7 @@  discard block
 block discarded – undo
709 709
      * @throws \EE_Error
710 710
      */
711 711
 	public function sold() {
712
-		return $this->get_raw( 'TKT_sold' );
712
+		return $this->get_raw('TKT_sold');
713 713
 	}
714 714
 
715 715
 
@@ -721,10 +721,10 @@  discard block
 block discarded – undo
721 721
      * @return void
722 722
      * @throws \EE_Error
723 723
      */
724
-	public function set_sold( $sold ) {
724
+	public function set_sold($sold) {
725 725
 		// sold can not go below zero
726
-		$sold = max( 0, $sold );
727
-		$this->set( 'TKT_sold', $sold );
726
+		$sold = max(0, $sold);
727
+		$this->set('TKT_sold', $sold);
728 728
 	}
729 729
 
730 730
 
@@ -736,13 +736,13 @@  discard block
 block discarded – undo
736 736
      * @return void
737 737
      * @throws \EE_Error
738 738
      */
739
-	public function increase_sold( $qty = 1 ) {
739
+	public function increase_sold($qty = 1) {
740 740
 		$sold = $this->sold() + $qty;
741 741
 		// remove ticket reservation, but don't adjust datetime reservations,  because that will happen
742 742
 		// via \EE_Datetime::increase_sold() when \EE_Ticket::_increase_sold_for_datetimes() is called
743
-		$this->decrease_reserved( $qty, false );
744
-		$this->_increase_sold_for_datetimes( $qty );
745
-		$this->set_sold( $sold );
743
+		$this->decrease_reserved($qty, false);
744
+		$this->_increase_sold_for_datetimes($qty);
745
+		$this->set_sold($sold);
746 746
 	}
747 747
 
748 748
 
@@ -754,12 +754,12 @@  discard block
 block discarded – undo
754 754
      * @return void
755 755
      * @throws \EE_Error
756 756
      */
757
-	protected function _increase_sold_for_datetimes( $qty = 1 ) {
757
+	protected function _increase_sold_for_datetimes($qty = 1) {
758 758
 		$datetimes = $this->datetimes();
759
-		if ( is_array( $datetimes ) ) {
760
-			foreach ( $datetimes as $datetime ) {
761
-				if ( $datetime instanceof EE_Datetime ) {
762
-					$datetime->increase_sold( $qty );
759
+		if (is_array($datetimes)) {
760
+			foreach ($datetimes as $datetime) {
761
+				if ($datetime instanceof EE_Datetime) {
762
+					$datetime->increase_sold($qty);
763 763
 					$datetime->save();
764 764
 				}
765 765
 			}
@@ -775,10 +775,10 @@  discard block
 block discarded – undo
775 775
      * @return void
776 776
      * @throws \EE_Error
777 777
      */
778
-	public function decrease_sold( $qty = 1 ) {
778
+	public function decrease_sold($qty = 1) {
779 779
 		$sold = $this->sold() - $qty;
780
-		$this->_decrease_sold_for_datetimes( $qty );
781
-		$this->set_sold( $sold );
780
+		$this->_decrease_sold_for_datetimes($qty);
781
+		$this->set_sold($sold);
782 782
 	}
783 783
 
784 784
 
@@ -790,12 +790,12 @@  discard block
 block discarded – undo
790 790
      * @return void
791 791
      * @throws \EE_Error
792 792
      */
793
-	protected function _decrease_sold_for_datetimes( $qty = 1 ) {
793
+	protected function _decrease_sold_for_datetimes($qty = 1) {
794 794
 		$datetimes = $this->datetimes();
795
-		if ( is_array( $datetimes ) ) {
796
-			foreach ( $datetimes as $datetime ) {
797
-				if ( $datetime instanceof EE_Datetime ) {
798
-					$datetime->decrease_sold( $qty );
795
+		if (is_array($datetimes)) {
796
+			foreach ($datetimes as $datetime) {
797
+				if ($datetime instanceof EE_Datetime) {
798
+					$datetime->decrease_sold($qty);
799 799
 					$datetime->save();
800 800
 				}
801 801
 			}
@@ -811,7 +811,7 @@  discard block
 block discarded – undo
811 811
      * @throws \EE_Error
812 812
      */
813 813
 	public function reserved() {
814
-		return $this->get_raw( 'TKT_reserved' );
814
+		return $this->get_raw('TKT_reserved');
815 815
 	}
816 816
 
817 817
 
@@ -823,10 +823,10 @@  discard block
 block discarded – undo
823 823
      * @return void
824 824
      * @throws \EE_Error
825 825
      */
826
-	public function set_reserved( $reserved ) {
826
+	public function set_reserved($reserved) {
827 827
 		// reserved can not go below zero
828
-		$reserved = max( 0, (int) $reserved );
829
-		$this->set( 'TKT_reserved', $reserved );
828
+		$reserved = max(0, (int) $reserved);
829
+		$this->set('TKT_reserved', $reserved);
830 830
 	}
831 831
 
832 832
 
@@ -838,11 +838,11 @@  discard block
 block discarded – undo
838 838
      * @return void
839 839
      * @throws \EE_Error
840 840
      */
841
-	public function increase_reserved( $qty = 1 ) {
842
-		$qty = absint( $qty );
841
+	public function increase_reserved($qty = 1) {
842
+		$qty = absint($qty);
843 843
 		$reserved = $this->reserved() + $qty;
844
-		$this->_increase_reserved_for_datetimes( $qty );
845
-		$this->set_reserved( $reserved );
844
+		$this->_increase_reserved_for_datetimes($qty);
845
+		$this->set_reserved($reserved);
846 846
 	}
847 847
 
848 848
 
@@ -854,12 +854,12 @@  discard block
 block discarded – undo
854 854
      * @return void
855 855
      * @throws \EE_Error
856 856
      */
857
-	protected function _increase_reserved_for_datetimes( $qty = 1 ) {
857
+	protected function _increase_reserved_for_datetimes($qty = 1) {
858 858
 		$datetimes = $this->datetimes();
859
-		if ( is_array( $datetimes ) ) {
860
-			foreach ( $datetimes as $datetime ) {
861
-				if ( $datetime instanceof EE_Datetime ) {
862
-					$datetime->increase_reserved( $qty );
859
+		if (is_array($datetimes)) {
860
+			foreach ($datetimes as $datetime) {
861
+				if ($datetime instanceof EE_Datetime) {
862
+					$datetime->increase_reserved($qty);
863 863
 					$datetime->save();
864 864
 				}
865 865
 			}
@@ -876,12 +876,12 @@  discard block
 block discarded – undo
876 876
      * @return void
877 877
      * @throws \EE_Error
878 878
      */
879
-	public function decrease_reserved( $qty = 1, $adjust_datetimes = true ) {
880
-		$reserved = $this->reserved() - absint( $qty );
881
-		if ( $adjust_datetimes ) {
882
-			$this->_decrease_reserved_for_datetimes( $qty );
879
+	public function decrease_reserved($qty = 1, $adjust_datetimes = true) {
880
+		$reserved = $this->reserved() - absint($qty);
881
+		if ($adjust_datetimes) {
882
+			$this->_decrease_reserved_for_datetimes($qty);
883 883
 		}
884
-		$this->set_reserved( $reserved );
884
+		$this->set_reserved($reserved);
885 885
 	}
886 886
 
887 887
 
@@ -893,12 +893,12 @@  discard block
 block discarded – undo
893 893
      * @return void
894 894
      * @throws \EE_Error
895 895
      */
896
-	protected function _decrease_reserved_for_datetimes( $qty = 1 ) {
896
+	protected function _decrease_reserved_for_datetimes($qty = 1) {
897 897
 		$datetimes = $this->datetimes();
898
-		if ( is_array( $datetimes ) ) {
899
-			foreach ( $datetimes as $datetime ) {
900
-				if ( $datetime instanceof EE_Datetime ) {
901
-					$datetime->decrease_reserved( $qty );
898
+		if (is_array($datetimes)) {
899
+			foreach ($datetimes as $datetime) {
900
+				if ($datetime instanceof EE_Datetime) {
901
+					$datetime->decrease_reserved($qty);
902 902
 					$datetime->save();
903 903
 				}
904 904
 			}
@@ -919,14 +919,14 @@  discard block
 block discarded – undo
919 919
      * @return int
920 920
      * @throws \EE_Error
921 921
      */
922
-	public function qty( $context = '' ) {
923
-		switch ( $context ) {
922
+	public function qty($context = '') {
923
+		switch ($context) {
924 924
 			case 'reg_limit' :
925 925
 				return $this->real_quantity_on_ticket();
926 926
 			case 'saleable' :
927
-				return $this->real_quantity_on_ticket( 'saleable' );
927
+				return $this->real_quantity_on_ticket('saleable');
928 928
 			default:
929
-				return $this->get_raw( 'TKT_qty' );
929
+				return $this->get_raw('TKT_qty');
930 930
 		}
931 931
 	}
932 932
 
@@ -945,15 +945,15 @@  discard block
 block discarded – undo
945 945
      * @return int
946 946
      * @throws \EE_Error
947 947
      */
948
-	public function real_quantity_on_ticket( $context = 'reg_limit', $DTT_ID = 0 ) {
949
-		$raw = $this->get_raw( 'TKT_qty' );
948
+	public function real_quantity_on_ticket($context = 'reg_limit', $DTT_ID = 0) {
949
+		$raw = $this->get_raw('TKT_qty');
950 950
 		// return immediately if it's zero
951
-		if ( $raw === 0 ) {
951
+		if ($raw === 0) {
952 952
 			return $raw;
953 953
 		}
954 954
 		//echo "\n\n<br />Ticket: " . $this->name() . '<br />';
955 955
 		// ensure qty doesn't exceed raw value for THIS ticket
956
-		$qty = min( EE_INF, $raw );
956
+		$qty = min(EE_INF, $raw);
957 957
 		//echo "\n . qty: " . $qty . '<br />';
958 958
 		// calculate this ticket's total sales and reservations
959 959
 		$sold_and_reserved_for_this_ticket = $this->sold() + $this->reserved();
@@ -962,23 +962,23 @@  discard block
 block discarded – undo
962 962
 		//echo "\n . sold_and_reserved_for_this_ticket: " . $sold_and_reserved_for_this_ticket . '<br />';
963 963
 		// first we need to calculate the maximum number of tickets available for the datetime
964 964
 		// do we want data for one datetime or all of them ?
965
-		$query_params = $DTT_ID ? array( array( 'DTT_ID' => $DTT_ID ) ) : array();
966
-		$datetimes = $this->datetimes( $query_params );
967
-		if ( is_array( $datetimes ) && ! empty( $datetimes ) ) {
968
-			foreach ( $datetimes as $datetime ) {
969
-				if ( $datetime instanceof EE_Datetime ) {
965
+		$query_params = $DTT_ID ? array(array('DTT_ID' => $DTT_ID)) : array();
966
+		$datetimes = $this->datetimes($query_params);
967
+		if (is_array($datetimes) && ! empty($datetimes)) {
968
+			foreach ($datetimes as $datetime) {
969
+				if ($datetime instanceof EE_Datetime) {
970 970
 					$datetime->refresh_from_db();
971 971
 					//echo "\n . . datetime name: " . $datetime->name() . '<br />';
972 972
 					//echo "\n . . datetime ID: " . $datetime->ID() . '<br />';
973 973
 					// initialize with no restrictions for each datetime
974 974
 					// but adjust datetime qty based on datetime reg limit
975
-					$datetime_qty = min( EE_INF, $datetime->reg_limit() );
975
+					$datetime_qty = min(EE_INF, $datetime->reg_limit());
976 976
 					//echo "\n . . . datetime reg_limit: " . $datetime->reg_limit() . '<br />';
977 977
 					//echo "\n . . . datetime_qty: " . $datetime_qty . '<br />';
978 978
 					// if we want the actual saleable amount, then we need to consider OTHER ticket sales
979 979
 					// and reservations for this datetime, that do NOT include sales and reservations
980 980
 					// for this ticket (so we add $this->sold() and $this->reserved() back in)
981
-					if ( $context === 'saleable' ) {
981
+					if ($context === 'saleable') {
982 982
 						$datetime_qty = max(
983 983
 							$datetime_qty - $datetime->sold_and_reserved() + $sold_and_reserved_for_this_ticket,
984 984
 							0
@@ -990,16 +990,16 @@  discard block
 block discarded – undo
990 990
 						$datetime_qty = ! $datetime->sold_out() ? $datetime_qty : 0;
991 991
 						//echo "\n . . . datetime_qty: " . $datetime_qty . '<br />';
992 992
 					}
993
-					$qty = min( $datetime_qty, $qty );
993
+					$qty = min($datetime_qty, $qty);
994 994
 					//echo "\n . . qty: " . $qty . '<br />';
995 995
 				}
996 996
 			}
997 997
 		}
998 998
 		// NOW that we know the  maximum number of tickets available for the datetime
999 999
 		// we can finally factor in the details for this specific ticket
1000
-		if ( $qty > 0 && $context === 'saleable' ) {
1000
+		if ($qty > 0 && $context === 'saleable') {
1001 1001
 			// and subtract the sales for THIS ticket
1002
-			$qty = max( $qty - $sold_and_reserved_for_this_ticket, 0 );
1002
+			$qty = max($qty - $sold_and_reserved_for_this_ticket, 0);
1003 1003
 			//echo "\n . qty: " . $qty . '<br />';
1004 1004
 		}
1005 1005
 		//echo "\nFINAL QTY: " . $qty . "<br /><br />";
@@ -1015,14 +1015,14 @@  discard block
 block discarded – undo
1015 1015
 	 * @return void
1016 1016
 	 * @throws \EE_Error
1017 1017
 	 */
1018
-	public function set_qty( $qty ) {
1018
+	public function set_qty($qty) {
1019 1019
 		$datetimes = $this->datetimes();
1020
-		foreach ( $datetimes as $datetime ) {
1021
-			if ( $datetime instanceof EE_Datetime ) {
1022
-				$qty = min( $qty, $datetime->reg_limit() );
1020
+		foreach ($datetimes as $datetime) {
1021
+			if ($datetime instanceof EE_Datetime) {
1022
+				$qty = min($qty, $datetime->reg_limit());
1023 1023
 			}
1024 1024
 		}
1025
-		$this->set( 'TKT_qty', $qty );
1025
+		$this->set('TKT_qty', $qty);
1026 1026
 	}
1027 1027
 
1028 1028
 
@@ -1034,7 +1034,7 @@  discard block
 block discarded – undo
1034 1034
      * @throws \EE_Error
1035 1035
      */
1036 1036
 	public function uses() {
1037
-		return $this->get( 'TKT_uses' );
1037
+		return $this->get('TKT_uses');
1038 1038
 	}
1039 1039
 
1040 1040
 
@@ -1046,8 +1046,8 @@  discard block
 block discarded – undo
1046 1046
      * @return void
1047 1047
      * @throws \EE_Error
1048 1048
      */
1049
-	public function set_uses( $uses ) {
1050
-		$this->set( 'TKT_uses', $uses );
1049
+	public function set_uses($uses) {
1050
+		$this->set('TKT_uses', $uses);
1051 1051
 	}
1052 1052
 
1053 1053
 
@@ -1059,7 +1059,7 @@  discard block
 block discarded – undo
1059 1059
      * @throws \EE_Error
1060 1060
      */
1061 1061
 	public function required() {
1062
-		return $this->get( 'TKT_required' );
1062
+		return $this->get('TKT_required');
1063 1063
 	}
1064 1064
 
1065 1065
 
@@ -1071,8 +1071,8 @@  discard block
 block discarded – undo
1071 1071
      * @return void
1072 1072
      * @throws \EE_Error
1073 1073
      */
1074
-	public function set_required( $required ) {
1075
-		$this->set( 'TKT_required', $required );
1074
+	public function set_required($required) {
1075
+		$this->set('TKT_required', $required);
1076 1076
 	}
1077 1077
 
1078 1078
 
@@ -1084,7 +1084,7 @@  discard block
 block discarded – undo
1084 1084
      * @throws \EE_Error
1085 1085
      */
1086 1086
 	public function taxable() {
1087
-		return $this->get( 'TKT_taxable' );
1087
+		return $this->get('TKT_taxable');
1088 1088
 	}
1089 1089
 
1090 1090
 
@@ -1096,8 +1096,8 @@  discard block
 block discarded – undo
1096 1096
      * @return void
1097 1097
      * @throws \EE_Error
1098 1098
      */
1099
-	public function set_taxable( $taxable ) {
1100
-		$this->set( 'TKT_taxable', $taxable );
1099
+	public function set_taxable($taxable) {
1100
+		$this->set('TKT_taxable', $taxable);
1101 1101
 	}
1102 1102
 
1103 1103
 
@@ -1109,7 +1109,7 @@  discard block
 block discarded – undo
1109 1109
      * @throws \EE_Error
1110 1110
      */
1111 1111
 	public function is_default() {
1112
-		return $this->get( 'TKT_is_default' );
1112
+		return $this->get('TKT_is_default');
1113 1113
 	}
1114 1114
 
1115 1115
 
@@ -1121,8 +1121,8 @@  discard block
 block discarded – undo
1121 1121
      * @return void
1122 1122
      * @throws \EE_Error
1123 1123
      */
1124
-	public function set_is_default( $is_default ) {
1125
-		$this->set( 'TKT_is_default', $is_default );
1124
+	public function set_is_default($is_default) {
1125
+		$this->set('TKT_is_default', $is_default);
1126 1126
 	}
1127 1127
 
1128 1128
 
@@ -1134,7 +1134,7 @@  discard block
 block discarded – undo
1134 1134
      * @throws \EE_Error
1135 1135
      */
1136 1136
 	public function order() {
1137
-		return $this->get( 'TKT_order' );
1137
+		return $this->get('TKT_order');
1138 1138
 	}
1139 1139
 
1140 1140
 
@@ -1146,8 +1146,8 @@  discard block
 block discarded – undo
1146 1146
      * @return void
1147 1147
      * @throws \EE_Error
1148 1148
      */
1149
-	public function set_order( $order ) {
1150
-		$this->set( 'TKT_order', $order );
1149
+	public function set_order($order) {
1150
+		$this->set('TKT_order', $order);
1151 1151
 	}
1152 1152
 
1153 1153
 
@@ -1159,7 +1159,7 @@  discard block
 block discarded – undo
1159 1159
      * @throws \EE_Error
1160 1160
      */
1161 1161
 	public function row() {
1162
-		return $this->get( 'TKT_row' );
1162
+		return $this->get('TKT_row');
1163 1163
 	}
1164 1164
 
1165 1165
 
@@ -1171,8 +1171,8 @@  discard block
 block discarded – undo
1171 1171
      * @return void
1172 1172
      * @throws \EE_Error
1173 1173
      */
1174
-	public function set_row( $row ) {
1175
-		$this->set( 'TKT_row', $row );
1174
+	public function set_row($row) {
1175
+		$this->set('TKT_row', $row);
1176 1176
 	}
1177 1177
 
1178 1178
 
@@ -1184,7 +1184,7 @@  discard block
 block discarded – undo
1184 1184
      * @throws \EE_Error
1185 1185
      */
1186 1186
 	public function deleted() {
1187
-		return $this->get( 'TKT_deleted' );
1187
+		return $this->get('TKT_deleted');
1188 1188
 	}
1189 1189
 
1190 1190
 
@@ -1196,8 +1196,8 @@  discard block
 block discarded – undo
1196 1196
      * @return void
1197 1197
      * @throws \EE_Error
1198 1198
      */
1199
-	public function set_deleted( $deleted ) {
1200
-		$this->set( 'TKT_deleted', $deleted );
1199
+	public function set_deleted($deleted) {
1200
+		$this->set('TKT_deleted', $deleted);
1201 1201
 	}
1202 1202
 
1203 1203
 
@@ -1209,7 +1209,7 @@  discard block
 block discarded – undo
1209 1209
      * @throws \EE_Error
1210 1210
      */
1211 1211
 	public function parent_ID() {
1212
-		return $this->get( 'TKT_parent' );
1212
+		return $this->get('TKT_parent');
1213 1213
 	}
1214 1214
 
1215 1215
 
@@ -1221,8 +1221,8 @@  discard block
 block discarded – undo
1221 1221
      * @return void
1222 1222
      * @throws \EE_Error
1223 1223
      */
1224
-	public function set_parent_ID( $parent ) {
1225
-		$this->set( 'TKT_parent', $parent );
1224
+	public function set_parent_ID($parent) {
1225
+		$this->set('TKT_parent', $parent);
1226 1226
 	}
1227 1227
 
1228 1228
 
@@ -1235,10 +1235,10 @@  discard block
 block discarded – undo
1235 1235
      */
1236 1236
 	public function name_and_info() {
1237 1237
 		$times = array();
1238
-		foreach ( $this->datetimes() as $datetime ) {
1238
+		foreach ($this->datetimes() as $datetime) {
1239 1239
 			$times[] = $datetime->start_date_and_time();
1240 1240
 		}
1241
-		return $this->name() . ' @ ' . implode( ', ', $times ) . ' for ' . $this->pretty_price();
1241
+		return $this->name().' @ '.implode(', ', $times).' for '.$this->pretty_price();
1242 1242
 	}
1243 1243
 
1244 1244
 
@@ -1250,7 +1250,7 @@  discard block
 block discarded – undo
1250 1250
      * @throws \EE_Error
1251 1251
      */
1252 1252
 	public function name() {
1253
-		return $this->get( 'TKT_name' );
1253
+		return $this->get('TKT_name');
1254 1254
 	}
1255 1255
 
1256 1256
 
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
      * @throws \EE_Error
1263 1263
      */
1264 1264
 	public function price() {
1265
-		return $this->get( 'TKT_price' );
1265
+		return $this->get('TKT_price');
1266 1266
 	}
1267 1267
 
1268 1268
 
@@ -1274,8 +1274,8 @@  discard block
 block discarded – undo
1274 1274
      * @return EE_Registration[]|EE_Base_Class[]
1275 1275
      * @throws \EE_Error
1276 1276
      */
1277
-	public function registrations( $query_params = array() ) {
1278
-		return $this->get_many_related( 'Registration', $query_params );
1277
+	public function registrations($query_params = array()) {
1278
+		return $this->get_many_related('Registration', $query_params);
1279 1279
 	}
1280 1280
 
1281 1281
 
@@ -1288,8 +1288,8 @@  discard block
 block discarded – undo
1288 1288
      * @throws \EE_Error
1289 1289
      */
1290 1290
 	public function update_tickets_sold() {
1291
-		$count_regs_for_this_ticket = $this->count_registrations( array( array( 'STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0 ) ) );
1292
-		$this->set_sold( $count_regs_for_this_ticket );
1291
+		$count_regs_for_this_ticket = $this->count_registrations(array(array('STS_ID' => EEM_Registration::status_id_approved, 'REG_deleted' => 0)));
1292
+		$this->set_sold($count_regs_for_this_ticket);
1293 1293
 		$this->save();
1294 1294
 		return $count_regs_for_this_ticket;
1295 1295
 	}
@@ -1301,7 +1301,7 @@  discard block
 block discarded – undo
1301 1301
 	 * @param array $query_params like EEM_Base::get_all's
1302 1302
 	 * @return int
1303 1303
 	 */
1304
-	public function count_registrations( $query_params = array() ) {
1304
+	public function count_registrations($query_params = array()) {
1305 1305
 		return $this->count_related('Registration', $query_params);
1306 1306
 	}
1307 1307
 
@@ -1329,23 +1329,23 @@  discard block
 block discarded – undo
1329 1329
 	public function get_related_event() {
1330 1330
 		//get one datetime to use for getting the event
1331 1331
 		$datetime = $this->first_datetime();
1332
-		if ( ! $datetime instanceof \EE_Datetime ) {
1332
+		if ( ! $datetime instanceof \EE_Datetime) {
1333 1333
 			throw new UnexpectedEntityException(
1334 1334
 				$datetime,
1335 1335
                 'EE_Datetime',
1336 1336
 				sprintf(
1337
-					__( 'The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'),
1337
+					__('The ticket (%s) is not associated with any valid datetimes.', 'event_espresso'),
1338 1338
 					$this->name()
1339 1339
 				)
1340 1340
 			);
1341 1341
 		}
1342 1342
 		$event = $datetime->event();
1343
-		if ( ! $event instanceof \EE_Event ) {
1343
+		if ( ! $event instanceof \EE_Event) {
1344 1344
 			throw new UnexpectedEntityException(
1345 1345
 				$event,
1346 1346
                 'EE_Event',
1347 1347
 				sprintf(
1348
-					__( 'The ticket (%s) is not associated with a valid event.', 'event_espresso'),
1348
+					__('The ticket (%s) is not associated with a valid event.', 'event_espresso'),
1349 1349
 					$this->name()
1350 1350
 				)
1351 1351
 			);
Please login to merge, or discard this patch.
modules/ticket_selector/DatetimeSelector.php 2 patches
Indentation   +169 added lines, -169 removed lines patch added patch discarded remove patch
@@ -16,175 +16,175 @@
 block discarded – undo
16 16
 class DatetimeSelector
17 17
 {
18 18
 
19
-    /**
20
-     * @var \EE_Event $event
21
-     */
22
-    protected $event;
23
-
24
-    /**
25
-     * @var \EE_Ticket[] $tickets
26
-     */
27
-    protected $tickets;
28
-
29
-    /**
30
-     * @var \EE_Datetime[] $datetimes
31
-     */
32
-    protected $datetimes;
33
-
34
-    /**
35
-     * @var \EE_Datetime[] $unique_dates
36
-     */
37
-    protected $unique_dates;
38
-
39
-    /**
40
-     * @var \EE_Ticket_Selector_Config $template_settings
41
-     */
42
-    protected $template_settings;
43
-
44
-    /**
45
-     * @var boolean $active
46
-     */
47
-    protected $active = false;
48
-
49
-
50
-
51
-    /**
52
-     * DatetimeSelector constructor.
53
-     *
54
-     * @param \EE_Event                  $event
55
-     * @param \EE_Ticket[]               $tickets
56
-     * @param \EE_Ticket_Selector_Config $template_settings
57
-     * @param string                     $date_format
58
-     * @param string                     $time_format
59
-     * @throws \EE_Error
60
-     */
61
-    public function __construct(
62
-        \EE_Event $event,
63
-        array $tickets,
64
-        \EE_Ticket_Selector_Config $template_settings,
65
-        $date_format = 'Y-m-d',
66
-        $time_format = 'g:i a'
67
-    ) {
68
-        $this->event = $event;
69
-        $this->tickets = $tickets;
70
-        $this->template_settings = $template_settings;
71
-        $this->datetimes = $this->getAllDatetimesForAllTicket($tickets);
72
-        $this->unique_dates = $this->getUniqueDatetimeOptions($date_format, $time_format);
73
-        $this->active = $this->template_settings->showDatetimeSelector($this->unique_dates);
74
-    }
75
-
76
-
77
-
78
-    /**
79
-     * @param \EE_Ticket[] $tickets
80
-     * @return array
81
-     * @throws \EE_Error
82
-     */
83
-    protected function getAllDatetimesForAllTicket($tickets = array())
84
-    {
85
-        $datetimes = array();
86
-        foreach ($tickets as $ticket) {
87
-            $datetimes = $this->getTicketDatetimes($ticket, $datetimes);
88
-        }
89
-        return $datetimes;
90
-    }
91
-
92
-
93
-
94
-    /**
95
-     * @param \EE_Ticket      $ticket
96
-     * @param  \EE_Datetime[] $datetimes
97
-     * @return \EE_Datetime[]
98
-     * @throws \EE_Error
99
-     */
100
-    protected function getTicketDatetimes(\EE_Ticket $ticket, $datetimes = array())
101
-    {
102
-        $ticket_datetimes = $ticket->datetimes(
103
-            array(
104
-                'order_by'                 => array(
105
-                    'DTT_order'     => 'ASC',
106
-                    'DTT_EVT_start' => 'ASC'
107
-                ),
108
-                'default_where_conditions' => 'none',
109
-            )
110
-        );
111
-        foreach ($ticket_datetimes as $ticket_datetime) {
112
-            if ( ! $ticket_datetime instanceof \EE_Datetime) {
113
-                continue;
114
-            }
115
-            $datetimes[ $ticket_datetime->ID() ] = $ticket_datetime;
116
-        }
117
-        return $datetimes;
118
-    }
119
-
120
-
121
-
122
-    /**
123
-     * @param \EE_Ticket                 $ticket
124
-     * @return string
125
-     * @throws \EE_Error
126
-     */
127
-    public function getTicketDatetimeClasses( \EE_Ticket $ticket ) {
128
-        if ( ! $this->active) {
129
-            return '';
130
-        }
131
-        $ticket_datetimes = $this->getTicketDatetimes($ticket);
132
-        $classes = '';
133
-        foreach ($this->datetimes as $datetime) {
134
-            if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) {
135
-                continue;
136
-            }
137
-            $classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
138
-        }
139
-        return $classes;
140
-    }
141
-
142
-
143
-
144
-    /**
145
-     * @param string $date_format
146
-     * @param string $time_format
147
-     * @return array
148
-     * @throws \EE_Error
149
-     */
150
-    public function getUniqueDatetimeOptions($date_format = 'Y-m-d', $time_format = 'g:i a') {
151
-        $datetime_options = array();
152
-        foreach ($this->datetimes as $datetime) {
153
-            if ( ! $datetime instanceof \EE_Datetime) {
154
-                continue;
155
-            }
156
-            $datetime_options[$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_')] =
157
-                $datetime->date_and_time_range($date_format, $time_format, ' - ');
158
-        }
159
-        return $datetime_options;
160
-    }
161
-
162
-
163
-
164
-    /**
165
-     * @return string
166
-     * @throws \EE_Error
167
-     */
168
-    public function getDatetimeSelector() {
169
-        if ( ! $this->active) {
170
-            return '';
171
-        }
172
-        $dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input(
173
-            $this->unique_dates,
174
-            array(
175
-                'html_id'               => 'datetime-selector-' . $this->event->ID(),
176
-                'html_name'             => 'datetime_selector_' . $this->event->ID(),
177
-                'html_class'            => 'datetime-selector',
178
-                'select_button_text'       => '<span class="dashicons dashicons-calendar-alt"></span> '
179
-                                            . esc_html__('Filter by Date', 'event_espresso'),
180
-                'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"',
181
-            )
182
-        );
183
-        return \EEH_HTML::div(
184
-            $dropdown_selector->get_html_for_input(),
185
-            '', 'datetime_selector-dv'
186
-        );
187
-    }
19
+	/**
20
+	 * @var \EE_Event $event
21
+	 */
22
+	protected $event;
23
+
24
+	/**
25
+	 * @var \EE_Ticket[] $tickets
26
+	 */
27
+	protected $tickets;
28
+
29
+	/**
30
+	 * @var \EE_Datetime[] $datetimes
31
+	 */
32
+	protected $datetimes;
33
+
34
+	/**
35
+	 * @var \EE_Datetime[] $unique_dates
36
+	 */
37
+	protected $unique_dates;
38
+
39
+	/**
40
+	 * @var \EE_Ticket_Selector_Config $template_settings
41
+	 */
42
+	protected $template_settings;
43
+
44
+	/**
45
+	 * @var boolean $active
46
+	 */
47
+	protected $active = false;
48
+
49
+
50
+
51
+	/**
52
+	 * DatetimeSelector constructor.
53
+	 *
54
+	 * @param \EE_Event                  $event
55
+	 * @param \EE_Ticket[]               $tickets
56
+	 * @param \EE_Ticket_Selector_Config $template_settings
57
+	 * @param string                     $date_format
58
+	 * @param string                     $time_format
59
+	 * @throws \EE_Error
60
+	 */
61
+	public function __construct(
62
+		\EE_Event $event,
63
+		array $tickets,
64
+		\EE_Ticket_Selector_Config $template_settings,
65
+		$date_format = 'Y-m-d',
66
+		$time_format = 'g:i a'
67
+	) {
68
+		$this->event = $event;
69
+		$this->tickets = $tickets;
70
+		$this->template_settings = $template_settings;
71
+		$this->datetimes = $this->getAllDatetimesForAllTicket($tickets);
72
+		$this->unique_dates = $this->getUniqueDatetimeOptions($date_format, $time_format);
73
+		$this->active = $this->template_settings->showDatetimeSelector($this->unique_dates);
74
+	}
75
+
76
+
77
+
78
+	/**
79
+	 * @param \EE_Ticket[] $tickets
80
+	 * @return array
81
+	 * @throws \EE_Error
82
+	 */
83
+	protected function getAllDatetimesForAllTicket($tickets = array())
84
+	{
85
+		$datetimes = array();
86
+		foreach ($tickets as $ticket) {
87
+			$datetimes = $this->getTicketDatetimes($ticket, $datetimes);
88
+		}
89
+		return $datetimes;
90
+	}
91
+
92
+
93
+
94
+	/**
95
+	 * @param \EE_Ticket      $ticket
96
+	 * @param  \EE_Datetime[] $datetimes
97
+	 * @return \EE_Datetime[]
98
+	 * @throws \EE_Error
99
+	 */
100
+	protected function getTicketDatetimes(\EE_Ticket $ticket, $datetimes = array())
101
+	{
102
+		$ticket_datetimes = $ticket->datetimes(
103
+			array(
104
+				'order_by'                 => array(
105
+					'DTT_order'     => 'ASC',
106
+					'DTT_EVT_start' => 'ASC'
107
+				),
108
+				'default_where_conditions' => 'none',
109
+			)
110
+		);
111
+		foreach ($ticket_datetimes as $ticket_datetime) {
112
+			if ( ! $ticket_datetime instanceof \EE_Datetime) {
113
+				continue;
114
+			}
115
+			$datetimes[ $ticket_datetime->ID() ] = $ticket_datetime;
116
+		}
117
+		return $datetimes;
118
+	}
119
+
120
+
121
+
122
+	/**
123
+	 * @param \EE_Ticket                 $ticket
124
+	 * @return string
125
+	 * @throws \EE_Error
126
+	 */
127
+	public function getTicketDatetimeClasses( \EE_Ticket $ticket ) {
128
+		if ( ! $this->active) {
129
+			return '';
130
+		}
131
+		$ticket_datetimes = $this->getTicketDatetimes($ticket);
132
+		$classes = '';
133
+		foreach ($this->datetimes as $datetime) {
134
+			if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) {
135
+				continue;
136
+			}
137
+			$classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
138
+		}
139
+		return $classes;
140
+	}
141
+
142
+
143
+
144
+	/**
145
+	 * @param string $date_format
146
+	 * @param string $time_format
147
+	 * @return array
148
+	 * @throws \EE_Error
149
+	 */
150
+	public function getUniqueDatetimeOptions($date_format = 'Y-m-d', $time_format = 'g:i a') {
151
+		$datetime_options = array();
152
+		foreach ($this->datetimes as $datetime) {
153
+			if ( ! $datetime instanceof \EE_Datetime) {
154
+				continue;
155
+			}
156
+			$datetime_options[$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_')] =
157
+				$datetime->date_and_time_range($date_format, $time_format, ' - ');
158
+		}
159
+		return $datetime_options;
160
+	}
161
+
162
+
163
+
164
+	/**
165
+	 * @return string
166
+	 * @throws \EE_Error
167
+	 */
168
+	public function getDatetimeSelector() {
169
+		if ( ! $this->active) {
170
+			return '';
171
+		}
172
+		$dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input(
173
+			$this->unique_dates,
174
+			array(
175
+				'html_id'               => 'datetime-selector-' . $this->event->ID(),
176
+				'html_name'             => 'datetime_selector_' . $this->event->ID(),
177
+				'html_class'            => 'datetime-selector',
178
+				'select_button_text'       => '<span class="dashicons dashicons-calendar-alt"></span> '
179
+											. esc_html__('Filter by Date', 'event_espresso'),
180
+				'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"',
181
+			)
182
+		);
183
+		return \EEH_HTML::div(
184
+			$dropdown_selector->get_html_for_input(),
185
+			'', 'datetime_selector-dv'
186
+		);
187
+	}
188 188
 
189 189
 
190 190
 
Please login to merge, or discard this patch.
Spacing   +6 added lines, -6 removed lines patch added patch discarded remove patch
@@ -112,7 +112,7 @@  discard block
 block discarded – undo
112 112
             if ( ! $ticket_datetime instanceof \EE_Datetime) {
113 113
                 continue;
114 114
             }
115
-            $datetimes[ $ticket_datetime->ID() ] = $ticket_datetime;
115
+            $datetimes[$ticket_datetime->ID()] = $ticket_datetime;
116 116
         }
117 117
         return $datetimes;
118 118
     }
@@ -124,7 +124,7 @@  discard block
 block discarded – undo
124 124
      * @return string
125 125
      * @throws \EE_Error
126 126
      */
127
-    public function getTicketDatetimeClasses( \EE_Ticket $ticket ) {
127
+    public function getTicketDatetimeClasses(\EE_Ticket $ticket) {
128 128
         if ( ! $this->active) {
129 129
             return '';
130 130
         }
@@ -134,7 +134,7 @@  discard block
 block discarded – undo
134 134
             if ( ! $datetime instanceof \EE_Datetime || ! in_array($datetime, $ticket_datetimes, true)) {
135 135
                 continue;
136 136
             }
137
-            $classes .= ' ee-ticket-datetimes-' . $datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
137
+            $classes .= ' ee-ticket-datetimes-'.$datetime->date_and_time_range('Y_m_d', 'H_i', '-', '_');
138 138
         }
139 139
         return $classes;
140 140
     }
@@ -172,12 +172,12 @@  discard block
 block discarded – undo
172 172
         $dropdown_selector = new \EE_Checkbox_Dropdown_Selector_Input(
173 173
             $this->unique_dates,
174 174
             array(
175
-                'html_id'               => 'datetime-selector-' . $this->event->ID(),
176
-                'html_name'             => 'datetime_selector_' . $this->event->ID(),
175
+                'html_id'               => 'datetime-selector-'.$this->event->ID(),
176
+                'html_name'             => 'datetime_selector_'.$this->event->ID(),
177 177
                 'html_class'            => 'datetime-selector',
178 178
                 'select_button_text'       => '<span class="dashicons dashicons-calendar-alt"></span> '
179 179
                                             . esc_html__('Filter by Date', 'event_espresso'),
180
-                'other_html_attributes' => ' data-tkt_slctr_evt="' . $this->event->ID() . '"',
180
+                'other_html_attributes' => ' data-tkt_slctr_evt="'.$this->event->ID().'"',
181 181
             )
182 182
         );
183 183
         return \EEH_HTML::div(
Please login to merge, or discard this patch.
modules/ticket_selector/TicketSelectorRow.php 2 patches
Indentation   +190 added lines, -190 removed lines patch added patch discarded remove patch
@@ -16,196 +16,196 @@
 block discarded – undo
16 16
 abstract class TicketSelectorRow
17 17
 {
18 18
 
19
-    /**
20
-     * @var \EE_Ticket $ticket
21
-     */
22
-    protected $ticket;
23
-
24
-    /**
25
-     * @var int $max_atndz
26
-     */
27
-    protected $max_atndz;
28
-
29
-    /**
30
-     * @var string $date_format
31
-     */
32
-    protected $date_format;
33
-
34
-    /**
35
-     * @var int $EVT_ID
36
-     */
37
-    protected $EVT_ID;
38
-
39
-    /**
40
-     * @var string $ticket_status_display
41
-     */
42
-    protected $ticket_status_display;
43
-
44
-
45
-
46
-    /**
47
-     * TicketDetails constructor.
48
-     *
49
-     * @param \EE_Ticket                 $ticket
50
-     * @param int                        $max_atndz
51
-     * @param string                     $date_format
52
-     */
53
-    public function __construct(
54
-        \EE_Ticket $ticket,
55
-        $max_atndz,
56
-        $date_format
57
-    ) {
58
-        $this->ticket = $ticket;
59
-        $this->max_atndz = $max_atndz;
60
-        $this->date_format = $date_format;
61
-        $this->EVT_ID = $this->ticket->get_event_ID();
62
-    }
63
-
64
-
65
-
66
-    /**
67
-     * @return string
68
-     */
69
-    public function getTicketStatusDisplay()
70
-    {
71
-        return $this->ticket_status_display;
72
-    }
73
-
74
-
75
-
76
-    /**
77
-     * setTicketStatusDisplay
78
-     *
79
-     * @param string $tkt_status
80
-     * @param string $ticket_status
81
-     * @param int    $remaining
82
-     * @throws \EE_Error
83
-     */
84
-    protected function setTicketStatusDisplay($tkt_status, $ticket_status, $remaining) {
85
-        $this->ticket_status_display = '';
86
-        // now depending on the ticket and other circumstances...
87
-        if ($this->max_atndz === 0) {
88
-            // registration is CLOSED because admin set max attendees to ZERO
89
-            $this->ticket_status_display = $this->registrationClosed();
90
-        } else if ($tkt_status === \EE_Ticket::sold_out || $remaining === 0) {
91
-            // SOLD OUT - no tickets remaining
92
-            $this->ticket_status_display = $this->ticketsSoldOut();
93
-        } else if ($tkt_status === \EE_Ticket::expired || $tkt_status === \EE_Ticket::archived) {
94
-            // expired or archived ticket
95
-            $this->ticket_status_display = $ticket_status;
96
-        } else if ($tkt_status === \EE_Ticket::pending) {
97
-            // ticket not on sale yet
98
-            $this->ticket_status_display = $this->ticketsSalesPending();
99
-        } else if ($this->ticket->min() > $remaining) {
100
-            // min qty purchasable is less than tickets available
101
-            $this->ticket_status_display = $this->notEnoughTicketsAvailable();
102
-        }
103
-    }
104
-
105
-
106
-
107
-    /**
108
-     * registrationClosed
109
-     */
110
-    protected function registrationClosed()
111
-    {
112
-        return \EEH_HTML::span(
113
-            apply_filters(
114
-                'FHEE__ticket_selector_chart_template__ticket_closed_msg',
115
-                __('Closed', 'event_espresso')
116
-            ),
117
-            '', 'sold-out'
118
-        );
119
-    }
120
-
121
-
122
-
123
-    /**
124
-     * ticketsSoldOut
125
-     */
126
-    protected function ticketsSoldOut()
127
-    {
128
-        return \EEH_HTML::span(
129
-            apply_filters(
130
-                'FHEE__ticket_selector_chart_template__ticket_sold_out_msg',
131
-                __('Sold&nbsp;Out', 'event_espresso')
132
-            ),
133
-            '', 'sold-out'
134
-        );
135
-    }
136
-
137
-
138
-
139
-    /**
140
-     * ticketsSalesPending
141
-     *
142
-     * @throws \EE_Error
143
-     */
144
-    protected function ticketsSalesPending()
145
-    {
146
-        return \EEH_HTML::span(
147
-            \EEH_HTML::span(
148
-                apply_filters(
149
-                    'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg',
150
-                    __('Goes&nbsp;On&nbsp;Sale', 'event_espresso')
151
-                ),
152
-                '', 'ticket-pending'
153
-            )
154
-            . \EEH_HTML::br()
155
-            . \EEH_HTML::span(
156
-                $this->ticket->get_i18n_datetime(
157
-                    'TKT_start_date',
158
-                    apply_filters(
159
-                        'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format',
160
-                        $this->date_format
161
-                    )
162
-                ),
163
-                '', 'small-text'
164
-            ),
165
-            '', 'ticket-pending-pg'
166
-        );
167
-    }
168
-
169
-
170
-
171
-    /**
172
-     * notEnoughTicketsAvailable
173
-     */
174
-    protected function notEnoughTicketsAvailable()
175
-    {
176
-        return \EEH_HTML::div(
177
-            \EEH_HTML::span(
178
-                apply_filters(
179
-                    'FHEE__ticket_selector_chart_template__ticket_not_available_msg',
180
-                    __('Not Available', 'event_espresso')
181
-                ),
182
-                '', 'archived-ticket small-text'
183
-            )
184
-            . \EEH_HTML::br(),
185
-            '', 'archived-ticket-pg'
186
-        );
187
-    }
188
-
189
-
190
-
191
-    /**
192
-     * getHiddenInputs
193
-     *
194
-     * @param string $anchor_id
195
-     * @param int    $row
196
-     * @param int    $max_atndz
197
-     * @return string
198
-     */
199
-    protected function getHiddenInputs($anchor_id, $row, $max_atndz)
200
-    {
201
-        $html = '<input type="hidden" name="noheader" value="true"/>';
202
-        $html .= '<input type="hidden" name="tkt-slctr-return-url-' . $this->EVT_ID . '"';
203
-        $html .= ' value="' . \EEH_URL::current_url() . $anchor_id . '"/>';
204
-        $html .= '<input type="hidden" name="tkt-slctr-rows-' . $this->EVT_ID . '" value="' . $row - 1 . '"/>';
205
-        $html .= '<input type="hidden" name="tkt-slctr-max-atndz-' . $this->EVT_ID . '" value="' . $max_atndz . '"/>';
206
-        $html .= '<input type="hidden" name="tkt-slctr-event-id" value="' . $this->EVT_ID . '"/>';
207
-        return $html;
208
-    }
19
+	/**
20
+	 * @var \EE_Ticket $ticket
21
+	 */
22
+	protected $ticket;
23
+
24
+	/**
25
+	 * @var int $max_atndz
26
+	 */
27
+	protected $max_atndz;
28
+
29
+	/**
30
+	 * @var string $date_format
31
+	 */
32
+	protected $date_format;
33
+
34
+	/**
35
+	 * @var int $EVT_ID
36
+	 */
37
+	protected $EVT_ID;
38
+
39
+	/**
40
+	 * @var string $ticket_status_display
41
+	 */
42
+	protected $ticket_status_display;
43
+
44
+
45
+
46
+	/**
47
+	 * TicketDetails constructor.
48
+	 *
49
+	 * @param \EE_Ticket                 $ticket
50
+	 * @param int                        $max_atndz
51
+	 * @param string                     $date_format
52
+	 */
53
+	public function __construct(
54
+		\EE_Ticket $ticket,
55
+		$max_atndz,
56
+		$date_format
57
+	) {
58
+		$this->ticket = $ticket;
59
+		$this->max_atndz = $max_atndz;
60
+		$this->date_format = $date_format;
61
+		$this->EVT_ID = $this->ticket->get_event_ID();
62
+	}
63
+
64
+
65
+
66
+	/**
67
+	 * @return string
68
+	 */
69
+	public function getTicketStatusDisplay()
70
+	{
71
+		return $this->ticket_status_display;
72
+	}
73
+
74
+
75
+
76
+	/**
77
+	 * setTicketStatusDisplay
78
+	 *
79
+	 * @param string $tkt_status
80
+	 * @param string $ticket_status
81
+	 * @param int    $remaining
82
+	 * @throws \EE_Error
83
+	 */
84
+	protected function setTicketStatusDisplay($tkt_status, $ticket_status, $remaining) {
85
+		$this->ticket_status_display = '';
86
+		// now depending on the ticket and other circumstances...
87
+		if ($this->max_atndz === 0) {
88
+			// registration is CLOSED because admin set max attendees to ZERO
89
+			$this->ticket_status_display = $this->registrationClosed();
90
+		} else if ($tkt_status === \EE_Ticket::sold_out || $remaining === 0) {
91
+			// SOLD OUT - no tickets remaining
92
+			$this->ticket_status_display = $this->ticketsSoldOut();
93
+		} else if ($tkt_status === \EE_Ticket::expired || $tkt_status === \EE_Ticket::archived) {
94
+			// expired or archived ticket
95
+			$this->ticket_status_display = $ticket_status;
96
+		} else if ($tkt_status === \EE_Ticket::pending) {
97
+			// ticket not on sale yet
98
+			$this->ticket_status_display = $this->ticketsSalesPending();
99
+		} else if ($this->ticket->min() > $remaining) {
100
+			// min qty purchasable is less than tickets available
101
+			$this->ticket_status_display = $this->notEnoughTicketsAvailable();
102
+		}
103
+	}
104
+
105
+
106
+
107
+	/**
108
+	 * registrationClosed
109
+	 */
110
+	protected function registrationClosed()
111
+	{
112
+		return \EEH_HTML::span(
113
+			apply_filters(
114
+				'FHEE__ticket_selector_chart_template__ticket_closed_msg',
115
+				__('Closed', 'event_espresso')
116
+			),
117
+			'', 'sold-out'
118
+		);
119
+	}
120
+
121
+
122
+
123
+	/**
124
+	 * ticketsSoldOut
125
+	 */
126
+	protected function ticketsSoldOut()
127
+	{
128
+		return \EEH_HTML::span(
129
+			apply_filters(
130
+				'FHEE__ticket_selector_chart_template__ticket_sold_out_msg',
131
+				__('Sold&nbsp;Out', 'event_espresso')
132
+			),
133
+			'', 'sold-out'
134
+		);
135
+	}
136
+
137
+
138
+
139
+	/**
140
+	 * ticketsSalesPending
141
+	 *
142
+	 * @throws \EE_Error
143
+	 */
144
+	protected function ticketsSalesPending()
145
+	{
146
+		return \EEH_HTML::span(
147
+			\EEH_HTML::span(
148
+				apply_filters(
149
+					'FHEE__ticket_selector_chart_template__ticket_goes_on_sale_msg',
150
+					__('Goes&nbsp;On&nbsp;Sale', 'event_espresso')
151
+				),
152
+				'', 'ticket-pending'
153
+			)
154
+			. \EEH_HTML::br()
155
+			. \EEH_HTML::span(
156
+				$this->ticket->get_i18n_datetime(
157
+					'TKT_start_date',
158
+					apply_filters(
159
+						'FHEE__EED_Ticket_Selector__display_goes_on_sale__date_format',
160
+						$this->date_format
161
+					)
162
+				),
163
+				'', 'small-text'
164
+			),
165
+			'', 'ticket-pending-pg'
166
+		);
167
+	}
168
+
169
+
170
+
171
+	/**
172
+	 * notEnoughTicketsAvailable
173
+	 */
174
+	protected function notEnoughTicketsAvailable()
175
+	{
176
+		return \EEH_HTML::div(
177
+			\EEH_HTML::span(
178
+				apply_filters(
179
+					'FHEE__ticket_selector_chart_template__ticket_not_available_msg',
180
+					__('Not Available', 'event_espresso')
181
+				),
182
+				'', 'archived-ticket small-text'
183
+			)
184
+			. \EEH_HTML::br(),
185
+			'', 'archived-ticket-pg'
186
+		);
187
+	}
188
+
189
+
190
+
191
+	/**
192
+	 * getHiddenInputs
193
+	 *
194
+	 * @param string $anchor_id
195
+	 * @param int    $row
196
+	 * @param int    $max_atndz
197
+	 * @return string
198
+	 */
199
+	protected function getHiddenInputs($anchor_id, $row, $max_atndz)
200
+	{
201
+		$html = '<input type="hidden" name="noheader" value="true"/>';
202
+		$html .= '<input type="hidden" name="tkt-slctr-return-url-' . $this->EVT_ID . '"';
203
+		$html .= ' value="' . \EEH_URL::current_url() . $anchor_id . '"/>';
204
+		$html .= '<input type="hidden" name="tkt-slctr-rows-' . $this->EVT_ID . '" value="' . $row - 1 . '"/>';
205
+		$html .= '<input type="hidden" name="tkt-slctr-max-atndz-' . $this->EVT_ID . '" value="' . $max_atndz . '"/>';
206
+		$html .= '<input type="hidden" name="tkt-slctr-event-id" value="' . $this->EVT_ID . '"/>';
207
+		return $html;
208
+	}
209 209
 
210 210
 
211 211
 
Please login to merge, or discard this patch.
Spacing   +5 added lines, -5 removed lines patch added patch discarded remove patch
@@ -199,11 +199,11 @@
 block discarded – undo
199 199
     protected function getHiddenInputs($anchor_id, $row, $max_atndz)
200 200
     {
201 201
         $html = '<input type="hidden" name="noheader" value="true"/>';
202
-        $html .= '<input type="hidden" name="tkt-slctr-return-url-' . $this->EVT_ID . '"';
203
-        $html .= ' value="' . \EEH_URL::current_url() . $anchor_id . '"/>';
204
-        $html .= '<input type="hidden" name="tkt-slctr-rows-' . $this->EVT_ID . '" value="' . $row - 1 . '"/>';
205
-        $html .= '<input type="hidden" name="tkt-slctr-max-atndz-' . $this->EVT_ID . '" value="' . $max_atndz . '"/>';
206
-        $html .= '<input type="hidden" name="tkt-slctr-event-id" value="' . $this->EVT_ID . '"/>';
202
+        $html .= '<input type="hidden" name="tkt-slctr-return-url-'.$this->EVT_ID.'"';
203
+        $html .= ' value="'.\EEH_URL::current_url().$anchor_id.'"/>';
204
+        $html .= '<input type="hidden" name="tkt-slctr-rows-'.$this->EVT_ID.'" value="'.$row - 1.'"/>';
205
+        $html .= '<input type="hidden" name="tkt-slctr-max-atndz-'.$this->EVT_ID.'" value="'.$max_atndz.'"/>';
206
+        $html .= '<input type="hidden" name="tkt-slctr-event-id" value="'.$this->EVT_ID.'"/>';
207 207
         return $html;
208 208
     }
209 209
 
Please login to merge, or discard this patch.
modules/ticket_selector/templates/standard_ticket_selector.template.php 2 patches
Indentation   +22 added lines, -22 removed lines patch added patch discarded remove patch
@@ -28,12 +28,12 @@  discard block
 block discarded – undo
28 28
 			<tr>
29 29
 				<th scope="col" class="ee-ticket-selector-ticket-details-th">
30 30
 					<?php
31
-                    echo apply_filters(
32
-                        'FHEE__ticket_selector_chart_template__table_header_available_tickets',
33
-                        esc_html(''),
34
-                        $EVT_ID
35
-                    );
36
-                    ?>
31
+					echo apply_filters(
32
+						'FHEE__ticket_selector_chart_template__table_header_available_tickets',
33
+						esc_html(''),
34
+						$EVT_ID
35
+					);
36
+					?>
37 37
 				</th>
38 38
 				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
39 39
 				<th scope="col" class="ee-ticket-selector-ticket-price-th cntr">
@@ -47,28 +47,28 @@  discard block
 block discarded – undo
47 47
 						 * @param int $EVT_ID The Event ID
48 48
 						 */
49 49
 						echo apply_filters(
50
-                            'FHEE__ticket_selector_chart_template__table_header_price',
51
-                            esc_html__( 'Price', 'event_espresso' ),
52
-                            $EVT_ID
53
-                        );
50
+							'FHEE__ticket_selector_chart_template__table_header_price',
51
+							esc_html__( 'Price', 'event_espresso' ),
52
+							$EVT_ID
53
+						);
54 54
 					?>
55 55
 				</th>
56 56
 				<?php } ?>
57 57
 				<th scope="col" class="ee-ticket-selector-ticket-qty-th cntr">
58 58
 					<?php
59 59
 						/**
60
-						* Filters the text printed for the header of the quantity column in the ticket selector table
61
-						*
62
-						* @since 4.7.2
63
-						*
64
-						* @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
65
-						* @param int $EVT_ID The Event ID
66
-						*/
60
+						 * Filters the text printed for the header of the quantity column in the ticket selector table
61
+						 *
62
+						 * @since 4.7.2
63
+						 *
64
+						 * @param string 'Qty' The translatable text to display in the table header for the Quantity of tickets
65
+						 * @param int $EVT_ID The Event ID
66
+						 */
67 67
 						echo apply_filters(
68
-                            'FHEE__ticket_selector_chart_template__table_header_qty',
69
-                            esc_html__( 'Qty', 'event_espresso' ),
70
-                            $EVT_ID
71
-                        );
68
+							'FHEE__ticket_selector_chart_template__table_header_qty',
69
+							esc_html__( 'Qty', 'event_espresso' ),
70
+							$EVT_ID
71
+						);
72 72
 					?>
73 73
 				</th>
74 74
 			</tr>
@@ -98,7 +98,7 @@  discard block
 block discarded – undo
98 98
 if ( $max_atndz > 0 ) {
99 99
 	echo apply_filters(
100 100
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
101
-        esc_html('')
101
+		esc_html('')
102 102
 	);
103 103
 }
104 104
 if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) {
Please login to merge, or discard this patch.
Spacing   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -20,7 +20,7 @@  discard block
 block discarded – undo
20 20
 ?>
21 21
 <div id="tkt-slctr-tbl-wrap-dv-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl-wrap-dv">
22 22
 
23
-	<?php do_action( 'AHEE__ticket_selector_chart__template__before_ticket_selector', $event ); ?>
23
+	<?php do_action('AHEE__ticket_selector_chart__template__before_ticket_selector', $event); ?>
24 24
 	<?php echo $datetime_selector; ?>
25 25
 
26 26
 	<table id="tkt-slctr-tbl-<?php echo $EVT_ID; ?>" class="tkt-slctr-tbl">
@@ -35,7 +35,7 @@  discard block
 block discarded – undo
35 35
                     );
36 36
                     ?>
37 37
 				</th>
38
-				<?php if ( apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE ) ) { ?>
38
+				<?php if (apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', TRUE)) { ?>
39 39
 				<th scope="col" class="ee-ticket-selector-ticket-price-th cntr">
40 40
 					<?php
41 41
 						/**
@@ -48,7 +48,7 @@  discard block
 block discarded – undo
48 48
 						 */
49 49
 						echo apply_filters(
50 50
                             'FHEE__ticket_selector_chart_template__table_header_price',
51
-                            esc_html__( 'Price', 'event_espresso' ),
51
+                            esc_html__('Price', 'event_espresso'),
52 52
                             $EVT_ID
53 53
                         );
54 54
 					?>
@@ -66,7 +66,7 @@  discard block
 block discarded – undo
66 66
 						*/
67 67
 						echo apply_filters(
68 68
                             'FHEE__ticket_selector_chart_template__table_header_qty',
69
-                            esc_html__( 'Qty', 'event_espresso' ),
69
+                            esc_html__('Qty', 'event_espresso'),
70 70
                             $EVT_ID
71 71
                         );
72 72
 					?>
@@ -74,34 +74,34 @@  discard block
 block discarded – undo
74 74
 			</tr>
75 75
 		</thead>
76 76
 		<tbody>
77
-			<?php echo $ticket_row_html;?>
77
+			<?php echo $ticket_row_html; ?>
78 78
 		</tbody>
79 79
 	</table>
80 80
 	<?php
81
-	if ( $taxable_tickets && apply_filters( 'FHEE__ticket_selector_chart_template__display_ticket_price_details', true ) ) {
82
-		if ( $prices_displayed_including_taxes ) {
83
-			$ticket_price_includes_taxes = esc_html__( '* price includes taxes', 'event_espresso' );
81
+	if ($taxable_tickets && apply_filters('FHEE__ticket_selector_chart_template__display_ticket_price_details', true)) {
82
+		if ($prices_displayed_including_taxes) {
83
+			$ticket_price_includes_taxes = esc_html__('* price includes taxes', 'event_espresso');
84 84
 		} else {
85
-			$ticket_price_includes_taxes = esc_html__( '* price does not include taxes', 'event_espresso' );
85
+			$ticket_price_includes_taxes = esc_html__('* price does not include taxes', 'event_espresso');
86 86
 		}
87
-		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">' . $ticket_price_includes_taxes . '</p>';
87
+		echo '<p class="small-text lt-grey-text" style="text-align:right; margin: -1em 0 1em;">'.$ticket_price_includes_taxes.'</p>';
88 88
 	}
89 89
 	?>
90 90
 
91 91
 	<input type="hidden" name="noheader" value="true" />
92
-	<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::current_url() . $anchor_id; ?>" />
92
+	<input type="hidden" name="tkt-slctr-return-url-<?php echo $EVT_ID ?>" value="<?php echo EEH_URL::current_url().$anchor_id; ?>" />
93 93
 	<input type="hidden" name="tkt-slctr-rows-<?php echo $EVT_ID; ?>" value="<?php echo $row - 1; ?>" />
94 94
 	<input type="hidden" name="tkt-slctr-max-atndz-<?php echo $EVT_ID; ?>" value="<?php echo $max_atndz; ?>" />
95 95
 	<input type="hidden" name="tkt-slctr-event-id" value="<?php echo $EVT_ID; ?>" />
96 96
 
97 97
 <?php
98
-if ( $max_atndz > 0 ) {
98
+if ($max_atndz > 0) {
99 99
 	echo apply_filters(
100 100
 		'FHEE__ticket_selector_chart_template__maximum_tickets_purchased_footnote',
101 101
         esc_html('')
102 102
 	);
103 103
 }
104
-if ( ! apply_filters( 'FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false ) ) {
105
-	add_filter( 'FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true' );
104
+if ( ! apply_filters('FHEE__EE_Ticket_Selector__display_ticket_selector_submit', false)) {
105
+	add_filter('FHEE__EE_Ticket_Selector__no_ticket_selector_submit', '__return_true');
106 106
 }
107
-do_action( 'AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event );
108 107
\ No newline at end of file
108
+do_action('AHEE__ticket_selector_chart__template__after_ticket_selector', $EVT_ID, $event);
109 109
\ No newline at end of file
Please login to merge, or discard this patch.
modules/ticket_selector/templates/ticket_details.template.php 2 patches
Indentation   +123 added lines, -123 removed lines patch added patch discarded remove patch
@@ -22,38 +22,38 @@  discard block
 block discarded – undo
22 22
                 <p><?php echo $ticket->description(); ?></p>
23 23
 
24 24
                 <?php
25
-                do_action(
26
-                    'AHEE__ticket_selector_chart_template__ticket_details__after_description',
27
-                    $ticket,
28
-                    $ticket_price,
29
-                    $display_ticket_price
30
-                );
31
-                ?>
25
+				do_action(
26
+					'AHEE__ticket_selector_chart_template__ticket_details__after_description',
27
+					$ticket,
28
+					$ticket_price,
29
+					$display_ticket_price
30
+				);
31
+				?>
32 32
 
33 33
                 <section class="tckt-slctr-tkt-sale-dates-sctn">
34 34
                     <h5><?php echo apply_filters(
35
-                        'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
36
-                        esc_html__( 'Sale Dates', 'event_espresso' )
37
-                        ); ?>
35
+						'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
36
+						esc_html__( 'Sale Dates', 'event_espresso' )
37
+						); ?>
38 38
                     </h5>
39 39
                     <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
40
-                        'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
41
-                        esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' )
42
-                        ); ?></span>
40
+						'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
41
+						esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' )
42
+						); ?></span>
43 43
                     <br/>
44 44
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
45
-                        'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
46
-                        esc_html__( 'Goes On Sale:', 'event_espresso' )
47
-                        ); ?></span>
45
+						'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
46
+						esc_html__( 'Goes On Sale:', 'event_espresso' )
47
+						); ?></span>
48 48
                     <span class="dashicons dashicons-calendar"></span>
49 49
                     <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' &nbsp; '; ?>
50 50
                     <span  class="dashicons dashicons-clock"></span>
51 51
                     <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?>
52 52
                     <br/>
53 53
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
54
-                        'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
55
-                        esc_html__( 'Sales End:', 'event_espresso' )
56
-                        ); ?></span>
54
+						'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
55
+						esc_html__( 'Sales End:', 'event_espresso' )
56
+						); ?></span>
57 57
                     <span class="dashicons dashicons-calendar"></span>
58 58
                     <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' &nbsp; '; ?>
59 59
                     <span class="dashicons dashicons-clock"></span>
@@ -67,34 +67,34 @@  discard block
 block discarded – undo
67 67
                 <?php if ( $ticket->min() && $ticket->max() ) { ?>
68 68
                     <section class="tckt-slctr-tkt-quantities-sctn">
69 69
                         <h5><?php echo apply_filters(
70
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
71
-                            esc_html__( 'Purchasable Quantities', 'event_espresso' )
72
-                            ); ?></h5>
70
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
71
+							esc_html__( 'Purchasable Quantities', 'event_espresso' )
72
+							); ?></h5>
73 73
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
74
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
75
-                            esc_html__(
76
-                            'The number of tickets that can be purchased per transaction (if available).',
77
-                            'event_espresso'
78
-                            )
79
-                            ); ?></span><br/>
74
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
75
+							esc_html__(
76
+							'The number of tickets that can be purchased per transaction (if available).',
77
+							'event_espresso'
78
+							)
79
+							); ?></span><br/>
80 80
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
81
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
82
-                            esc_html__( 'Minimum Qty:', 'event_espresso' )
83
-                            ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
81
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
82
+							esc_html__( 'Minimum Qty:', 'event_espresso' )
83
+							); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
84 84
                         <?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span
85 85
                         class="important-notice small-text"><?php echo apply_filters(
86
-                        'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
87
-                        esc_html__(
88
-                        'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining',
89
-                        'event_espresso'
90
-                        )
91
-                        ); ?></span><?php } ?><br/>
86
+						'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
87
+						esc_html__(
88
+						'The Minimum Quantity purchasable for this ticket exceeds the number of spaces remaining',
89
+						'event_espresso'
90
+						)
91
+						); ?></span><?php } ?><br/>
92 92
                         <?php //$max = min( $max, $max_atndz );?>
93 93
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
94
-                            'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
95
-                            esc_html__( 'Maximum Qty:', 'event_espresso' )
96
-                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' )
97
-                        : max( $ticket->max(), 1 ); ?><br/>
94
+							'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
95
+							esc_html__( 'Maximum Qty:', 'event_espresso' )
96
+							); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' )
97
+						: max( $ticket->max(), 1 ); ?><br/>
98 98
                     </section>
99 99
                     <br/>
100 100
                 <?php } ?>
@@ -102,43 +102,43 @@  discard block
 block discarded – undo
102 102
                 <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?>
103 103
                     <section class="tckt-slctr-tkt-uses-sctn">
104 104
                         <h5><?php echo apply_filters(
105
-                                'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
106
-                                esc_html__( 'Event Date Ticket Uses', 'event_espresso' )
107
-                            ); ?></h5>
105
+								'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
106
+								esc_html__( 'Event Date Ticket Uses', 'event_espresso' )
107
+							); ?></h5>
108 108
                         <span class="drk-grey-text small-text no-bold"> - <?php
109
-                            echo apply_filters(
110
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message',
111
-                            sprintf(
112
-                                esc_html__(
113
-                                    'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s',
114
-                                    'event_espresso'
115
-                                ),
116
-                                '<br/>',
117
-                                '<strong>',
118
-                                '</strong>'
119
-                                )
120
-                            );
121
-                            ?></span><br/>
109
+							echo apply_filters(
110
+							'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_message',
111
+							sprintf(
112
+								esc_html__(
113
+									'The number of separate event datetimes (see table below) that this ticket can be used to gain admittance to.%1$s%2$sAdmission is always one person per ticket.%3$s',
114
+									'event_espresso'
115
+								),
116
+								'<br/>',
117
+								'<strong>',
118
+								'</strong>'
119
+								)
120
+							);
121
+							?></span><br/>
122 122
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
123
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
124
-                            esc_html__( '# Datetimes:', 'event_espresso' )
125
-                            ); ?></span><?php echo $ticket->uses(); ?><br/>
123
+							'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
124
+							esc_html__( '# Datetimes:', 'event_espresso' )
125
+							); ?></span><?php echo $ticket->uses(); ?><br/>
126 126
                     </section>
127 127
                 <?php } ?>
128 128
 
129 129
                 <?php
130
-                $datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
131
-                $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
132
-                if ( ! empty( $datetimes ) ) { ?>
130
+				$datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
131
+				$chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
132
+				if ( ! empty( $datetimes ) ) { ?>
133 133
                     <section class="tckt-slctr-tkt-datetimes-sctn">
134 134
                         <h5><?php echo apply_filters(
135
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
136
-                            esc_html__( 'Access', 'event_espresso' )
137
-                            ); ?></h5>
135
+							'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
136
+							esc_html__( 'Access', 'event_espresso' )
137
+							); ?></h5>
138 138
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
139
-                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
140
-                            esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' )
141
-                            ); ?></span>
139
+							'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
140
+							esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' )
141
+							); ?></span>
142 142
                         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
143 143
                             <table class="tckt-slctr-tkt-details-tbl">
144 144
                                 <thead>
@@ -146,9 +146,9 @@  discard block
 block discarded – undo
146 146
                                     <th class="tckt-slctr-tkt-details-date-th">
147 147
                                         <span class="dashicons dashicons-calendar"></span><span
148 148
                                         class="small-text"><?php echo apply_filters(
149
-                                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
150
-                                            esc_html__( 'Date ', 'event_espresso' )
151
-                                            ); ?></span>
149
+											'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
150
+											esc_html__( 'Date ', 'event_espresso' )
151
+											); ?></span>
152 152
                                     </th>
153 153
                                     <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
154 154
                                         <span class="dashicons dashicons-clock"></span><span
@@ -157,98 +157,98 @@  discard block
 block discarded – undo
157 157
                                     <?php if ( $show_ticket_sale_columns ) : ?>
158 158
                                         <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
159 159
                                             <span class="smaller-text"><?php echo apply_filters(
160
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
161
-                                                sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' )
162
-                                                ); ?></span>
160
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
161
+												sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' )
162
+												); ?></span>
163 163
                                         </th>
164 164
                                         <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
165 165
                                             <span class="smaller-text"><?php echo apply_filters(
166
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
167
-                                                sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' )
168
-                                                ); ?></span>
166
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
167
+												sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' )
168
+												); ?></span>
169 169
                                         </th>
170 170
                                         <th
171 171
                                         class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
172 172
                                             <span class="smaller-text"><?php echo apply_filters(
173
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
174
-                                                sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' )
175
-                                                ); ?></span>
173
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
174
+												sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' )
175
+												); ?></span>
176 176
                                         </th>
177 177
                                         <th
178 178
                                         class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
179 179
                                             <span class="smaller-text"><?php echo apply_filters(
180
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
181
-                                                sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
182
-                                                ); ?></span>
180
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
181
+												sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
182
+												); ?></span>
183 183
                                         </th>
184 184
                                     <?php endif; //end $show_ticket_sale_columns conditional ?>
185 185
                                 </tr>
186 186
                                 </thead>
187 187
                                 <tbody>
188 188
                                 <?php
189
-                                foreach ( $datetimes as $datetime ) {
190
-                                    if ( $datetime instanceof EE_Datetime ) {
191
-                                        ?>
189
+								foreach ( $datetimes as $datetime ) {
190
+									if ( $datetime instanceof EE_Datetime ) {
191
+										?>
192 192
 
193 193
                                         <tr>
194 194
                                             <td data-th="<?php echo apply_filters(
195
-                                            'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
196
-                                            esc_html__( 'Event Date ', 'event_espresso' )
197
-                                            ); ?>" class="small-text">
195
+											'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
196
+											esc_html__( 'Event Date ', 'event_espresso' )
197
+											); ?>" class="small-text">
198 198
                                                 <?php $datetime_name = $datetime->name(); ?>
199 199
                                                 <?php echo ! empty( $datetime_name ) ? '<b>'
200
-                                                                                       . $datetime_name
201
-                                                                                       . '</b><br/>' : ''; ?>
200
+																					   . $datetime_name
201
+																					   . '</b><br/>' : ''; ?>
202 202
                                                 <?php echo $datetime->date_range(
203
-                                                $date_format,
204
-                                                esc_html__( ' to  ', 'event_espresso' )
205
-                                                ); ?>
203
+												$date_format,
204
+												esc_html__( ' to  ', 'event_espresso' )
205
+												); ?>
206 206
                                             </td>
207 207
                                             <td data-th="<?php esc_html_e( 'Time ', 'event_espresso' ); ?>"
208 208
                                                 class="cntr small-text">
209 209
                                                 <?php echo $datetime->time_range(
210
-                                                $time_format,
211
-                                                esc_html__( ' to  ', 'event_espresso' )
212
-                                                ); ?>
210
+												$time_format,
211
+												esc_html__( ' to  ', 'event_espresso' )
212
+												); ?>
213 213
                                             </td>
214 214
                                             <?php if ( $show_ticket_sale_columns ) : ?>
215 215
                                                 <td data-th="<?php echo apply_filters(
216
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
217
-                                                esc_html__( 'Sold', 'event_espresso' )
218
-                                                ); ?>" class="cntr small-text">
216
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
217
+												esc_html__( 'Sold', 'event_espresso' )
218
+												); ?>" class="cntr small-text">
219 219
                                                     <?php echo $ticket->sold(); ?>
220 220
                                                 </td>
221 221
                                                 <td data-th="<?php echo apply_filters(
222
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
223
-                                                esc_html__( 'Remaining', 'event_espresso' )
224
-                                                ); ?>" class="cntr small-text">
222
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
223
+												esc_html__( 'Remaining', 'event_espresso' )
224
+												); ?>" class="cntr small-text">
225 225
                                                     <?php echo $remaining === EE_INF
226
-                                                    ? '<span class="smaller-text">' . esc_html__(
227
-                                                    'unlimited ',
228
-                                                    'event_espresso'
229
-                                                    ) . '</span>' : $remaining; ?>
226
+													? '<span class="smaller-text">' . esc_html__(
227
+													'unlimited ',
228
+													'event_espresso'
229
+													) . '</span>' : $remaining; ?>
230 230
                                                 </td>
231 231
                                                 <td data-th="<?php echo apply_filters(
232
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
233
-                                                esc_html__( 'Total Sold', 'event_espresso' )
234
-                                                ); ?>" class="cntr small-text">
232
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
233
+												esc_html__( 'Total Sold', 'event_espresso' )
234
+												); ?>" class="cntr small-text">
235 235
                                                     <?php echo $datetime->sold(); ?>
236 236
                                                 </td>
237 237
                                                 <?php $tkts_left = $datetime->sold_out()
238
-                                                ? '<span class="sold-out smaller-text">' . esc_html__(
239
-                                                'Sold&nbsp;Out',
240
-                                                'event_espresso'
241
-                                                ) . '</span>' : $datetime->spaces_remaining(); ?>
238
+												? '<span class="sold-out smaller-text">' . esc_html__(
239
+												'Sold&nbsp;Out',
240
+												'event_espresso'
241
+												) . '</span>' : $datetime->spaces_remaining(); ?>
242 242
                                                 <td data-th="<?php echo apply_filters(
243
-                                                'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
244
-                                                esc_html__( 'Total Spaces Left', 'event_espresso' )
245
-                                                ); ?>" class="cntr small-text">
243
+												'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
244
+												esc_html__( 'Total Spaces Left', 'event_espresso' )
245
+												); ?>" class="cntr small-text">
246 246
                                                     <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'
247
-                                                                                       . esc_html__(
248
-                                                                                       'unlimited ',
249
-                                                                                       'event_espresso'
250
-                                                                                       )
251
-                                                                                       . '</span>' : $tkts_left; ?>
247
+																					   . esc_html__(
248
+																					   'unlimited ',
249
+																					   'event_espresso'
250
+																					   )
251
+																					   . '</span>' : $tkts_left; ?>
252 252
                                                 </td>
253 253
                                             <?php endif; //end $show_ticket_sale_columns conditional ?>
254 254
                                         </tr>
Please login to merge, or discard this patch.
Spacing   +48 added lines, -48 removed lines patch added patch discarded remove patch
@@ -12,13 +12,13 @@  discard block
 block discarded – undo
12 12
 /** @var string $price_breakdown_heading */
13 13
 /** @var \EventEspresso\modules\ticket_selector\TicketDetails $ticket_details */
14 14
 ?>
15
-<?php if ( $show_ticket_details ) : ?>
15
+<?php if ($show_ticket_details) : ?>
16 16
 <tr class="tckt-slctr-tkt-details-tr <?php echo $ticket_details_row_class; ?>">
17 17
     <td class="tckt-slctr-tkt-details-td" colspan="<?php echo $cols; ?>">
18 18
         <div id="<?php echo $ticket_details_css_id; ?>-dv" class="tckt-slctr-tkt-details-dv" style="display: none;">
19 19
 
20 20
             <section class="tckt-slctr-tkt-details-sctn">
21
-                <h3><?php echo esc_html__( 'Details', 'event_espresso' ); ?></h3>
21
+                <h3><?php echo esc_html__('Details', 'event_espresso'); ?></h3>
22 22
                 <p><?php echo $ticket->description(); ?></p>
23 23
 
24 24
                 <?php
@@ -33,42 +33,42 @@  discard block
 block discarded – undo
33 33
                 <section class="tckt-slctr-tkt-sale-dates-sctn">
34 34
                     <h5><?php echo apply_filters(
35 35
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_date_heading',
36
-                        esc_html__( 'Sale Dates', 'event_espresso' )
36
+                        esc_html__('Sale Dates', 'event_espresso')
37 37
                         ); ?>
38 38
                     </h5>
39 39
                     <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
40 40
                         'FHEE__ticket_selector_chart_template__ticket_details_dates_available_message',
41
-                        esc_html__( 'The dates when this option is available for purchase.', 'event_espresso' )
41
+                        esc_html__('The dates when this option is available for purchase.', 'event_espresso')
42 42
                         ); ?></span>
43 43
                     <br/>
44 44
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
45 45
                         'FHEE__ticket_selector_chart_template__ticket_details_goes_on_sale',
46
-                        esc_html__( 'Goes On Sale:', 'event_espresso' )
46
+                        esc_html__('Goes On Sale:', 'event_espresso')
47 47
                         ); ?></span>
48 48
                     <span class="dashicons dashicons-calendar"></span>
49
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format) . ' &nbsp; '; ?>
49
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $date_format).' &nbsp; '; ?>
50 50
                     <span  class="dashicons dashicons-clock"></span>
51
-                    <?php echo $ticket->get_i18n_datetime('TKT_start_date',$time_format); ?>
51
+                    <?php echo $ticket->get_i18n_datetime('TKT_start_date', $time_format); ?>
52 52
                     <br/>
53 53
                     <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
54 54
                         'FHEE__ticket_selector_chart_template__ticket_details_sales_end',
55
-                        esc_html__( 'Sales End:', 'event_espresso' )
55
+                        esc_html__('Sales End:', 'event_espresso')
56 56
                         ); ?></span>
57 57
                     <span class="dashicons dashicons-calendar"></span>
58
-                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format) . ' &nbsp; '; ?>
58
+                    <?php echo $ticket->get_i18n_datetime('TKT_end_date', $date_format).' &nbsp; '; ?>
59 59
                     <span class="dashicons dashicons-clock"></span>
60 60
                     <?php echo $ticket->get_i18n_datetime('TKT_end_date', $time_format); ?>
61 61
                     <br/>
62 62
                 </section>
63 63
                 <br/>
64 64
 
65
-                <?php do_action( 'AHEE__ticket_selector_chart_template__after_ticket_date', $ticket ); ?>
65
+                <?php do_action('AHEE__ticket_selector_chart_template__after_ticket_date', $ticket); ?>
66 66
 
67
-                <?php if ( $ticket->min() && $ticket->max() ) { ?>
67
+                <?php if ($ticket->min() && $ticket->max()) { ?>
68 68
                     <section class="tckt-slctr-tkt-quantities-sctn">
69 69
                         <h5><?php echo apply_filters(
70 70
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_heading',
71
-                            esc_html__( 'Purchasable Quantities', 'event_espresso' )
71
+                            esc_html__('Purchasable Quantities', 'event_espresso')
72 72
                             ); ?></h5>
73 73
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
74 74
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_message',
@@ -79,9 +79,9 @@  discard block
 block discarded – undo
79 79
                             ); ?></span><br/>
80 80
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
81 81
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty',
82
-                            esc_html__( 'Minimum Qty:', 'event_espresso' )
82
+                            esc_html__('Minimum Qty:', 'event_espresso')
83 83
                             ); ?></span><?php echo $ticket->min() > 0 ? $ticket->min() : 0; ?>
84
-                        <?php if ( $ticket->min() > $remaining ) { ?> &nbsp; <span
84
+                        <?php if ($ticket->min() > $remaining) { ?> &nbsp; <span
85 85
                         class="important-notice small-text"><?php echo apply_filters(
86 86
                         'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_min_qty_message',
87 87
                         esc_html__(
@@ -92,18 +92,18 @@  discard block
 block discarded – undo
92 92
                         <?php //$max = min( $max, $max_atndz );?>
93 93
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
94 94
                             'FHEE__ticket_selector_chart_template__ticket_details_purchasable_quantities_max_qty',
95
-                            esc_html__( 'Maximum Qty:', 'event_espresso' )
96
-                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__( 'no limit', 'event_espresso' )
97
-                        : max( $ticket->max(), 1 ); ?><br/>
95
+                            esc_html__('Maximum Qty:', 'event_espresso')
96
+                            ); ?></span><?php echo $ticket->max() === EE_INF ? esc_html__('no limit', 'event_espresso')
97
+                        : max($ticket->max(), 1); ?><br/>
98 98
                     </section>
99 99
                     <br/>
100 100
                 <?php } ?>
101 101
 
102
-                <?php if ( ( ! defined( 'EE_DECAF' ) || EE_DECAF !== true ) && $ticket->uses() !== EE_INF ) { ?>
102
+                <?php if (( ! defined('EE_DECAF') || EE_DECAF !== true) && $ticket->uses() !== EE_INF) { ?>
103 103
                     <section class="tckt-slctr-tkt-uses-sctn">
104 104
                         <h5><?php echo apply_filters(
105 105
                                 'FHEE__ticket_selector_chart_template__ticket_details_event_date_ticket_uses_heading',
106
-                                esc_html__( 'Event Date Ticket Uses', 'event_espresso' )
106
+                                esc_html__('Event Date Ticket Uses', 'event_espresso')
107 107
                             ); ?></h5>
108 108
                         <span class="drk-grey-text small-text no-bold"> - <?php
109 109
                             echo apply_filters(
@@ -121,23 +121,23 @@  discard block
 block discarded – undo
121 121
                             ?></span><br/>
122 122
                         <span class="ticket-details-label-spn drk-grey-text"><?php echo apply_filters(
123 123
                             'FHEE__ticket_selector_chart_template__ticket_details_event_date_number_datetimes',
124
-                            esc_html__( '# Datetimes:', 'event_espresso' )
124
+                            esc_html__('# Datetimes:', 'event_espresso')
125 125
                             ); ?></span><?php echo $ticket->uses(); ?><br/>
126 126
                     </section>
127 127
                 <?php } ?>
128 128
 
129 129
                 <?php
130
-                $datetimes = $ticket->datetimes_ordered( $event_is_expired, false );
130
+                $datetimes = $ticket->datetimes_ordered($event_is_expired, false);
131 131
                 $chart_column_width = $show_ticket_sale_columns ? ' ee-fourth-width' : ' ee-half-width';
132
-                if ( ! empty( $datetimes ) ) { ?>
132
+                if ( ! empty($datetimes)) { ?>
133 133
                     <section class="tckt-slctr-tkt-datetimes-sctn">
134 134
                         <h5><?php echo apply_filters(
135 135
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_heading',
136
-                            esc_html__( 'Access', 'event_espresso' )
136
+                            esc_html__('Access', 'event_espresso')
137 137
                             ); ?></h5>
138 138
                         <span class="drk-grey-text small-text no-bold"> - <?php echo apply_filters(
139 139
                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_message',
140
-                            esc_html__( 'This option allows access to the following dates and times.', 'event_espresso' )
140
+                            esc_html__('This option allows access to the following dates and times.', 'event_espresso')
141 141
                             ); ?></span>
142 142
                         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
143 143
                             <table class="tckt-slctr-tkt-details-tbl">
@@ -147,38 +147,38 @@  discard block
 block discarded – undo
147 147
                                         <span class="dashicons dashicons-calendar"></span><span
148 148
                                         class="small-text"><?php echo apply_filters(
149 149
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
150
-                                            esc_html__( 'Date ', 'event_espresso' )
150
+                                            esc_html__('Date ', 'event_espresso')
151 151
                                             ); ?></span>
152 152
                                     </th>
153 153
                                     <th class="tckt-slctr-tkt-details-time-th <?php echo $chart_column_width; ?>">
154 154
                                         <span class="dashicons dashicons-clock"></span><span
155
-                                        class="small-text"><?php esc_html_e( 'Time ', 'event_espresso' ); ?></span>
155
+                                        class="small-text"><?php esc_html_e('Time ', 'event_espresso'); ?></span>
156 156
                                     </th>
157
-                                    <?php if ( $show_ticket_sale_columns ) : ?>
157
+                                    <?php if ($show_ticket_sale_columns) : ?>
158 158
                                         <th class="tckt-slctr-tkt-details-this-ticket-sold-th ee-fourth-width cntr">
159 159
                                             <span class="smaller-text"><?php echo apply_filters(
160 160
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
161
-                                                sprintf( esc_html__( 'Sold', 'event_espresso' ), '<br/>' )
161
+                                                sprintf(esc_html__('Sold', 'event_espresso'), '<br/>')
162 162
                                                 ); ?></span>
163 163
                                         </th>
164 164
                                         <th class="tckt-slctr-tkt-details-this-ticket-left-th ee-fourth-width cntr">
165 165
                                             <span class="smaller-text"><?php echo apply_filters(
166 166
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
167
-                                                sprintf( esc_html__( 'Remaining', 'event_espresso' ), '<br/>' )
167
+                                                sprintf(esc_html__('Remaining', 'event_espresso'), '<br/>')
168 168
                                                 ); ?></span>
169 169
                                         </th>
170 170
                                         <th
171 171
                                         class="tckt-slctr-tkt-details-total-tickets-sold-th ee-fourth-width cntr">
172 172
                                             <span class="smaller-text"><?php echo apply_filters(
173 173
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
174
-                                                sprintf( esc_html__( 'Total%sSold', 'event_espresso' ), '<br/>' )
174
+                                                sprintf(esc_html__('Total%sSold', 'event_espresso'), '<br/>')
175 175
                                                 ); ?></span>
176 176
                                         </th>
177 177
                                         <th
178 178
                                         class="tckt-slctr-tkt-details-total-tickets-left-th ee-fourth-width cntr">
179 179
                                             <span class="smaller-text"><?php echo apply_filters(
180 180
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
181
-                                                sprintf( esc_html__( 'Total Spaces%sLeft', 'event_espresso' ), '<br/>' )
181
+                                                sprintf(esc_html__('Total Spaces%sLeft', 'event_espresso'), '<br/>')
182 182
                                                 ); ?></span>
183 183
                                         </th>
184 184
                                     <?php endif; //end $show_ticket_sale_columns conditional ?>
@@ -186,62 +186,62 @@  discard block
 block discarded – undo
186 186
                                 </thead>
187 187
                                 <tbody>
188 188
                                 <?php
189
-                                foreach ( $datetimes as $datetime ) {
190
-                                    if ( $datetime instanceof EE_Datetime ) {
189
+                                foreach ($datetimes as $datetime) {
190
+                                    if ($datetime instanceof EE_Datetime) {
191 191
                                         ?>
192 192
 
193 193
                                         <tr>
194 194
                                             <td data-th="<?php echo apply_filters(
195 195
                                             'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_event_date',
196
-                                            esc_html__( 'Event Date ', 'event_espresso' )
196
+                                            esc_html__('Event Date ', 'event_espresso')
197 197
                                             ); ?>" class="small-text">
198 198
                                                 <?php $datetime_name = $datetime->name(); ?>
199
-                                                <?php echo ! empty( $datetime_name ) ? '<b>'
199
+                                                <?php echo ! empty($datetime_name) ? '<b>'
200 200
                                                                                        . $datetime_name
201 201
                                                                                        . '</b><br/>' : ''; ?>
202 202
                                                 <?php echo $datetime->date_range(
203 203
                                                 $date_format,
204
-                                                esc_html__( ' to  ', 'event_espresso' )
204
+                                                esc_html__(' to  ', 'event_espresso')
205 205
                                                 ); ?>
206 206
                                             </td>
207
-                                            <td data-th="<?php esc_html_e( 'Time ', 'event_espresso' ); ?>"
207
+                                            <td data-th="<?php esc_html_e('Time ', 'event_espresso'); ?>"
208 208
                                                 class="cntr small-text">
209 209
                                                 <?php echo $datetime->time_range(
210 210
                                                 $time_format,
211
-                                                esc_html__( ' to  ', 'event_espresso' )
211
+                                                esc_html__(' to  ', 'event_espresso')
212 212
                                                 ); ?>
213 213
                                             </td>
214
-                                            <?php if ( $show_ticket_sale_columns ) : ?>
214
+                                            <?php if ($show_ticket_sale_columns) : ?>
215 215
                                                 <td data-th="<?php echo apply_filters(
216 216
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_sold',
217
-                                                esc_html__( 'Sold', 'event_espresso' )
217
+                                                esc_html__('Sold', 'event_espresso')
218 218
                                                 ); ?>" class="cntr small-text">
219 219
                                                     <?php echo $ticket->sold(); ?>
220 220
                                                 </td>
221 221
                                                 <td data-th="<?php echo apply_filters(
222 222
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_this_ticket_left',
223
-                                                esc_html__( 'Remaining', 'event_espresso' )
223
+                                                esc_html__('Remaining', 'event_espresso')
224 224
                                                 ); ?>" class="cntr small-text">
225 225
                                                     <?php echo $remaining === EE_INF
226
-                                                    ? '<span class="smaller-text">' . esc_html__(
226
+                                                    ? '<span class="smaller-text">'.esc_html__(
227 227
                                                     'unlimited ',
228 228
                                                     'event_espresso'
229
-                                                    ) . '</span>' : $remaining; ?>
229
+                                                    ).'</span>' : $remaining; ?>
230 230
                                                 </td>
231 231
                                                 <td data-th="<?php echo apply_filters(
232 232
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_sold',
233
-                                                esc_html__( 'Total Sold', 'event_espresso' )
233
+                                                esc_html__('Total Sold', 'event_espresso')
234 234
                                                 ); ?>" class="cntr small-text">
235 235
                                                     <?php echo $datetime->sold(); ?>
236 236
                                                 </td>
237 237
                                                 <?php $tkts_left = $datetime->sold_out()
238
-                                                ? '<span class="sold-out smaller-text">' . esc_html__(
238
+                                                ? '<span class="sold-out smaller-text">'.esc_html__(
239 239
                                                 'Sold&nbsp;Out',
240 240
                                                 'event_espresso'
241
-                                                ) . '</span>' : $datetime->spaces_remaining(); ?>
241
+                                                ).'</span>' : $datetime->spaces_remaining(); ?>
242 242
                                                 <td data-th="<?php echo apply_filters(
243 243
                                                 'FHEE__ticket_selector_chart_template__ticket_details_event_access_table_total_ticket_left',
244
-                                                esc_html__( 'Total Spaces Left', 'event_espresso' )
244
+                                                esc_html__('Total Spaces Left', 'event_espresso')
245 245
                                                 ); ?>" class="cntr small-text">
246 246
                                                     <?php echo $tkts_left === EE_INF ? '<span class="smaller-text">'
247 247
                                                                                        . esc_html__(
@@ -266,4 +266,4 @@  discard block
 block discarded – undo
266 266
         </div>
267 267
     </td>
268 268
 </tr>
269
-<?php endif;  //end template_settings->show_ticket_details check?>
270 269
\ No newline at end of file
270
+<?php endif; //end template_settings->show_ticket_details check?>
271 271
\ No newline at end of file
Please login to merge, or discard this patch.
ticket_selector_caff/templates/ticket_selector_price_details.template.php 1 patch
Indentation   +15 added lines, -15 removed lines patch added patch discarded remove patch
@@ -7,7 +7,7 @@  discard block
 block discarded – undo
7 7
 if ($display_ticket_price) { ?>
8 8
     <section class="tckt-slctr-tkt-price-sctn">
9 9
         <h5><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_price_breakdown_heading',
10
-                esc_html__('Price', 'event_espresso')); ?></h5>
10
+				esc_html__('Price', 'event_espresso')); ?></h5>
11 11
         <div class="tckt-slctr-tkt-details-tbl-wrap-dv">
12 12
             <table class="tckt-slctr-tkt-details-tbl">
13 13
                 <thead>
@@ -30,12 +30,12 @@  discard block
 block discarded – undo
30 30
                             class="jst-rght small-text"><?php echo $ticket->base_price()->pretty_price(); ?></td>
31 31
                     </tr>
32 32
                     <?php
33
-                    $running_total = $ticket->base_price()->amount();
34
-                } else {
35
-                    $running_total = 0;
36
-                }
37
-                // now add price modifiers
38
-                foreach ($ticket->price_modifiers() as $price_mod) { ?>
33
+					$running_total = $ticket->base_price()->amount();
34
+				} else {
35
+					$running_total = 0;
36
+				}
37
+				// now add price modifiers
38
+				foreach ($ticket->price_modifiers() as $price_mod) { ?>
39 39
                     <tr>
40 40
                         <td data-th="<?php esc_html_e('Name', 'event_espresso'); ?>"
41 41
                             class="jst-rght small-text"><?php echo $price_mod->name(); ?></td>
@@ -45,16 +45,16 @@  discard block
 block discarded – undo
45 45
                                 %
46 46
                             </td>
47 47
                             <?php
48
-                            $new_sub_total = $running_total * ($price_mod->amount() / 100);
49
-                            $new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total;
50
-                            ?>
48
+							$new_sub_total = $running_total * ($price_mod->amount() / 100);
49
+							$new_sub_total = $price_mod->is_discount() ? $new_sub_total * -1 : $new_sub_total;
50
+							?>
51 51
                         <?php } else { ?>
52 52
                             <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1
53
-                                : $price_mod->amount(); ?>
53
+								: $price_mod->amount(); ?>
54 54
                             <td data-th="<?php esc_html_e('Description', 'event_espresso'); ?>"
55 55
                                 class="small-text"><?php echo $price_mod->desc(); ?></td>
56 56
                             <?php $new_sub_total = $price_mod->is_discount() ? $price_mod->amount() * -1
57
-                                : $price_mod->amount(); ?>
57
+								: $price_mod->amount(); ?>
58 58
                         <?php } ?>
59 59
                         <td data-th="<?php esc_html_e('Amount', 'event_espresso'); ?>"
60 60
                             class="jst-rght small-text"><?php echo EEH_Template::format_currency($new_sub_total); ?></td>
@@ -65,7 +65,7 @@  discard block
 block discarded – undo
65 65
                     <?php //$ticket_subtotal =$ticket->get_ticket_subtotal(); ?>
66 66
                     <tr>
67 67
                         <td colspan="2" class="jst-rght small-text sbttl"><b><?php esc_html_e('subtotal',
68
-                                    'event_espresso'); ?></b></td>
68
+									'event_espresso'); ?></b></td>
69 69
                         <td data-th="<?php esc_html_e('subtotal', 'event_espresso'); ?>" class="jst-rght small-text">
70 70
                             <b><?php echo EEH_Template::format_currency($running_total); ?></b></td>
71 71
                     </tr>
@@ -87,9 +87,9 @@  discard block
 block discarded – undo
87 87
                 <tr>
88 88
                     <td colspan="2" class="jst-rght small-text ttl-lbl-td">
89 89
                         <b><?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price',
90
-                                esc_html__('Total', 'event_espresso')); ?></b></td>
90
+								esc_html__('Total', 'event_espresso')); ?></b></td>
91 91
                     <td data-th="<?php echo apply_filters('FHEE__ticket_selector_chart_template__ticket_details_total_price',
92
-                        esc_html__('Total', 'event_espresso')); ?>" class="jst-rght small-text">
92
+						esc_html__('Total', 'event_espresso')); ?>" class="jst-rght small-text">
93 93
                         <b><?php echo EEH_Template::format_currency($running_total); ?></b></td>
94 94
                 </tr>
95 95
                 </tbody>
Please login to merge, or discard this patch.
core/EE_Front_Controller.core.php 2 patches
Indentation   +690 added lines, -690 removed lines patch added patch discarded remove patch
@@ -1,5 +1,5 @@  discard block
 block discarded – undo
1 1
 <?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
-    exit('No direct script access allowed');
2
+	exit('No direct script access allowed');
3 3
 }
4 4
 
5 5
 /**
@@ -22,695 +22,695 @@  discard block
 block discarded – undo
22 22
 final class EE_Front_Controller
23 23
 {
24 24
 
25
-    /**
26
-     *    $_template_path
27
-     * @var    string $_template_path
28
-     * @access    public
29
-     */
30
-    private $_template_path;
31
-
32
-    /**
33
-     *    $_template
34
-     * @var    string $_template
35
-     * @access    public
36
-     */
37
-    private $_template;
38
-
39
-    /**
40
-     * @type  EE_Registry $Registry
41
-     * @access    protected
42
-     */
43
-    protected $Registry;
44
-
45
-    /**
46
-     * @type  EE_Request_Handler $Request_Handler
47
-     * @access    protected
48
-     */
49
-    protected $Request_Handler;
50
-
51
-    /**
52
-     * @type  EE_Module_Request_Router $Module_Request_Router
53
-     * @access    protected
54
-     */
55
-    protected $Module_Request_Router;
56
-
57
-
58
-    /**
59
-     *    class constructor
60
-     *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
61
-     *
62
-     * @access    public
63
-     * @param \EE_Registry              $Registry
64
-     * @param \EE_Request_Handler       $Request_Handler
65
-     * @param \EE_Module_Request_Router $Module_Request_Router
66
-     */
67
-    public function __construct(
68
-        EE_Registry $Registry,
69
-        EE_Request_Handler $Request_Handler,
70
-        EE_Module_Request_Router $Module_Request_Router
71
-    ) {
72
-        $this->Registry              = $Registry;
73
-        $this->Request_Handler       = $Request_Handler;
74
-        $this->Module_Request_Router = $Module_Request_Router;
75
-        // make sure template tags are loaded immediately so that themes don't break
76
-        add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'load_espresso_template_tags'), 10);
77
-        // determine how to integrate WP_Query with the EE models
78
-        add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy'));
79
-        // load other resources and begin to actually run shortcodes and modules
80
-        add_action('wp_loaded', array($this, 'wp_loaded'), 5);
81
-        // analyse the incoming WP request
82
-        add_action('parse_request', array($this, 'get_request'), 1, 1);
83
-        // process any content shortcodes
84
-        add_action('parse_request', array($this, '_initialize_shortcodes'), 5);
85
-        // process request with module factory
86
-        add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
87
-        // before headers sent
88
-        add_action('wp', array($this, 'wp'), 5);
89
-        // load css and js
90
-        add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 1);
91
-        // header
92
-        add_action('wp_head', array($this, 'header_meta_tag'), 5);
93
-        add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
94
-        add_filter('template_include', array($this, 'template_include'), 1);
95
-        // display errors
96
-        add_action('loop_start', array($this, 'display_errors'), 2);
97
-        // the content
98
-        // add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
99
-        //exclude our private cpt comments
100
-        add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
101
-        //make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
102
-        add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
103
-        // action hook EE
104
-        do_action('AHEE__EE_Front_Controller__construct__done', $this);
105
-        // for checking that browser cookies are enabled
106
-        if (apply_filters('FHEE__EE_Front_Controller____construct__set_test_cookie', true)) {
107
-            setcookie('ee_cookie_test', uniqid(), time() + 24 * HOUR_IN_SECONDS, '/');
108
-        }
109
-    }
110
-
111
-
112
-    /**
113
-     * @return EE_Request_Handler
114
-     */
115
-    public function Request_Handler()
116
-    {
117
-        return $this->Request_Handler;
118
-    }
119
-
120
-
121
-    /**
122
-     * @return EE_Module_Request_Router
123
-     */
124
-    public function Module_Request_Router()
125
-    {
126
-        return $this->Module_Request_Router;
127
-    }
128
-
129
-
130
-
131
-
132
-
133
-    /***********************************************        INIT ACTION HOOK         ***********************************************/
134
-
135
-
136
-    /**
137
-     *    load_espresso_template_tags - if current theme is an espresso theme, or uses ee theme template parts, then
138
-     *    load it's functions.php file ( if not already loaded )
139
-     *
140
-     * @return void
141
-     */
142
-    public function load_espresso_template_tags()
143
-    {
144
-        if (is_readable(EE_PUBLIC . 'template_tags.php')) {
145
-            require_once(EE_PUBLIC . 'template_tags.php');
146
-        }
147
-    }
148
-
149
-
150
-    /**
151
-     * filter_wp_comments
152
-     * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
153
-     * widgets/queries done on frontend
154
-     *
155
-     * @param  array $clauses array of comment clauses setup by WP_Comment_Query
156
-     * @return array array of comment clauses with modifications.
157
-     */
158
-    public function filter_wp_comments($clauses)
159
-    {
160
-        global $wpdb;
161
-        if (strpos($clauses['join'], $wpdb->posts) !== false) {
162
-            $cpts = EE_Register_CPTs::get_private_CPTs();
163
-            foreach ($cpts as $cpt => $details) {
164
-                $clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
165
-            }
166
-        }
167
-        return $clauses;
168
-    }
169
-
170
-
171
-    /**
172
-     *    employ_CPT_Strategy
173
-     *
174
-     * @access    public
175
-     * @return    void
176
-     */
177
-    public function employ_CPT_Strategy()
178
-    {
179
-        if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) {
180
-            $this->Registry->load_core('CPT_Strategy');
181
-        }
182
-    }
183
-
184
-
185
-    /**
186
-     * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
187
-     *
188
-     * @param  string $url incoming url
189
-     * @return string         final assembled url
190
-     */
191
-    public function maybe_force_admin_ajax_ssl($url)
192
-    {
193
-        if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
194
-            $url = str_replace('http://', 'https://', $url);
195
-        }
196
-        return $url;
197
-    }
198
-
199
-
200
-
201
-
202
-
203
-
204
-    /***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
205
-
206
-
207
-    /**
208
-     *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
209
-     *    default priority init phases have run
210
-     *
211
-     * @access    public
212
-     * @return    void
213
-     */
214
-    public function wp_loaded()
215
-    {
216
-    }
217
-
218
-
219
-
220
-
221
-
222
-    /***********************************************        PARSE_REQUEST HOOK         ***********************************************/
223
-    /**
224
-     *    _get_request
225
-     *
226
-     * @access public
227
-     * @param WP $WP
228
-     * @return void
229
-     */
230
-    public function get_request(WP $WP)
231
-    {
232
-        do_action('AHEE__EE_Front_Controller__get_request__start');
233
-        $this->Request_Handler->parse_request($WP);
234
-        do_action('AHEE__EE_Front_Controller__get_request__complete');
235
-    }
236
-
237
-
238
-    /**
239
-     *    _initialize_shortcodes - calls init method on shortcodes that have been determined to be in the_content for
240
-     *    the currently requested page
241
-     *
242
-     * @access    public
243
-     * @param WP $WP
244
-     * @return    void
245
-     */
246
-    public function _initialize_shortcodes(WP $WP)
247
-    {
248
-        do_action('AHEE__EE_Front_Controller__initialize_shortcodes__begin', $WP, $this);
249
-        $this->Request_Handler->set_request_vars($WP);
250
-        // grab post_name from request
251
-        $current_post  = apply_filters('FHEE__EE_Front_Controller__initialize_shortcodes__current_post_name',
252
-            $this->Request_Handler->get('post_name'));
253
-        $show_on_front = get_option('show_on_front');
254
-        // if it's not set, then check if frontpage is blog
255
-        if (empty($current_post)) {
256
-            // yup.. this is the posts page, prepare to load all shortcode modules
257
-            $current_post = 'posts';
258
-            // unless..
259
-            if ($show_on_front === 'page') {
260
-                // some other page is set as the homepage
261
-                $page_on_front = get_option('page_on_front');
262
-                if ($page_on_front) {
263
-                    // k now we need to find the post_name for this page
264
-                    global $wpdb;
265
-                    $page_on_front = $wpdb->get_var(
266
-                        $wpdb->prepare(
267
-                            "SELECT post_name from $wpdb->posts WHERE post_type='page' AND post_status='publish' AND ID=%d",
268
-                            $page_on_front
269
-                        )
270
-                    );
271
-                    // set the current post slug to what it actually is
272
-                    $current_post = $page_on_front ? $page_on_front : $current_post;
273
-                }
274
-            }
275
-        }
276
-        // where are posts being displayed ?
277
-        $page_for_posts = EE_Config::get_page_for_posts();
278
-        // in case $current_post is hierarchical like: /parent-page/current-page
279
-        $current_post = basename($current_post);
280
-        // are we on a category page?
281
-        $term_exists = is_array(term_exists($current_post, 'category')) || array_key_exists('category_name',
282
-                $WP->query_vars);
283
-        // make sure shortcodes are set
284
-        if (isset($this->Registry->CFG->core->post_shortcodes)) {
285
-            if ( ! isset($this->Registry->CFG->core->post_shortcodes[$page_for_posts])) {
286
-                $this->Registry->CFG->core->post_shortcodes[$page_for_posts] = array();
287
-            }
288
-            // cycle thru all posts with shortcodes set
289
-            foreach ($this->Registry->CFG->core->post_shortcodes as $post_name => $post_shortcodes) {
290
-                // filter shortcodes so
291
-                $post_shortcodes = apply_filters('FHEE__Front_Controller__initialize_shortcodes__post_shortcodes',
292
-                    $post_shortcodes);
293
-                // now cycle thru shortcodes
294
-                foreach ($post_shortcodes as $shortcode_class => $post_id) {
295
-                    // are we on this page, or on the blog page, or an EE CPT category page ?
296
-                    if ($current_post === $post_name || $term_exists) {
297
-                        // maybe init the shortcode
298
-                        $this->initialize_shortcode_if_active_on_page(
299
-                            $shortcode_class,
300
-                            $current_post,
301
-                            $page_for_posts,
302
-                            $post_id,
303
-                            $term_exists,
304
-                            $WP
305
-                        );
306
-                        // if this is NOT the "Posts page" and we have a valid entry
307
-                        // for the "Posts page" in our tracked post_shortcodes array
308
-                        // but the shortcode is not being tracked for this page
309
-                    } else if (
310
-                        $post_name !== $page_for_posts
311
-                        && isset($this->Registry->CFG->core->post_shortcodes[$page_for_posts])
312
-                        && ! isset($this->Registry->CFG->core->post_shortcodes[$page_for_posts][$shortcode_class])
313
-                    ) {
314
-                        // then remove the "fallback" shortcode processor
315
-                        remove_shortcode($shortcode_class);
316
-                    }
317
-                }
318
-            }
319
-        }
320
-        do_action('AHEE__EE_Front_Controller__initialize_shortcodes__end', $this);
321
-    }
322
-
323
-
324
-    /**
325
-     * @param string $shortcode_class
326
-     * @param string $current_post
327
-     * @param string $page_for_posts
328
-     * @param int    $post_id
329
-     * @param bool   $term_exists
330
-     * @param WP     $WP
331
-     */
332
-    protected function initialize_shortcode_if_active_on_page(
333
-        $shortcode_class,
334
-        $current_post,
335
-        $page_for_posts,
336
-        $post_id,
337
-        $term_exists,
338
-        $WP
339
-    ) {
340
-        // verify shortcode is in list of registered shortcodes
341
-        if ( ! isset($this->Registry->shortcodes->{$shortcode_class})) {
342
-            if ($current_post !== $page_for_posts && current_user_can('edit_post', $post_id)) {
343
-                EE_Error::add_error(
344
-                    sprintf(
345
-                        __(
346
-                            'The [%s] shortcode has not been properly registered or the corresponding addon/module is not active for some reason. Either fix/remove the shortcode from the post, or activate the addon/module the shortcode is associated with.',
347
-                            'event_espresso'
348
-                        ),
349
-                        $shortcode_class
350
-                    ),
351
-                    __FILE__,
352
-                    __FUNCTION__,
353
-                    __LINE__
354
-                );
355
-                add_filter('FHEE_run_EE_the_content', '__return_true');
356
-            }
357
-            add_shortcode($shortcode_class, array('EES_Shortcode', 'invalid_shortcode_processor'));
358
-            return;
359
-        }
360
-        // is this : a shortcodes set exclusively for this post, or for the home page, or a category, or a taxonomy ?
361
-        if (
362
-            $term_exists
363
-            || $current_post === $page_for_posts
364
-            || isset($this->Registry->CFG->core->post_shortcodes[$current_post])
365
-        ) {
366
-            // let's pause to reflect on this...
367
-            $sc_reflector = new ReflectionClass('EES_' . $shortcode_class);
368
-            // ensure that class is actually a shortcode
369
-            if (
370
-                defined('WP_DEBUG')
371
-                && WP_DEBUG === true
372
-                && ! $sc_reflector->isSubclassOf('EES_Shortcode')
373
-            ) {
374
-                EE_Error::add_error(
375
-                    sprintf(
376
-                        __(
377
-                            'The requested %s shortcode is not of the class "EES_Shortcode". Please check your files.',
378
-                            'event_espresso'
379
-                        ),
380
-                        $shortcode_class
381
-                    ),
382
-                    __FILE__,
383
-                    __FUNCTION__,
384
-                    __LINE__
385
-                );
386
-                add_filter('FHEE_run_EE_the_content', '__return_true');
387
-                return;
388
-            }
389
-            // and pass the request object to the run method
390
-            $this->Registry->shortcodes->{$shortcode_class} = $sc_reflector->newInstance();
391
-            // fire the shortcode class's run method, so that it can activate resources
392
-            $this->Registry->shortcodes->{$shortcode_class}->run($WP);
393
-        }
394
-    }
395
-
396
-
397
-    /**
398
-     *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
399
-     *
400
-     * @access    public
401
-     * @param   WP_Query $WP_Query
402
-     * @return    void
403
-     */
404
-    public function pre_get_posts($WP_Query)
405
-    {
406
-        // only load Module_Request_Router if this is the main query
407
-        if (
408
-            $this->Module_Request_Router instanceof EE_Module_Request_Router
409
-            && $WP_Query->is_main_query()
410
-        ) {
411
-            // cycle thru module routes
412
-            while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
413
-                // determine module and method for route
414
-                $module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
415
-                if ($module instanceof EED_Module) {
416
-                    // get registered view for route
417
-                    $this->_template_path = $this->Module_Request_Router->get_view($route);
418
-                    // grab module name
419
-                    $module_name = $module->module_name();
420
-                    // map the module to the module objects
421
-                    $this->Registry->modules->{$module_name} = $module;
422
-                }
423
-            }
424
-        }
425
-    }
426
-
427
-
428
-
429
-
430
-
431
-    /***********************************************        WP HOOK         ***********************************************/
432
-
433
-
434
-    /**
435
-     *    wp - basically last chance to do stuff before headers sent
436
-     *
437
-     * @access    public
438
-     * @return    void
439
-     */
440
-    public function wp()
441
-    {
442
-    }
443
-
444
-
445
-
446
-    /***********************************************        WP_ENQUEUE_SCRIPTS && WP_HEAD HOOK         ***********************************************/
447
-
448
-
449
-    /**
450
-     *    wp_enqueue_scripts
451
-     *
452
-     * @access    public
453
-     * @return    void
454
-     */
455
-    public function wp_enqueue_scripts()
456
-    {
457
-
458
-        // css is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF  via:  add_filter( 'FHEE_load_css', '__return_false' );
459
-        if (apply_filters('FHEE_load_css', true)) {
460
-
461
-            $this->Registry->CFG->template_settings->enable_default_style = true;
462
-            //Load the ThemeRoller styles if enabled
463
-            if (isset($this->Registry->CFG->template_settings->enable_default_style) && $this->Registry->CFG->template_settings->enable_default_style) {
464
-
465
-                //Load custom style sheet if available
466
-                if (isset($this->Registry->CFG->template_settings->custom_style_sheet)) {
467
-                    wp_register_style('espresso_custom_css',
468
-                        EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->Registry->CFG->template_settings->custom_style_sheet,
469
-                        EVENT_ESPRESSO_VERSION);
470
-                    wp_enqueue_style('espresso_custom_css');
471
-                }
472
-
473
-                if (is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css')) {
474
-                    wp_register_style('espresso_default', EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css',
475
-                        array('dashicons'), EVENT_ESPRESSO_VERSION);
476
-                } else {
477
-                    wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
478
-                        array('dashicons'), EVENT_ESPRESSO_VERSION);
479
-                }
480
-                wp_enqueue_style('espresso_default');
481
-
482
-                if (is_readable(get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'style.css')) {
483
-                    wp_register_style('espresso_style',
484
-                        get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'style.css',
485
-                        array('dashicons', 'espresso_default'));
486
-                } else {
487
-                    wp_register_style('espresso_style',
488
-                        EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'style.css',
489
-                        array('dashicons', 'espresso_default'));
490
-                }
491
-
492
-            }
493
-
494
-        }
495
-
496
-        // js is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF  via:  add_filter( 'FHEE_load_js', '__return_false' );
497
-        if (apply_filters('FHEE_load_js', true)) {
498
-
499
-            wp_enqueue_script('jquery');
500
-            //let's make sure that all required scripts have been setup
501
-            if (function_exists('wp_script_is') && ! wp_script_is('jquery')) {
502
-                $msg = sprintf(
503
-                    __('%sJquery is not loaded!%sEvent Espresso is unable to load Jquery due to a conflict with your theme or another plugin.',
504
-                        'event_espresso'),
505
-                    '<em><br />',
506
-                    '</em>'
507
-                );
508
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
509
-            }
510
-            // load core js
511
-            wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'),
512
-                EVENT_ESPRESSO_VERSION, true);
513
-            wp_enqueue_script('espresso_core');
514
-            wp_localize_script('espresso_core', 'eei18n', EE_Registry::$i18n_js_strings);
515
-
516
-        }
517
-
518
-        //qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' );
519
-        if (apply_filters('FHEE_load_qtip', false)) {
520
-            EEH_Qtip_Loader::instance()->register_and_enqueue();
521
-        }
522
-
523
-
524
-        //accounting.js library
525
-        // @link http://josscrowcroft.github.io/accounting.js/
526
-        if (apply_filters('FHEE_load_accounting_js', false)) {
527
-            $acct_js = EE_THIRD_PARTY_URL . 'accounting/accounting.js';
528
-            wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
529
-                array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, true);
530
-            wp_register_script('ee-accounting-core', $acct_js, array('underscore'), '0.3.2', true);
531
-            wp_enqueue_script('ee-accounting');
532
-
533
-            $currency_config = array(
534
-                'currency' => array(
535
-                    'symbol'    => $this->Registry->CFG->currency->sign,
536
-                    'format'    => array(
537
-                        'pos'  => $this->Registry->CFG->currency->sign_b4 ? '%s%v' : '%v%s',
538
-                        'neg'  => $this->Registry->CFG->currency->sign_b4 ? '- %s%v' : '- %v%s',
539
-                        'zero' => $this->Registry->CFG->currency->sign_b4 ? '%s--' : '--%s',
540
-                    ),
541
-                    'decimal'   => $this->Registry->CFG->currency->dec_mrk,
542
-                    'thousand'  => $this->Registry->CFG->currency->thsnds,
543
-                    'precision' => $this->Registry->CFG->currency->dec_plc,
544
-                ),
545
-                'number'   => array(
546
-                    'precision' => 0,
547
-                    'thousand'  => $this->Registry->CFG->currency->thsnds,
548
-                    'decimal'   => $this->Registry->CFG->currency->dec_mrk,
549
-                ),
550
-            );
551
-            wp_localize_script('ee-accounting', 'EE_ACCOUNTING_CFG', $currency_config);
552
-        }
553
-
554
-        if ( ! function_exists('wp_head')) {
555
-            $msg = sprintf(
556
-                __('%sMissing wp_head() function.%sThe WordPress function wp_head() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.',
557
-                    'event_espresso'),
558
-                '<em><br />',
559
-                '</em>'
560
-            );
561
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
562
-        }
563
-        if ( ! function_exists('wp_footer')) {
564
-            $msg = sprintf(
565
-                __('%sMissing wp_footer() function.%sThe WordPress function wp_footer() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.',
566
-                    'event_espresso'),
567
-                '<em><br />',
568
-                '</em>'
569
-            );
570
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
571
-        }
572
-
573
-    }
574
-
575
-
576
-    /**
577
-     *    header_meta_tag
578
-     *
579
-     * @access    public
580
-     * @return    void
581
-     */
582
-    public function header_meta_tag()
583
-    {
584
-        print(
585
-            apply_filters(
586
-                'FHEE__EE_Front_Controller__header_meta_tag',
587
-                '<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n")
588
-        );
589
-
590
-        //let's exclude all event type taxonomy term archive pages from search engine indexing
591
-        //@see https://events.codebasehq.com/projects/event-espresso/tickets/10249
592
-        //also exclude all critical pages from indexing
593
-        if (
594
-            (
595
-                is_tax('espresso_event_type')
596
-                && get_option( 'blog_public' ) !== '0'
597
-            )
598
-            || is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
599
-        ) {
600
-            print(
601
-                apply_filters(
602
-                    'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
603
-                    '<meta name="robots" content="noindex,follow" />' . "\n"
604
-                )
605
-            );
606
-        }
607
-    }
608
-
609
-
610
-
611
-    /**
612
-     * wp_print_scripts
613
-     *
614
-     * @return void
615
-     */
616
-    public function wp_print_scripts()
617
-    {
618
-        global $post;
619
-        if (
620
-            get_post_type() === 'espresso_events' 
621
-            && is_singular() 
622
-            && isset($post->EE_Event)
623
-            && $post->EE_Event instanceof EE_Event
624
-        ) {
625
-            \EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
626
-        }
627
-    }
628
-
629
-
630
-
631
-    /***********************************************        THE_CONTENT FILTER HOOK         ***********************************************/
632
-
633
-
634
-
635
-    /**
636
-     *    the_content
637
-     *
638
-     * @access    public
639
-     * @param   $the_content
640
-     * @return    string
641
-     */
642
-    // public function the_content( $the_content ) {
643
-    // 	// nothing gets loaded at this point unless other systems turn this hookpoint on by using:  add_filter( 'FHEE_run_EE_the_content', '__return_true' );
644
-    // 	if ( apply_filters( 'FHEE_run_EE_the_content', FALSE ) ) {
645
-    // 	}
646
-    // 	return $the_content;
647
-    // }
648
-
649
-
650
-    /***********************************************        WP_FOOTER         ***********************************************/
651
-
652
-
653
-    /**
654
-     *    display_errors
655
-     *
656
-     * @access    public
657
-     * @return    string
658
-     */
659
-    public function display_errors()
660
-    {
661
-        static $shown_already = false;
662
-        do_action('AHEE__EE_Front_Controller__display_errors__begin');
663
-        if (
664
-            ! $shown_already
665
-            && apply_filters('FHEE__EE_Front_Controller__display_errors', true)
666
-            && is_main_query()
667
-            && ! is_feed()
668
-            && in_the_loop()
669
-            && $this->Request_Handler->is_espresso_page()
670
-        ) {
671
-            echo EE_Error::get_notices();
672
-            $shown_already = true;
673
-            EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
674
-        }
675
-        do_action('AHEE__EE_Front_Controller__display_errors__end');
676
-    }
677
-
678
-
679
-
680
-
681
-
682
-    /***********************************************        UTILITIES         ***********************************************/
683
-    /**
684
-     *    template_include
685
-     *
686
-     * @access    public
687
-     * @param   string $template_include_path
688
-     * @return    string
689
-     */
690
-    public function template_include($template_include_path = null)
691
-    {
692
-        if ($this->Request_Handler->is_espresso_page()) {
693
-            $this->_template_path = ! empty($this->_template_path) ? basename($this->_template_path) : basename($template_include_path);
694
-            $template_path        = EEH_Template::locate_template($this->_template_path, array(), false);
695
-            $this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
696
-            $this->_template      = basename($this->_template_path);
697
-            return $this->_template_path;
698
-        }
699
-        return $template_include_path;
700
-    }
701
-
702
-
703
-    /**
704
-     *    get_selected_template
705
-     *
706
-     * @access    public
707
-     * @param bool $with_path
708
-     * @return    string
709
-     */
710
-    public function get_selected_template($with_path = false)
711
-    {
712
-        return $with_path ? $this->_template_path : $this->_template;
713
-    }
25
+	/**
26
+	 *    $_template_path
27
+	 * @var    string $_template_path
28
+	 * @access    public
29
+	 */
30
+	private $_template_path;
31
+
32
+	/**
33
+	 *    $_template
34
+	 * @var    string $_template
35
+	 * @access    public
36
+	 */
37
+	private $_template;
38
+
39
+	/**
40
+	 * @type  EE_Registry $Registry
41
+	 * @access    protected
42
+	 */
43
+	protected $Registry;
44
+
45
+	/**
46
+	 * @type  EE_Request_Handler $Request_Handler
47
+	 * @access    protected
48
+	 */
49
+	protected $Request_Handler;
50
+
51
+	/**
52
+	 * @type  EE_Module_Request_Router $Module_Request_Router
53
+	 * @access    protected
54
+	 */
55
+	protected $Module_Request_Router;
56
+
57
+
58
+	/**
59
+	 *    class constructor
60
+	 *    should fire after shortcode, module, addon, or other plugin's default priority init phases have run
61
+	 *
62
+	 * @access    public
63
+	 * @param \EE_Registry              $Registry
64
+	 * @param \EE_Request_Handler       $Request_Handler
65
+	 * @param \EE_Module_Request_Router $Module_Request_Router
66
+	 */
67
+	public function __construct(
68
+		EE_Registry $Registry,
69
+		EE_Request_Handler $Request_Handler,
70
+		EE_Module_Request_Router $Module_Request_Router
71
+	) {
72
+		$this->Registry              = $Registry;
73
+		$this->Request_Handler       = $Request_Handler;
74
+		$this->Module_Request_Router = $Module_Request_Router;
75
+		// make sure template tags are loaded immediately so that themes don't break
76
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'load_espresso_template_tags'), 10);
77
+		// determine how to integrate WP_Query with the EE models
78
+		add_action('AHEE__EE_System__initialize', array($this, 'employ_CPT_Strategy'));
79
+		// load other resources and begin to actually run shortcodes and modules
80
+		add_action('wp_loaded', array($this, 'wp_loaded'), 5);
81
+		// analyse the incoming WP request
82
+		add_action('parse_request', array($this, 'get_request'), 1, 1);
83
+		// process any content shortcodes
84
+		add_action('parse_request', array($this, '_initialize_shortcodes'), 5);
85
+		// process request with module factory
86
+		add_action('pre_get_posts', array($this, 'pre_get_posts'), 10, 1);
87
+		// before headers sent
88
+		add_action('wp', array($this, 'wp'), 5);
89
+		// load css and js
90
+		add_action('wp_enqueue_scripts', array($this, 'wp_enqueue_scripts'), 1);
91
+		// header
92
+		add_action('wp_head', array($this, 'header_meta_tag'), 5);
93
+		add_action('wp_print_scripts', array($this, 'wp_print_scripts'), 10);
94
+		add_filter('template_include', array($this, 'template_include'), 1);
95
+		// display errors
96
+		add_action('loop_start', array($this, 'display_errors'), 2);
97
+		// the content
98
+		// add_filter( 'the_content', array( $this, 'the_content' ), 5, 1 );
99
+		//exclude our private cpt comments
100
+		add_filter('comments_clauses', array($this, 'filter_wp_comments'), 10, 1);
101
+		//make sure any ajax requests will respect the url schema when requests are made against admin-ajax.php (http:// or https://)
102
+		add_filter('admin_url', array($this, 'maybe_force_admin_ajax_ssl'), 200, 1);
103
+		// action hook EE
104
+		do_action('AHEE__EE_Front_Controller__construct__done', $this);
105
+		// for checking that browser cookies are enabled
106
+		if (apply_filters('FHEE__EE_Front_Controller____construct__set_test_cookie', true)) {
107
+			setcookie('ee_cookie_test', uniqid(), time() + 24 * HOUR_IN_SECONDS, '/');
108
+		}
109
+	}
110
+
111
+
112
+	/**
113
+	 * @return EE_Request_Handler
114
+	 */
115
+	public function Request_Handler()
116
+	{
117
+		return $this->Request_Handler;
118
+	}
119
+
120
+
121
+	/**
122
+	 * @return EE_Module_Request_Router
123
+	 */
124
+	public function Module_Request_Router()
125
+	{
126
+		return $this->Module_Request_Router;
127
+	}
128
+
129
+
130
+
131
+
132
+
133
+	/***********************************************        INIT ACTION HOOK         ***********************************************/
134
+
135
+
136
+	/**
137
+	 *    load_espresso_template_tags - if current theme is an espresso theme, or uses ee theme template parts, then
138
+	 *    load it's functions.php file ( if not already loaded )
139
+	 *
140
+	 * @return void
141
+	 */
142
+	public function load_espresso_template_tags()
143
+	{
144
+		if (is_readable(EE_PUBLIC . 'template_tags.php')) {
145
+			require_once(EE_PUBLIC . 'template_tags.php');
146
+		}
147
+	}
148
+
149
+
150
+	/**
151
+	 * filter_wp_comments
152
+	 * This simply makes sure that any "private" EE CPTs do not have their comments show up in any wp comment
153
+	 * widgets/queries done on frontend
154
+	 *
155
+	 * @param  array $clauses array of comment clauses setup by WP_Comment_Query
156
+	 * @return array array of comment clauses with modifications.
157
+	 */
158
+	public function filter_wp_comments($clauses)
159
+	{
160
+		global $wpdb;
161
+		if (strpos($clauses['join'], $wpdb->posts) !== false) {
162
+			$cpts = EE_Register_CPTs::get_private_CPTs();
163
+			foreach ($cpts as $cpt => $details) {
164
+				$clauses['where'] .= $wpdb->prepare(" AND $wpdb->posts.post_type != %s", $cpt);
165
+			}
166
+		}
167
+		return $clauses;
168
+	}
169
+
170
+
171
+	/**
172
+	 *    employ_CPT_Strategy
173
+	 *
174
+	 * @access    public
175
+	 * @return    void
176
+	 */
177
+	public function employ_CPT_Strategy()
178
+	{
179
+		if (apply_filters('FHEE__EE_Front_Controller__employ_CPT_Strategy', true)) {
180
+			$this->Registry->load_core('CPT_Strategy');
181
+		}
182
+	}
183
+
184
+
185
+	/**
186
+	 * this just makes sure that if the site is using ssl that we force that for any admin ajax calls from frontend
187
+	 *
188
+	 * @param  string $url incoming url
189
+	 * @return string         final assembled url
190
+	 */
191
+	public function maybe_force_admin_ajax_ssl($url)
192
+	{
193
+		if (is_ssl() && preg_match('/admin-ajax.php/', $url)) {
194
+			$url = str_replace('http://', 'https://', $url);
195
+		}
196
+		return $url;
197
+	}
198
+
199
+
200
+
201
+
202
+
203
+
204
+	/***********************************************        WP_LOADED ACTION HOOK         ***********************************************/
205
+
206
+
207
+	/**
208
+	 *    wp_loaded - should fire after shortcode, module, addon, or other plugin's have been registered and their
209
+	 *    default priority init phases have run
210
+	 *
211
+	 * @access    public
212
+	 * @return    void
213
+	 */
214
+	public function wp_loaded()
215
+	{
216
+	}
217
+
218
+
219
+
220
+
221
+
222
+	/***********************************************        PARSE_REQUEST HOOK         ***********************************************/
223
+	/**
224
+	 *    _get_request
225
+	 *
226
+	 * @access public
227
+	 * @param WP $WP
228
+	 * @return void
229
+	 */
230
+	public function get_request(WP $WP)
231
+	{
232
+		do_action('AHEE__EE_Front_Controller__get_request__start');
233
+		$this->Request_Handler->parse_request($WP);
234
+		do_action('AHEE__EE_Front_Controller__get_request__complete');
235
+	}
236
+
237
+
238
+	/**
239
+	 *    _initialize_shortcodes - calls init method on shortcodes that have been determined to be in the_content for
240
+	 *    the currently requested page
241
+	 *
242
+	 * @access    public
243
+	 * @param WP $WP
244
+	 * @return    void
245
+	 */
246
+	public function _initialize_shortcodes(WP $WP)
247
+	{
248
+		do_action('AHEE__EE_Front_Controller__initialize_shortcodes__begin', $WP, $this);
249
+		$this->Request_Handler->set_request_vars($WP);
250
+		// grab post_name from request
251
+		$current_post  = apply_filters('FHEE__EE_Front_Controller__initialize_shortcodes__current_post_name',
252
+			$this->Request_Handler->get('post_name'));
253
+		$show_on_front = get_option('show_on_front');
254
+		// if it's not set, then check if frontpage is blog
255
+		if (empty($current_post)) {
256
+			// yup.. this is the posts page, prepare to load all shortcode modules
257
+			$current_post = 'posts';
258
+			// unless..
259
+			if ($show_on_front === 'page') {
260
+				// some other page is set as the homepage
261
+				$page_on_front = get_option('page_on_front');
262
+				if ($page_on_front) {
263
+					// k now we need to find the post_name for this page
264
+					global $wpdb;
265
+					$page_on_front = $wpdb->get_var(
266
+						$wpdb->prepare(
267
+							"SELECT post_name from $wpdb->posts WHERE post_type='page' AND post_status='publish' AND ID=%d",
268
+							$page_on_front
269
+						)
270
+					);
271
+					// set the current post slug to what it actually is
272
+					$current_post = $page_on_front ? $page_on_front : $current_post;
273
+				}
274
+			}
275
+		}
276
+		// where are posts being displayed ?
277
+		$page_for_posts = EE_Config::get_page_for_posts();
278
+		// in case $current_post is hierarchical like: /parent-page/current-page
279
+		$current_post = basename($current_post);
280
+		// are we on a category page?
281
+		$term_exists = is_array(term_exists($current_post, 'category')) || array_key_exists('category_name',
282
+				$WP->query_vars);
283
+		// make sure shortcodes are set
284
+		if (isset($this->Registry->CFG->core->post_shortcodes)) {
285
+			if ( ! isset($this->Registry->CFG->core->post_shortcodes[$page_for_posts])) {
286
+				$this->Registry->CFG->core->post_shortcodes[$page_for_posts] = array();
287
+			}
288
+			// cycle thru all posts with shortcodes set
289
+			foreach ($this->Registry->CFG->core->post_shortcodes as $post_name => $post_shortcodes) {
290
+				// filter shortcodes so
291
+				$post_shortcodes = apply_filters('FHEE__Front_Controller__initialize_shortcodes__post_shortcodes',
292
+					$post_shortcodes);
293
+				// now cycle thru shortcodes
294
+				foreach ($post_shortcodes as $shortcode_class => $post_id) {
295
+					// are we on this page, or on the blog page, or an EE CPT category page ?
296
+					if ($current_post === $post_name || $term_exists) {
297
+						// maybe init the shortcode
298
+						$this->initialize_shortcode_if_active_on_page(
299
+							$shortcode_class,
300
+							$current_post,
301
+							$page_for_posts,
302
+							$post_id,
303
+							$term_exists,
304
+							$WP
305
+						);
306
+						// if this is NOT the "Posts page" and we have a valid entry
307
+						// for the "Posts page" in our tracked post_shortcodes array
308
+						// but the shortcode is not being tracked for this page
309
+					} else if (
310
+						$post_name !== $page_for_posts
311
+						&& isset($this->Registry->CFG->core->post_shortcodes[$page_for_posts])
312
+						&& ! isset($this->Registry->CFG->core->post_shortcodes[$page_for_posts][$shortcode_class])
313
+					) {
314
+						// then remove the "fallback" shortcode processor
315
+						remove_shortcode($shortcode_class);
316
+					}
317
+				}
318
+			}
319
+		}
320
+		do_action('AHEE__EE_Front_Controller__initialize_shortcodes__end', $this);
321
+	}
322
+
323
+
324
+	/**
325
+	 * @param string $shortcode_class
326
+	 * @param string $current_post
327
+	 * @param string $page_for_posts
328
+	 * @param int    $post_id
329
+	 * @param bool   $term_exists
330
+	 * @param WP     $WP
331
+	 */
332
+	protected function initialize_shortcode_if_active_on_page(
333
+		$shortcode_class,
334
+		$current_post,
335
+		$page_for_posts,
336
+		$post_id,
337
+		$term_exists,
338
+		$WP
339
+	) {
340
+		// verify shortcode is in list of registered shortcodes
341
+		if ( ! isset($this->Registry->shortcodes->{$shortcode_class})) {
342
+			if ($current_post !== $page_for_posts && current_user_can('edit_post', $post_id)) {
343
+				EE_Error::add_error(
344
+					sprintf(
345
+						__(
346
+							'The [%s] shortcode has not been properly registered or the corresponding addon/module is not active for some reason. Either fix/remove the shortcode from the post, or activate the addon/module the shortcode is associated with.',
347
+							'event_espresso'
348
+						),
349
+						$shortcode_class
350
+					),
351
+					__FILE__,
352
+					__FUNCTION__,
353
+					__LINE__
354
+				);
355
+				add_filter('FHEE_run_EE_the_content', '__return_true');
356
+			}
357
+			add_shortcode($shortcode_class, array('EES_Shortcode', 'invalid_shortcode_processor'));
358
+			return;
359
+		}
360
+		// is this : a shortcodes set exclusively for this post, or for the home page, or a category, or a taxonomy ?
361
+		if (
362
+			$term_exists
363
+			|| $current_post === $page_for_posts
364
+			|| isset($this->Registry->CFG->core->post_shortcodes[$current_post])
365
+		) {
366
+			// let's pause to reflect on this...
367
+			$sc_reflector = new ReflectionClass('EES_' . $shortcode_class);
368
+			// ensure that class is actually a shortcode
369
+			if (
370
+				defined('WP_DEBUG')
371
+				&& WP_DEBUG === true
372
+				&& ! $sc_reflector->isSubclassOf('EES_Shortcode')
373
+			) {
374
+				EE_Error::add_error(
375
+					sprintf(
376
+						__(
377
+							'The requested %s shortcode is not of the class "EES_Shortcode". Please check your files.',
378
+							'event_espresso'
379
+						),
380
+						$shortcode_class
381
+					),
382
+					__FILE__,
383
+					__FUNCTION__,
384
+					__LINE__
385
+				);
386
+				add_filter('FHEE_run_EE_the_content', '__return_true');
387
+				return;
388
+			}
389
+			// and pass the request object to the run method
390
+			$this->Registry->shortcodes->{$shortcode_class} = $sc_reflector->newInstance();
391
+			// fire the shortcode class's run method, so that it can activate resources
392
+			$this->Registry->shortcodes->{$shortcode_class}->run($WP);
393
+		}
394
+	}
395
+
396
+
397
+	/**
398
+	 *    pre_get_posts - basically a module factory for instantiating modules and selecting the final view template
399
+	 *
400
+	 * @access    public
401
+	 * @param   WP_Query $WP_Query
402
+	 * @return    void
403
+	 */
404
+	public function pre_get_posts($WP_Query)
405
+	{
406
+		// only load Module_Request_Router if this is the main query
407
+		if (
408
+			$this->Module_Request_Router instanceof EE_Module_Request_Router
409
+			&& $WP_Query->is_main_query()
410
+		) {
411
+			// cycle thru module routes
412
+			while ($route = $this->Module_Request_Router->get_route($WP_Query)) {
413
+				// determine module and method for route
414
+				$module = $this->Module_Request_Router->resolve_route($route[0], $route[1]);
415
+				if ($module instanceof EED_Module) {
416
+					// get registered view for route
417
+					$this->_template_path = $this->Module_Request_Router->get_view($route);
418
+					// grab module name
419
+					$module_name = $module->module_name();
420
+					// map the module to the module objects
421
+					$this->Registry->modules->{$module_name} = $module;
422
+				}
423
+			}
424
+		}
425
+	}
426
+
427
+
428
+
429
+
430
+
431
+	/***********************************************        WP HOOK         ***********************************************/
432
+
433
+
434
+	/**
435
+	 *    wp - basically last chance to do stuff before headers sent
436
+	 *
437
+	 * @access    public
438
+	 * @return    void
439
+	 */
440
+	public function wp()
441
+	{
442
+	}
443
+
444
+
445
+
446
+	/***********************************************        WP_ENQUEUE_SCRIPTS && WP_HEAD HOOK         ***********************************************/
447
+
448
+
449
+	/**
450
+	 *    wp_enqueue_scripts
451
+	 *
452
+	 * @access    public
453
+	 * @return    void
454
+	 */
455
+	public function wp_enqueue_scripts()
456
+	{
457
+
458
+		// css is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF  via:  add_filter( 'FHEE_load_css', '__return_false' );
459
+		if (apply_filters('FHEE_load_css', true)) {
460
+
461
+			$this->Registry->CFG->template_settings->enable_default_style = true;
462
+			//Load the ThemeRoller styles if enabled
463
+			if (isset($this->Registry->CFG->template_settings->enable_default_style) && $this->Registry->CFG->template_settings->enable_default_style) {
464
+
465
+				//Load custom style sheet if available
466
+				if (isset($this->Registry->CFG->template_settings->custom_style_sheet)) {
467
+					wp_register_style('espresso_custom_css',
468
+						EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->Registry->CFG->template_settings->custom_style_sheet,
469
+						EVENT_ESPRESSO_VERSION);
470
+					wp_enqueue_style('espresso_custom_css');
471
+				}
472
+
473
+				if (is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css')) {
474
+					wp_register_style('espresso_default', EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css',
475
+						array('dashicons'), EVENT_ESPRESSO_VERSION);
476
+				} else {
477
+					wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
478
+						array('dashicons'), EVENT_ESPRESSO_VERSION);
479
+				}
480
+				wp_enqueue_style('espresso_default');
481
+
482
+				if (is_readable(get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'style.css')) {
483
+					wp_register_style('espresso_style',
484
+						get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'style.css',
485
+						array('dashicons', 'espresso_default'));
486
+				} else {
487
+					wp_register_style('espresso_style',
488
+						EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'style.css',
489
+						array('dashicons', 'espresso_default'));
490
+				}
491
+
492
+			}
493
+
494
+		}
495
+
496
+		// js is turned ON by default, but prior to the wp_enqueue_scripts hook, can be turned OFF  via:  add_filter( 'FHEE_load_js', '__return_false' );
497
+		if (apply_filters('FHEE_load_js', true)) {
498
+
499
+			wp_enqueue_script('jquery');
500
+			//let's make sure that all required scripts have been setup
501
+			if (function_exists('wp_script_is') && ! wp_script_is('jquery')) {
502
+				$msg = sprintf(
503
+					__('%sJquery is not loaded!%sEvent Espresso is unable to load Jquery due to a conflict with your theme or another plugin.',
504
+						'event_espresso'),
505
+					'<em><br />',
506
+					'</em>'
507
+				);
508
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
509
+			}
510
+			// load core js
511
+			wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'),
512
+				EVENT_ESPRESSO_VERSION, true);
513
+			wp_enqueue_script('espresso_core');
514
+			wp_localize_script('espresso_core', 'eei18n', EE_Registry::$i18n_js_strings);
515
+
516
+		}
517
+
518
+		//qtip is turned OFF by default, but prior to the wp_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtip', '__return_true' );
519
+		if (apply_filters('FHEE_load_qtip', false)) {
520
+			EEH_Qtip_Loader::instance()->register_and_enqueue();
521
+		}
522
+
523
+
524
+		//accounting.js library
525
+		// @link http://josscrowcroft.github.io/accounting.js/
526
+		if (apply_filters('FHEE_load_accounting_js', false)) {
527
+			$acct_js = EE_THIRD_PARTY_URL . 'accounting/accounting.js';
528
+			wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
529
+				array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, true);
530
+			wp_register_script('ee-accounting-core', $acct_js, array('underscore'), '0.3.2', true);
531
+			wp_enqueue_script('ee-accounting');
532
+
533
+			$currency_config = array(
534
+				'currency' => array(
535
+					'symbol'    => $this->Registry->CFG->currency->sign,
536
+					'format'    => array(
537
+						'pos'  => $this->Registry->CFG->currency->sign_b4 ? '%s%v' : '%v%s',
538
+						'neg'  => $this->Registry->CFG->currency->sign_b4 ? '- %s%v' : '- %v%s',
539
+						'zero' => $this->Registry->CFG->currency->sign_b4 ? '%s--' : '--%s',
540
+					),
541
+					'decimal'   => $this->Registry->CFG->currency->dec_mrk,
542
+					'thousand'  => $this->Registry->CFG->currency->thsnds,
543
+					'precision' => $this->Registry->CFG->currency->dec_plc,
544
+				),
545
+				'number'   => array(
546
+					'precision' => 0,
547
+					'thousand'  => $this->Registry->CFG->currency->thsnds,
548
+					'decimal'   => $this->Registry->CFG->currency->dec_mrk,
549
+				),
550
+			);
551
+			wp_localize_script('ee-accounting', 'EE_ACCOUNTING_CFG', $currency_config);
552
+		}
553
+
554
+		if ( ! function_exists('wp_head')) {
555
+			$msg = sprintf(
556
+				__('%sMissing wp_head() function.%sThe WordPress function wp_head() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.',
557
+					'event_espresso'),
558
+				'<em><br />',
559
+				'</em>'
560
+			);
561
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
562
+		}
563
+		if ( ! function_exists('wp_footer')) {
564
+			$msg = sprintf(
565
+				__('%sMissing wp_footer() function.%sThe WordPress function wp_footer() seems to be missing in your theme. Please contact the theme developer to make sure this is fixed before using Event Espresso.',
566
+					'event_espresso'),
567
+				'<em><br />',
568
+				'</em>'
569
+			);
570
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
571
+		}
572
+
573
+	}
574
+
575
+
576
+	/**
577
+	 *    header_meta_tag
578
+	 *
579
+	 * @access    public
580
+	 * @return    void
581
+	 */
582
+	public function header_meta_tag()
583
+	{
584
+		print(
585
+			apply_filters(
586
+				'FHEE__EE_Front_Controller__header_meta_tag',
587
+				'<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n")
588
+		);
589
+
590
+		//let's exclude all event type taxonomy term archive pages from search engine indexing
591
+		//@see https://events.codebasehq.com/projects/event-espresso/tickets/10249
592
+		//also exclude all critical pages from indexing
593
+		if (
594
+			(
595
+				is_tax('espresso_event_type')
596
+				&& get_option( 'blog_public' ) !== '0'
597
+			)
598
+			|| is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
599
+		) {
600
+			print(
601
+				apply_filters(
602
+					'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
603
+					'<meta name="robots" content="noindex,follow" />' . "\n"
604
+				)
605
+			);
606
+		}
607
+	}
608
+
609
+
610
+
611
+	/**
612
+	 * wp_print_scripts
613
+	 *
614
+	 * @return void
615
+	 */
616
+	public function wp_print_scripts()
617
+	{
618
+		global $post;
619
+		if (
620
+			get_post_type() === 'espresso_events' 
621
+			&& is_singular() 
622
+			&& isset($post->EE_Event)
623
+			&& $post->EE_Event instanceof EE_Event
624
+		) {
625
+			\EEH_Schema::add_json_linked_data_for_event($post->EE_Event);
626
+		}
627
+	}
628
+
629
+
630
+
631
+	/***********************************************        THE_CONTENT FILTER HOOK         ***********************************************/
632
+
633
+
634
+
635
+	/**
636
+	 *    the_content
637
+	 *
638
+	 * @access    public
639
+	 * @param   $the_content
640
+	 * @return    string
641
+	 */
642
+	// public function the_content( $the_content ) {
643
+	// 	// nothing gets loaded at this point unless other systems turn this hookpoint on by using:  add_filter( 'FHEE_run_EE_the_content', '__return_true' );
644
+	// 	if ( apply_filters( 'FHEE_run_EE_the_content', FALSE ) ) {
645
+	// 	}
646
+	// 	return $the_content;
647
+	// }
648
+
649
+
650
+	/***********************************************        WP_FOOTER         ***********************************************/
651
+
652
+
653
+	/**
654
+	 *    display_errors
655
+	 *
656
+	 * @access    public
657
+	 * @return    string
658
+	 */
659
+	public function display_errors()
660
+	{
661
+		static $shown_already = false;
662
+		do_action('AHEE__EE_Front_Controller__display_errors__begin');
663
+		if (
664
+			! $shown_already
665
+			&& apply_filters('FHEE__EE_Front_Controller__display_errors', true)
666
+			&& is_main_query()
667
+			&& ! is_feed()
668
+			&& in_the_loop()
669
+			&& $this->Request_Handler->is_espresso_page()
670
+		) {
671
+			echo EE_Error::get_notices();
672
+			$shown_already = true;
673
+			EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
674
+		}
675
+		do_action('AHEE__EE_Front_Controller__display_errors__end');
676
+	}
677
+
678
+
679
+
680
+
681
+
682
+	/***********************************************        UTILITIES         ***********************************************/
683
+	/**
684
+	 *    template_include
685
+	 *
686
+	 * @access    public
687
+	 * @param   string $template_include_path
688
+	 * @return    string
689
+	 */
690
+	public function template_include($template_include_path = null)
691
+	{
692
+		if ($this->Request_Handler->is_espresso_page()) {
693
+			$this->_template_path = ! empty($this->_template_path) ? basename($this->_template_path) : basename($template_include_path);
694
+			$template_path        = EEH_Template::locate_template($this->_template_path, array(), false);
695
+			$this->_template_path = ! empty($template_path) ? $template_path : $template_include_path;
696
+			$this->_template      = basename($this->_template_path);
697
+			return $this->_template_path;
698
+		}
699
+		return $template_include_path;
700
+	}
701
+
702
+
703
+	/**
704
+	 *    get_selected_template
705
+	 *
706
+	 * @access    public
707
+	 * @param bool $with_path
708
+	 * @return    string
709
+	 */
710
+	public function get_selected_template($with_path = false)
711
+	{
712
+		return $with_path ? $this->_template_path : $this->_template;
713
+	}
714 714
 
715 715
 
716 716
 }
Please login to merge, or discard this patch.
Spacing   +17 added lines, -17 removed lines patch added patch discarded remove patch
@@ -141,8 +141,8 @@  discard block
 block discarded – undo
141 141
      */
142 142
     public function load_espresso_template_tags()
143 143
     {
144
-        if (is_readable(EE_PUBLIC . 'template_tags.php')) {
145
-            require_once(EE_PUBLIC . 'template_tags.php');
144
+        if (is_readable(EE_PUBLIC.'template_tags.php')) {
145
+            require_once(EE_PUBLIC.'template_tags.php');
146 146
         }
147 147
     }
148 148
 
@@ -364,7 +364,7 @@  discard block
 block discarded – undo
364 364
             || isset($this->Registry->CFG->core->post_shortcodes[$current_post])
365 365
         ) {
366 366
             // let's pause to reflect on this...
367
-            $sc_reflector = new ReflectionClass('EES_' . $shortcode_class);
367
+            $sc_reflector = new ReflectionClass('EES_'.$shortcode_class);
368 368
             // ensure that class is actually a shortcode
369 369
             if (
370 370
                 defined('WP_DEBUG')
@@ -465,27 +465,27 @@  discard block
 block discarded – undo
465 465
                 //Load custom style sheet if available
466 466
                 if (isset($this->Registry->CFG->template_settings->custom_style_sheet)) {
467 467
                     wp_register_style('espresso_custom_css',
468
-                        EVENT_ESPRESSO_UPLOAD_URL . 'css/' . $this->Registry->CFG->template_settings->custom_style_sheet,
468
+                        EVENT_ESPRESSO_UPLOAD_URL.'css/'.$this->Registry->CFG->template_settings->custom_style_sheet,
469 469
                         EVENT_ESPRESSO_VERSION);
470 470
                     wp_enqueue_style('espresso_custom_css');
471 471
                 }
472 472
 
473
-                if (is_readable(EVENT_ESPRESSO_UPLOAD_DIR . 'css/style.css')) {
474
-                    wp_register_style('espresso_default', EVENT_ESPRESSO_UPLOAD_DIR . 'css/espresso_default.css',
473
+                if (is_readable(EVENT_ESPRESSO_UPLOAD_DIR.'css/style.css')) {
474
+                    wp_register_style('espresso_default', EVENT_ESPRESSO_UPLOAD_DIR.'css/espresso_default.css',
475 475
                         array('dashicons'), EVENT_ESPRESSO_VERSION);
476 476
                 } else {
477
-                    wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL . 'css/espresso_default.css',
477
+                    wp_register_style('espresso_default', EE_GLOBAL_ASSETS_URL.'css/espresso_default.css',
478 478
                         array('dashicons'), EVENT_ESPRESSO_VERSION);
479 479
                 }
480 480
                 wp_enqueue_style('espresso_default');
481 481
 
482
-                if (is_readable(get_stylesheet_directory() . EE_Config::get_current_theme() . DS . 'style.css')) {
482
+                if (is_readable(get_stylesheet_directory().EE_Config::get_current_theme().DS.'style.css')) {
483 483
                     wp_register_style('espresso_style',
484
-                        get_stylesheet_directory_uri() . EE_Config::get_current_theme() . DS . 'style.css',
484
+                        get_stylesheet_directory_uri().EE_Config::get_current_theme().DS.'style.css',
485 485
                         array('dashicons', 'espresso_default'));
486 486
                 } else {
487 487
                     wp_register_style('espresso_style',
488
-                        EE_TEMPLATES_URL . EE_Config::get_current_theme() . DS . 'style.css',
488
+                        EE_TEMPLATES_URL.EE_Config::get_current_theme().DS.'style.css',
489 489
                         array('dashicons', 'espresso_default'));
490 490
                 }
491 491
 
@@ -508,7 +508,7 @@  discard block
 block discarded – undo
508 508
                 EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
509 509
             }
510 510
             // load core js
511
-            wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL . 'scripts/espresso_core.js', array('jquery'),
511
+            wp_register_script('espresso_core', EE_GLOBAL_ASSETS_URL.'scripts/espresso_core.js', array('jquery'),
512 512
                 EVENT_ESPRESSO_VERSION, true);
513 513
             wp_enqueue_script('espresso_core');
514 514
             wp_localize_script('espresso_core', 'eei18n', EE_Registry::$i18n_js_strings);
@@ -524,8 +524,8 @@  discard block
 block discarded – undo
524 524
         //accounting.js library
525 525
         // @link http://josscrowcroft.github.io/accounting.js/
526 526
         if (apply_filters('FHEE_load_accounting_js', false)) {
527
-            $acct_js = EE_THIRD_PARTY_URL . 'accounting/accounting.js';
528
-            wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js',
527
+            $acct_js = EE_THIRD_PARTY_URL.'accounting/accounting.js';
528
+            wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL.'scripts/ee-accounting-config.js',
529 529
                 array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, true);
530 530
             wp_register_script('ee-accounting-core', $acct_js, array('underscore'), '0.3.2', true);
531 531
             wp_enqueue_script('ee-accounting');
@@ -584,7 +584,7 @@  discard block
 block discarded – undo
584 584
         print(
585 585
             apply_filters(
586 586
                 'FHEE__EE_Front_Controller__header_meta_tag',
587
-                '<meta name="generator" content="Event Espresso Version ' . EVENT_ESPRESSO_VERSION . "\" />\n")
587
+                '<meta name="generator" content="Event Espresso Version '.EVENT_ESPRESSO_VERSION."\" />\n")
588 588
         );
589 589
 
590 590
         //let's exclude all event type taxonomy term archive pages from search engine indexing
@@ -593,14 +593,14 @@  discard block
 block discarded – undo
593 593
         if (
594 594
             (
595 595
                 is_tax('espresso_event_type')
596
-                && get_option( 'blog_public' ) !== '0'
596
+                && get_option('blog_public') !== '0'
597 597
             )
598 598
             || is_page(EE_Registry::instance()->CFG->core->get_critical_pages_array())
599 599
         ) {
600 600
             print(
601 601
                 apply_filters(
602 602
                     'FHEE__EE_Front_Controller__header_meta_tag__noindex_for_event_type',
603
-                    '<meta name="robots" content="noindex,follow" />' . "\n"
603
+                    '<meta name="robots" content="noindex,follow" />'."\n"
604 604
                 )
605 605
             );
606 606
         }
@@ -670,7 +670,7 @@  discard block
 block discarded – undo
670 670
         ) {
671 671
             echo EE_Error::get_notices();
672 672
             $shown_already = true;
673
-            EEH_Template::display_template(EE_TEMPLATES . 'espresso-ajax-notices.template.php');
673
+            EEH_Template::display_template(EE_TEMPLATES.'espresso-ajax-notices.template.php');
674 674
         }
675 675
         do_action('AHEE__EE_Front_Controller__display_errors__end');
676 676
     }
Please login to merge, or discard this patch.
core/admin/EE_Admin.core.php 3 patches
Indentation   +25 added lines, -25 removed lines patch added patch discarded remove patch
@@ -167,11 +167,11 @@  discard block
 block discarded – undo
167 167
 
168 168
 
169 169
 	/**
170
-	* init- should fire after shortcode, module,  addon, other plugin (default priority), and even EE_Front_Controller's init phases have run
171
-	*
172
-	* @access public
173
-	* @return void
174
-	*/
170
+	 * init- should fire after shortcode, module,  addon, other plugin (default priority), and even EE_Front_Controller's init phases have run
171
+	 *
172
+	 * @access public
173
+	 * @return void
174
+	 */
175 175
 	public function init() {
176 176
 		//only enable most of the EE_Admin IF we're not in full maintenance mode
177 177
 		if ( EE_Maintenance_Mode::instance()->models_can_query() ){
@@ -456,11 +456,11 @@  discard block
 block discarded – undo
456 456
 
457 457
 
458 458
 	/**
459
-	* admin_init
460
-	*
461
-	* @access public
462
-	* @return void
463
-	*/
459
+	 * admin_init
460
+	 *
461
+	 * @access public
462
+	 * @return void
463
+	 */
464 464
 	public function admin_init() {
465 465
 
466 466
 		/**
@@ -478,11 +478,11 @@  discard block
 block discarded – undo
478 478
 
479 479
 		/**
480 480
 		 * This code excludes EE critical pages anywhere `wp_dropdown_pages` is used to create a dropdown for selecting
481
-         * critical pages.  The only place critical pages need included in a generated dropdown is on the "Critical Pages"
482
-         * tab in the EE General Settings Admin page.
483
-         * This is for user-proofing.
481
+		 * critical pages.  The only place critical pages need included in a generated dropdown is on the "Critical Pages"
482
+		 * tab in the EE General Settings Admin page.
483
+		 * This is for user-proofing.
484 484
 		 */
485
-        add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) );
485
+		add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) );
486 486
 
487 487
 	}
488 488
 
@@ -611,24 +611,24 @@  discard block
 block discarded – undo
611 611
 
612 612
 
613 613
 	/**
614
-	* 	dismiss_persistent_admin_notice
615
-	*
616
-	*	@access 	public
617
-	* 	@return 		void
618
-	*/
614
+	 * 	dismiss_persistent_admin_notice
615
+	 *
616
+	 *	@access 	public
617
+	 * 	@return 		void
618
+	 */
619 619
 	public function dismiss_ee_nag_notice_callback() {
620 620
 		EE_Error::dismiss_persistent_admin_notice();
621 621
 	}
622 622
 
623 623
 
624 624
 
625
-    /**
626
-     * @param array $elements
627
-     * @return array
628
-     * @throws \EE_Error
629
-     */
625
+	/**
626
+	 * @param array $elements
627
+	 * @return array
628
+	 * @throws \EE_Error
629
+	 */
630 630
 	public function dashboard_glance_items($elements) {
631
-        $elements = is_array($elements) ? $elements : array($elements);
631
+		$elements = is_array($elements) ? $elements : array($elements);
632 632
 		$events = EEM_Event::instance()->count();
633 633
 		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_events'), admin_url('admin.php') );
634 634
 		$items['events']['text'] = sprintf( _n( '%s Event', '%s Events', $events ), number_format_i18n( $events ) );
Please login to merge, or discard this patch.
Spacing   +141 added lines, -141 removed lines patch added patch discarded remove patch
@@ -40,7 +40,7 @@  discard block
 block discarded – undo
40 40
 	 */
41 41
 	public static function instance() {
42 42
 		// check if class object is instantiated
43
-		if (  ! self::$_instance instanceof EE_Admin ) {
43
+		if ( ! self::$_instance instanceof EE_Admin) {
44 44
 			self::$_instance = new self();
45 45
 		}
46 46
 		return self::$_instance;
@@ -57,30 +57,30 @@  discard block
 block discarded – undo
57 57
 		// define global EE_Admin constants
58 58
 		$this->_define_all_constants();
59 59
 		// set autoloaders for our admin page classes based on included path information
60
-		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder( EE_ADMIN );
60
+		EEH_Autoloader::instance()->register_autoloaders_for_each_file_in_folder(EE_ADMIN);
61 61
 		// admin hooks
62
-		add_filter( 'plugin_action_links', array( $this, 'filter_plugin_actions' ), 10, 2 );
62
+		add_filter('plugin_action_links', array($this, 'filter_plugin_actions'), 10, 2);
63 63
 		// load EE_Request_Handler early
64
-		add_action( 'AHEE__EE_System__core_loaded_and_ready', array( $this, 'get_request' ));
65
-		add_action( 'AHEE__EE_System__initialize_last', array( $this, 'init' ));
64
+		add_action('AHEE__EE_System__core_loaded_and_ready', array($this, 'get_request'));
65
+		add_action('AHEE__EE_System__initialize_last', array($this, 'init'));
66 66
 		// post shortcode tracking
67 67
 		add_action(
68 68
 			'AHEE__EE_System__initialize_last',
69
-			array( 'EventEspresso\core\admin\PostShortcodeTracking', 'set_hooks_admin' )
69
+			array('EventEspresso\core\admin\PostShortcodeTracking', 'set_hooks_admin')
70 70
 		);
71
-		add_action( 'AHEE__EE_Admin_Page__route_admin_request', array( $this, 'route_admin_request' ), 100, 2 );
72
-		add_action( 'wp_loaded', array( $this, 'wp_loaded' ), 100 );
73
-		add_action( 'admin_init', array( $this, 'admin_init' ), 100 );
74
-		add_action( 'admin_enqueue_scripts', array( $this, 'enqueue_admin_scripts' ), 20 );
75
-		add_action( 'admin_notices', array( $this, 'display_admin_notices' ), 10 );
76
-		add_action( 'network_admin_notices', array( $this, 'display_admin_notices' ), 10 );
77
-		add_filter( 'pre_update_option', array( $this, 'check_for_invalid_datetime_formats' ), 100, 2 );
78
-		add_filter('admin_footer_text', array( $this, 'espresso_admin_footer' ));
71
+		add_action('AHEE__EE_Admin_Page__route_admin_request', array($this, 'route_admin_request'), 100, 2);
72
+		add_action('wp_loaded', array($this, 'wp_loaded'), 100);
73
+		add_action('admin_init', array($this, 'admin_init'), 100);
74
+		add_action('admin_enqueue_scripts', array($this, 'enqueue_admin_scripts'), 20);
75
+		add_action('admin_notices', array($this, 'display_admin_notices'), 10);
76
+		add_action('network_admin_notices', array($this, 'display_admin_notices'), 10);
77
+		add_filter('pre_update_option', array($this, 'check_for_invalid_datetime_formats'), 100, 2);
78
+		add_filter('admin_footer_text', array($this, 'espresso_admin_footer'));
79 79
 
80 80
 		//reset Environment config (we only do this on admin page loads);
81 81
 		EE_Registry::instance()->CFG->environment->recheck_values();
82 82
 
83
-		do_action( 'AHEE__EE_Admin__loaded' );
83
+		do_action('AHEE__EE_Admin__loaded');
84 84
 	}
85 85
 
86 86
 
@@ -95,11 +95,11 @@  discard block
 block discarded – undo
95 95
 	 * @return void
96 96
 	 */
97 97
 	private function _define_all_constants() {
98
-		define( 'EE_ADMIN_URL', EE_PLUGIN_DIR_URL . 'core/admin/' );
99
-		define( 'EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL . 'admin_pages/' );
100
-		define( 'EE_ADMIN_TEMPLATE', EE_ADMIN . 'templates' . DS );
101
-		define( 'WP_ADMIN_PATH', ABSPATH . 'wp-admin/' );
102
-		define( 'WP_AJAX_URL', admin_url( 'admin-ajax.php' ));
98
+		define('EE_ADMIN_URL', EE_PLUGIN_DIR_URL.'core/admin/');
99
+		define('EE_ADMIN_PAGES_URL', EE_PLUGIN_DIR_URL.'admin_pages/');
100
+		define('EE_ADMIN_TEMPLATE', EE_ADMIN.'templates'.DS);
101
+		define('WP_ADMIN_PATH', ABSPATH.'wp-admin/');
102
+		define('WP_AJAX_URL', admin_url('admin-ajax.php'));
103 103
 	}
104 104
 
105 105
 
@@ -112,23 +112,23 @@  discard block
 block discarded – undo
112 112
 	 * @param 	string 	$plugin
113 113
 	 * @return 	array
114 114
 	 */
115
-	public function filter_plugin_actions( $links, $plugin ) {
115
+	public function filter_plugin_actions($links, $plugin) {
116 116
 		// set $main_file in stone
117 117
 		static $main_file;
118 118
 		// if $main_file is not set yet
119
-		if ( ! $main_file ) {
120
-			$main_file = plugin_basename( EVENT_ESPRESSO_MAIN_FILE );
119
+		if ( ! $main_file) {
120
+			$main_file = plugin_basename(EVENT_ESPRESSO_MAIN_FILE);
121 121
 		}
122
-		 if ( $plugin === $main_file ) {
122
+		 if ($plugin === $main_file) {
123 123
 		 	// compare current plugin to this one
124
-			if ( EE_Maintenance_Mode::instance()->level() === EE_Maintenance_Mode::level_2_complete_maintenance ) {
125
-				$maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode.  Click this link to learn why.">' . __('Maintenance Mode Active', 'event_espresso' ) . '</a>';
126
-				array_unshift( $links, $maintenance_link );
124
+			if (EE_Maintenance_Mode::instance()->level() === EE_Maintenance_Mode::level_2_complete_maintenance) {
125
+				$maintenance_link = '<a href="admin.php?page=espresso_maintenance_settings" title="Event Espresso is in maintenance mode.  Click this link to learn why.">'.__('Maintenance Mode Active', 'event_espresso').'</a>';
126
+				array_unshift($links, $maintenance_link);
127 127
 			} else {
128
-				$org_settings_link = '<a href="admin.php?page=espresso_general_settings">' . __( 'Settings', 'event_espresso' ) . '</a>';
129
-				$events_link = '<a href="admin.php?page=espresso_events">' . __( 'Events', 'event_espresso' ) . '</a>';
128
+				$org_settings_link = '<a href="admin.php?page=espresso_general_settings">'.__('Settings', 'event_espresso').'</a>';
129
+				$events_link = '<a href="admin.php?page=espresso_events">'.__('Events', 'event_espresso').'</a>';
130 130
 				// add before other links
131
-				array_unshift( $links, $org_settings_link, $events_link );
131
+				array_unshift($links, $org_settings_link, $events_link);
132 132
 			}
133 133
 		}
134 134
 		return $links;
@@ -143,8 +143,8 @@  discard block
 block discarded – undo
143 143
 	 *	@return void
144 144
 	 */
145 145
 	public function get_request() {
146
-		EE_Registry::instance()->load_core( 'Request_Handler' );
147
-		EE_Registry::instance()->load_core( 'CPT_Strategy' );
146
+		EE_Registry::instance()->load_core('Request_Handler');
147
+		EE_Registry::instance()->load_core('CPT_Strategy');
148 148
 	}
149 149
 
150 150
 
@@ -156,11 +156,11 @@  discard block
 block discarded – undo
156 156
 	 * @param array $admin_page_folder_names
157 157
 	 * @return array
158 158
 	 */
159
-	public function hide_admin_pages_except_maintenance_mode( $admin_page_folder_names = array() ){
159
+	public function hide_admin_pages_except_maintenance_mode($admin_page_folder_names = array()) {
160 160
 		return array(
161
-			'maintenance' => EE_ADMIN_PAGES . 'maintenance' . DS,
162
-			'about' => EE_ADMIN_PAGES . 'about' . DS,
163
-			'support' => EE_ADMIN_PAGES . 'support' . DS
161
+			'maintenance' => EE_ADMIN_PAGES.'maintenance'.DS,
162
+			'about' => EE_ADMIN_PAGES.'about'.DS,
163
+			'support' => EE_ADMIN_PAGES.'support'.DS
164 164
 		);
165 165
 	}
166 166
 
@@ -174,31 +174,31 @@  discard block
 block discarded – undo
174 174
 	*/
175 175
 	public function init() {
176 176
 		//only enable most of the EE_Admin IF we're not in full maintenance mode
177
-		if ( EE_Maintenance_Mode::instance()->models_can_query() ){
177
+		if (EE_Maintenance_Mode::instance()->models_can_query()) {
178 178
 			//ok so we want to enable the entire admin
179
-			add_action( 'wp_ajax_dismiss_ee_nag_notice', array( $this, 'dismiss_ee_nag_notice_callback' ));
180
-			add_action( 'admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 );
181
-			add_action( 'network_admin_notices', array( $this, 'get_persistent_admin_notices' ), 9 );
179
+			add_action('wp_ajax_dismiss_ee_nag_notice', array($this, 'dismiss_ee_nag_notice_callback'));
180
+			add_action('admin_notices', array($this, 'get_persistent_admin_notices'), 9);
181
+			add_action('network_admin_notices', array($this, 'get_persistent_admin_notices'), 9);
182 182
 			//at a glance dashboard widget
183
-			add_filter( 'dashboard_glance_items', array( $this, 'dashboard_glance_items' ), 10 );
183
+			add_filter('dashboard_glance_items', array($this, 'dashboard_glance_items'), 10);
184 184
 			//filter for get_edit_post_link used on comments for custom post types
185
-			add_filter( 'get_edit_post_link', array( $this, 'modify_edit_post_link' ), 10, 2 );
185
+			add_filter('get_edit_post_link', array($this, 'modify_edit_post_link'), 10, 2);
186 186
 		}
187 187
 		// run the admin page factory but ONLY if we are doing an ee admin ajax request
188
-		if ( !defined('DOING_AJAX') || EE_ADMIN_AJAX ) {
188
+		if ( ! defined('DOING_AJAX') || EE_ADMIN_AJAX) {
189 189
 			try {
190 190
 				//this loads the controller for the admin pages which will setup routing etc
191
-				EE_Registry::instance()->load_core( 'Admin_Page_Loader' );
192
-			} catch ( EE_Error $e ) {
191
+				EE_Registry::instance()->load_core('Admin_Page_Loader');
192
+			} catch (EE_Error $e) {
193 193
 				$e->get_error();
194 194
 			}
195 195
 		}
196
-		add_filter( 'content_save_pre', array( $this, 'its_eSpresso' ), 10, 1 );
196
+		add_filter('content_save_pre', array($this, 'its_eSpresso'), 10, 1);
197 197
 		//make sure our CPTs and custom taxonomy metaboxes get shown for first time users
198
-		add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes' ), 10 );
199
-		add_action('admin_head', array( $this, 'register_custom_nav_menu_boxes' ), 10 );
198
+		add_action('admin_head', array($this, 'enable_hidden_ee_nav_menu_metaboxes'), 10);
199
+		add_action('admin_head', array($this, 'register_custom_nav_menu_boxes'), 10);
200 200
 		//exclude EE critical pages from all nav menus and wp_list_pages
201
-		add_filter('nav_menu_meta_box_object', array( $this, 'remove_pages_from_nav_menu'), 10 );
201
+		add_filter('nav_menu_meta_box_object', array($this, 'remove_pages_from_nav_menu'), 10);
202 202
 	}
203 203
 
204 204
 
@@ -211,9 +211,9 @@  discard block
 block discarded – undo
211 211
 	 * @param  object $post_type WP post type object
212 212
 	 * @return object            WP post type object
213 213
 	 */
214
-	public function remove_pages_from_nav_menu( $post_type ) {
214
+	public function remove_pages_from_nav_menu($post_type) {
215 215
 		//if this isn't the "pages" post type let's get out
216
-		if ( $post_type->name !== 'page' ) {
216
+		if ($post_type->name !== 'page') {
217 217
 			return $post_type;
218 218
 		}
219 219
 		$critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array();
@@ -233,28 +233,28 @@  discard block
 block discarded – undo
233 233
 	 */
234 234
 	public function enable_hidden_ee_nav_menu_metaboxes() {
235 235
 		global $wp_meta_boxes, $pagenow;
236
-		if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php' ) {
236
+		if ( ! is_array($wp_meta_boxes) || $pagenow !== 'nav-menus.php') {
237 237
 			return;
238 238
 		}
239 239
 		$user = wp_get_current_user();
240 240
 		//has this been done yet?
241
-		if ( get_user_option( 'ee_nav_menu_initialized', $user->ID ) ) {
241
+		if (get_user_option('ee_nav_menu_initialized', $user->ID)) {
242 242
 			return;
243 243
 		}
244 244
 
245
-		$hidden_meta_boxes = get_user_option( 'metaboxhidden_nav-menus', $user->ID );
246
-		$initial_meta_boxes = apply_filters( 'FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array( 'nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page' ) );
245
+		$hidden_meta_boxes = get_user_option('metaboxhidden_nav-menus', $user->ID);
246
+		$initial_meta_boxes = apply_filters('FHEE__EE_Admin__enable_hidden_ee_nav_menu_boxes__initial_meta_boxes', array('nav-menu-theme-locations', 'add-page', 'add-custom-links', 'add-category', 'add-espresso_events', 'add-espresso_venues', 'add-espresso_event_categories', 'add-espresso_venue_categories', 'add-post-type-post', 'add-post-type-page'));
247 247
 
248
-		if ( is_array( $hidden_meta_boxes ) ) {
249
-			foreach ( $hidden_meta_boxes as $key => $meta_box_id ) {
250
-				if ( in_array( $meta_box_id, $initial_meta_boxes ) ) {
251
-					unset( $hidden_meta_boxes[ $key ] );
248
+		if (is_array($hidden_meta_boxes)) {
249
+			foreach ($hidden_meta_boxes as $key => $meta_box_id) {
250
+				if (in_array($meta_box_id, $initial_meta_boxes)) {
251
+					unset($hidden_meta_boxes[$key]);
252 252
 				}
253 253
 			}
254 254
 		}
255 255
 
256
-		update_user_option( $user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true );
257
-		update_user_option( $user->ID, 'ee_nav_menu_initialized', 1, true );
256
+		update_user_option($user->ID, 'metaboxhidden_nav-menus', $hidden_meta_boxes, true);
257
+		update_user_option($user->ID, 'ee_nav_menu_initialized', 1, true);
258 258
 	}
259 259
 
260 260
 
@@ -273,7 +273,7 @@  discard block
 block discarded – undo
273 273
 	 * @return void
274 274
 	 */
275 275
 	public function register_custom_nav_menu_boxes() {
276
-		add_meta_box( 'add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array( $this, 'ee_cpt_archive_pages' ), 'nav-menus', 'side', 'core' );
276
+		add_meta_box('add-extra-nav-menu-pages', __('Event Espresso Pages', 'event_espresso'), array($this, 'ee_cpt_archive_pages'), 'nav-menus', 'side', 'core');
277 277
 	}
278 278
 
279 279
 
@@ -289,16 +289,16 @@  discard block
 block discarded – undo
289 289
 	 *
290 290
 	 * @return string  the (maybe) modified link
291 291
 	 */
292
-	public function modify_edit_post_link( $link, $id ) {
293
-		if ( ! $post = get_post( $id ) ){
292
+	public function modify_edit_post_link($link, $id) {
293
+		if ( ! $post = get_post($id)) {
294 294
 			return $link;
295 295
 		}
296
-		if ( $post->post_type === 'espresso_attendees' ) {
296
+		if ($post->post_type === 'espresso_attendees') {
297 297
 			$query_args = array(
298 298
 				'action' => 'edit_attendee',
299 299
 				'post' => $id
300 300
 			);
301
-			return EEH_URL::add_query_args_and_nonce( $query_args, admin_url('admin.php?page=espresso_registrations') );
301
+			return EEH_URL::add_query_args_and_nonce($query_args, admin_url('admin.php?page=espresso_registrations'));
302 302
 		}
303 303
 		return $link;
304 304
 	}
@@ -310,7 +310,7 @@  discard block
 block discarded – undo
310 310
 		global $nav_menu_selected_id;
311 311
 
312 312
 		$db_fields = false;
313
-		$walker = new Walker_Nav_Menu_Checklist( $db_fields );
313
+		$walker = new Walker_Nav_Menu_Checklist($db_fields);
314 314
 		$current_tab = 'event-archives';
315 315
 
316 316
 		/*if ( ! empty( $_REQUEST['quick-search-posttype-' . $post_type_name] ) ) {
@@ -329,9 +329,9 @@  discard block
 block discarded – undo
329 329
 		?>
330 330
 		<div id="posttype-extra-nav-menu-pages" class="posttypediv">
331 331
 			<ul id="posttype-extra-nav-menu-pages-tabs" class="posttype-tabs add-menu-item-tabs">
332
-				<li <?php echo ( 'event-archives' === $current_tab ? ' class="tabs"' : '' ); ?>>
333
-					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ( $nav_menu_selected_id ) {echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args)));} ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
334
-						<?php _e( 'Event Archive Pages', 'event_espresso' ); ?>
332
+				<li <?php echo ('event-archives' === $current_tab ? ' class="tabs"' : ''); ?>>
333
+					<a class="nav-tab-link" data-type="tabs-panel-posttype-extra-nav-menu-pages-event-archives" href="<?php if ($nav_menu_selected_id) {echo esc_url(add_query_arg('extra-nav-menu-pages-tab', 'event-archives', remove_query_arg($removed_args))); } ?>#tabs-panel-posttype-extra-nav-menu-pages-event-archives">
334
+						<?php _e('Event Archive Pages', 'event_espresso'); ?>
335 335
 					</a>
336 336
 				</li>
337 337
 			<?php /* // temporarily removing but leaving skeleton in place in case we ever decide to add more tabs.
@@ -349,13 +349,13 @@  discard block
 block discarded – undo
349 349
  			<?php */ ?>
350 350
 
351 351
 			<div id="tabs-panel-posttype-extra-nav-menu-pages-event-archives" class="tabs-panel <?php
352
-			echo ( 'event-archives' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive' );
352
+			echo ('event-archives' === $current_tab ? 'tabs-panel-active' : 'tabs-panel-inactive');
353 353
 			?>">
354 354
 				<ul id="extra-nav-menu-pageschecklist-event-archives" class="categorychecklist form-no-clear">
355 355
 					<?php
356 356
 					$pages = $this->_get_extra_nav_menu_pages_items();
357 357
 					$args['walker'] = $walker;
358
-					echo walk_nav_menu_tree( array_map( array( $this, '_setup_extra_nav_menu_pages_items' ), $pages), 0, (object) $args );
358
+					echo walk_nav_menu_tree(array_map(array($this, '_setup_extra_nav_menu_pages_items'), $pages), 0, (object) $args);
359 359
 					?>
360 360
 				</ul>
361 361
 			</div><!-- /.tabs-panel -->
@@ -363,18 +363,18 @@  discard block
 block discarded – undo
363 363
 			<p class="button-controls">
364 364
 				<span class="list-controls">
365 365
 					<a href="<?php
366
-						echo esc_url( add_query_arg(
366
+						echo esc_url(add_query_arg(
367 367
 							array(
368 368
 								'extra-nav-menu-pages-tab' => 'event-archives',
369 369
 								'selectall' => 1,
370 370
 							),
371
-							remove_query_arg( $removed_args )
371
+							remove_query_arg($removed_args)
372 372
 						));
373 373
 					?>#posttype-extra-nav-menu-pages>" class="select-all"><?php _e('Select All'); ?></a>
374 374
 				</span>
375 375
 
376 376
 				<span class="add-to-menu">
377
-					<input type="submit"<?php wp_nav_menu_disabled_check( $nav_menu_selected_id ); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e( __( 'Add to Menu' ) ); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e( 'submit-posttype-extra-nav-menu-pages' ); ?>" />
377
+					<input type="submit"<?php wp_nav_menu_disabled_check($nav_menu_selected_id); ?> class="button-secondary submit-add-to-menu right" value="<?php esc_attr_e(__('Add to Menu')); ?>" name="add-post-type-menu-item" id="<?php esc_attr_e('submit-posttype-extra-nav-menu-pages'); ?>" />
378 378
 					<span class="spinner"></span>
379 379
 				</span>
380 380
 			</p>
@@ -395,10 +395,10 @@  discard block
 block discarded – undo
395 395
 	private function _get_extra_nav_menu_pages_items() {
396 396
 		$menuitems[] = array(
397 397
 			'title' => __('Event List', 'event_espresso'),
398
-			'url' => get_post_type_archive_link( 'espresso_events' ),
398
+			'url' => get_post_type_archive_link('espresso_events'),
399 399
 			'description' => __('Archive page for all events.', 'event_espresso')
400 400
 		);
401
-		return apply_filters( 'FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems );
401
+		return apply_filters('FHEE__EE_Admin__get_extra_nav_menu_pages_items', $menuitems);
402 402
 	}
403 403
 
404 404
 
@@ -410,7 +410,7 @@  discard block
 block discarded – undo
410 410
 	 * @param $menu_item_values
411 411
 	 * @return stdClass
412 412
 	 */
413
-	private function _setup_extra_nav_menu_pages_items( $menu_item_values ) {
413
+	private function _setup_extra_nav_menu_pages_items($menu_item_values) {
414 414
 		$menu_item = new stdClass();
415 415
 		$keys = array(
416 416
 			'ID' => 0,
@@ -430,8 +430,8 @@  discard block
 block discarded – undo
430 430
 			'xfn' => ''
431 431
 		);
432 432
 
433
-		foreach ( $keys as $key => $value) {
434
-			$menu_item->{$key} = isset( $menu_item_values[ $key]) ? $menu_item_values[ $key] : $value;
433
+		foreach ($keys as $key => $value) {
434
+			$menu_item->{$key} = isset($menu_item_values[$key]) ? $menu_item_values[$key] : $value;
435 435
 		}
436 436
 		return $menu_item;
437 437
 	}
@@ -470,9 +470,9 @@  discard block
 block discarded – undo
470 470
 		 * - check if doing post processing of one of EE CPTs
471 471
 		 * - instantiate the corresponding EE CPT model for the post_type being processed.
472 472
 		 */
473
-		if ( isset( $_POST['action'], $_POST['post_type'] ) && $_POST['action'] === 'editpost' ) {
474
-			EE_Registry::instance()->load_core( 'Register_CPTs' );
475
-			EE_Register_CPTs::instantiate_cpt_models( $_POST['post_type'] );
473
+		if (isset($_POST['action'], $_POST['post_type']) && $_POST['action'] === 'editpost') {
474
+			EE_Registry::instance()->load_core('Register_CPTs');
475
+			EE_Register_CPTs::instantiate_cpt_models($_POST['post_type']);
476 476
 		}
477 477
 
478 478
 
@@ -482,7 +482,7 @@  discard block
 block discarded – undo
482 482
          * tab in the EE General Settings Admin page.
483 483
          * This is for user-proofing.
484 484
 		 */
485
-        add_filter( 'wp_dropdown_pages', array( $this, 'modify_dropdown_pages' ) );
485
+        add_filter('wp_dropdown_pages', array($this, 'modify_dropdown_pages'));
486 486
 
487 487
 	}
488 488
 
@@ -493,25 +493,25 @@  discard block
 block discarded – undo
493 493
 	 * @param string $output  Current output.
494 494
 	 * @return string
495 495
 	 */
496
-	public function modify_dropdown_pages( $output ) {
496
+	public function modify_dropdown_pages($output) {
497 497
 		//get critical pages
498 498
 		$critical_pages = EE_Registry::instance()->CFG->core->get_critical_pages_array();
499 499
 
500 500
 		//split current output by line break for easier parsing.
501
-		$split_output = explode( "\n", $output );
501
+		$split_output = explode("\n", $output);
502 502
 
503 503
 		//loop through to remove any critical pages from the array.
504
-		foreach ( $critical_pages as $page_id ) {
505
-			$needle = 'value="' . $page_id . '"';
506
-			foreach( $split_output as $key => $haystack ) {
507
-				if( strpos( $haystack, $needle ) !== false ) {
508
-					unset( $split_output[$key] );
504
+		foreach ($critical_pages as $page_id) {
505
+			$needle = 'value="'.$page_id.'"';
506
+			foreach ($split_output as $key => $haystack) {
507
+				if (strpos($haystack, $needle) !== false) {
508
+					unset($split_output[$key]);
509 509
 				}
510 510
 			}
511 511
 		}
512 512
 
513 513
 		//replace output with the new contents
514
-		return implode( "\n", $split_output );
514
+		return implode("\n", $split_output);
515 515
 	}
516 516
 
517 517
 
@@ -525,36 +525,36 @@  discard block
 block discarded – undo
525 525
 	public function enqueue_admin_scripts() {
526 526
 		// this javascript is loaded on every admin page to catch any injections ee needs to add to wp run js.
527 527
 		// Note: the intention of this script is to only do TARGETED injections.  I.E, only injecting on certain script calls.
528
-		wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL . 'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
528
+		wp_enqueue_script('ee-inject-wp', EE_ADMIN_URL.'assets/ee-cpt-wp-injects.js', array('jquery'), EVENT_ESPRESSO_VERSION, TRUE);
529 529
 		// register cookie script for future dependencies
530
-		wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL . 'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE );
530
+		wp_register_script('jquery-cookie', EE_THIRD_PARTY_URL.'joyride/jquery.cookie.js', array('jquery'), '2.1', TRUE);
531 531
 		// jquery_validate loading is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via:  add_filter( 'FHEE_load_jquery_validate', '__return_true' );
532
-		if ( apply_filters( 'FHEE_load_jquery_validate', FALSE ) ) {
532
+		if (apply_filters('FHEE_load_jquery_validate', FALSE)) {
533 533
 			// register jQuery Validate
534
-			wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL . 'scripts/jquery.validate.min.js', array('jquery'), '1.15.0', TRUE);
534
+			wp_register_script('jquery-validate', EE_GLOBAL_ASSETS_URL.'scripts/jquery.validate.min.js', array('jquery'), '1.15.0', TRUE);
535 535
 		}
536 536
 		//joyride is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again vai: add_filter('FHEE_load_joyride', '__return_true' );
537
-		if ( apply_filters( 'FHEE_load_joyride', FALSE ) ) {
537
+		if (apply_filters('FHEE_load_joyride', FALSE)) {
538 538
 			//joyride style
539
-			wp_register_style('joyride-css', EE_THIRD_PARTY_URL . 'joyride/joyride-2.1.css', array(), '2.1');
540
-			wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL . 'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION );
541
-			wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL . 'joyride/modernizr.mq.js', array(), '2.1', TRUE );
539
+			wp_register_style('joyride-css', EE_THIRD_PARTY_URL.'joyride/joyride-2.1.css', array(), '2.1');
540
+			wp_register_style('ee-joyride-css', EE_GLOBAL_ASSETS_URL.'css/ee-joyride-styles.css', array('joyride-css'), EVENT_ESPRESSO_VERSION);
541
+			wp_register_script('joyride-modernizr', EE_THIRD_PARTY_URL.'joyride/modernizr.mq.js', array(), '2.1', TRUE);
542 542
 			//joyride JS
543
-			wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL . 'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE );
543
+			wp_register_script('jquery-joyride', EE_THIRD_PARTY_URL.'joyride/jquery.joyride-2.1.js', array('jquery-cookie', 'joyride-modernizr'), '2.1', TRUE);
544 544
 			// wanna go for a joyride?
545 545
 			wp_enqueue_style('ee-joyride-css');
546 546
 			wp_enqueue_script('jquery-joyride');
547 547
 		}
548 548
 		//qtip is turned OFF by default, but prior to the admin_enqueue_scripts hook, can be turned back on again via: add_filter('FHEE_load_qtips', '__return_true' );
549
-		if ( apply_filters( 'FHEE_load_qtip', FALSE ) ) {
549
+		if (apply_filters('FHEE_load_qtip', FALSE)) {
550 550
 			EEH_Qtip_Loader::instance()->register_and_enqueue();
551 551
 		}
552 552
 		//accounting.js library
553 553
 		// @link http://josscrowcroft.github.io/accounting.js/
554
-		if ( apply_filters( 'FHEE_load_accounting_js', FALSE ) ) {
555
-			wp_register_script( 'ee-accounting', EE_GLOBAL_ASSETS_URL . 'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE );
556
-			wp_register_script( 'ee-accounting-core', EE_THIRD_PARTY_URL . 'accounting/accounting.js', array('underscore'), '0.3.2', TRUE );
557
-			wp_enqueue_script( 'ee-accounting' );
554
+		if (apply_filters('FHEE_load_accounting_js', FALSE)) {
555
+			wp_register_script('ee-accounting', EE_GLOBAL_ASSETS_URL.'scripts/ee-accounting-config.js', array('ee-accounting-core'), EVENT_ESPRESSO_VERSION, TRUE);
556
+			wp_register_script('ee-accounting-core', EE_THIRD_PARTY_URL.'accounting/accounting.js', array('underscore'), '0.3.2', TRUE);
557
+			wp_enqueue_script('ee-accounting');
558 558
 			// array of settings to get converted to JSON array via wp_localize_script
559 559
 			$currency_config = array(
560 560
 				'currency' => array(
@@ -601,11 +601,11 @@  discard block
 block discarded – undo
601 601
 	public function get_persistent_admin_notices() {
602 602
 		// http://www.example.com/wp-admin/admin.php?page=espresso_general_settings&action=critical_pages&critical_pages_nonce=2831ce0f30
603 603
 		$args = array(
604
-			'page' => EE_Registry::instance()->REQ->is_set( 'page' ) ? EE_Registry::instance()->REQ->get( 'page' ) : '',
605
-			'action' => EE_Registry::instance()->REQ->is_set( 'action' ) ? EE_Registry::instance()->REQ->get( 'action' ) : '',
604
+			'page' => EE_Registry::instance()->REQ->is_set('page') ? EE_Registry::instance()->REQ->get('page') : '',
605
+			'action' => EE_Registry::instance()->REQ->is_set('action') ? EE_Registry::instance()->REQ->get('action') : '',
606 606
 		);
607
-		$return_url = EE_Admin_Page::add_query_args_and_nonce( $args, EE_ADMIN_URL );
608
-		echo EE_Error::get_persistent_admin_notices( $return_url );
607
+		$return_url = EE_Admin_Page::add_query_args_and_nonce($args, EE_ADMIN_URL);
608
+		echo EE_Error::get_persistent_admin_notices($return_url);
609 609
 	}
610 610
 
611 611
 
@@ -630,24 +630,24 @@  discard block
 block discarded – undo
630 630
 	public function dashboard_glance_items($elements) {
631 631
         $elements = is_array($elements) ? $elements : array($elements);
632 632
 		$events = EEM_Event::instance()->count();
633
-		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_events'), admin_url('admin.php') );
634
-		$items['events']['text'] = sprintf( _n( '%s Event', '%s Events', $events ), number_format_i18n( $events ) );
633
+		$items['events']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_events'), admin_url('admin.php'));
634
+		$items['events']['text'] = sprintf(_n('%s Event', '%s Events', $events), number_format_i18n($events));
635 635
 		$items['events']['title'] = __('Click to view all Events', 'event_espresso');
636 636
 		$registrations = EEM_Registration::instance()->count(
637 637
 			array(
638 638
 				array(
639
-					'STS_ID' => array( '!=', EEM_Registration::status_id_incomplete )
639
+					'STS_ID' => array('!=', EEM_Registration::status_id_incomplete)
640 640
 				)
641 641
 			)
642 642
 		);
643
-		$items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce( array('page' => 'espresso_registrations' ), admin_url('admin.php') );
644
-		$items['registrations']['text'] = sprintf( _n( '%s Registration', '%s Registrations', $registrations ), number_format_i18n($registrations) );
643
+		$items['registrations']['url'] = EE_Admin_Page::add_query_args_and_nonce(array('page' => 'espresso_registrations'), admin_url('admin.php'));
644
+		$items['registrations']['text'] = sprintf(_n('%s Registration', '%s Registrations', $registrations), number_format_i18n($registrations));
645 645
 		$items['registrations']['title'] = __('Click to view all registrations', 'event_espresso');
646 646
 
647
-		$items = (array) apply_filters( 'FHEE__EE_Admin__dashboard_glance_items__items', $items );
647
+		$items = (array) apply_filters('FHEE__EE_Admin__dashboard_glance_items__items', $items);
648 648
 
649
-		foreach ( $items as $type => $item_properties ) {
650
-			$elements[] = sprintf( '<a class="ee-dashboard-link-' . $type . '" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text'] );
649
+		foreach ($items as $type => $item_properties) {
650
+			$elements[] = sprintf('<a class="ee-dashboard-link-'.$type.'" href="%s" title="%s">%s</a>', $item_properties['url'], $item_properties['title'], $item_properties['text']);
651 651
 		}
652 652
 		return $elements;
653 653
 	}
@@ -664,31 +664,31 @@  discard block
 block discarded – undo
664 664
 	 * @throws EE_Error
665 665
 	 * @return    string
666 666
 	 */
667
-	public function check_for_invalid_datetime_formats( $value, $option ) {
667
+	public function check_for_invalid_datetime_formats($value, $option) {
668 668
 		// check for date_format or time_format
669
-		switch ( $option ) {
669
+		switch ($option) {
670 670
 			case 'date_format' :
671
-				$date_time_format = $value . ' ' . get_option('time_format');
671
+				$date_time_format = $value.' '.get_option('time_format');
672 672
 				break;
673 673
 			case 'time_format' :
674
-				$date_time_format = get_option('date_format') . ' ' . $value;
674
+				$date_time_format = get_option('date_format').' '.$value;
675 675
 				break;
676 676
 			default :
677 677
 				$date_time_format = FALSE;
678 678
 		}
679 679
 		// do we have a date_time format to check ?
680
-		if ( $date_time_format ) {
681
-			$error_msg = EEH_DTT_Helper::validate_format_string( $date_time_format );
680
+		if ($date_time_format) {
681
+			$error_msg = EEH_DTT_Helper::validate_format_string($date_time_format);
682 682
 
683
-			if ( is_array( $error_msg ) ) {
684
-				$msg = '<p>' . sprintf( __( 'The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso' ), date( $date_time_format ) , $date_time_format  ) . '</p><p><ul>';
683
+			if (is_array($error_msg)) {
684
+				$msg = '<p>'.sprintf(__('The following date time "%s" ( %s ) is difficult to be properly parsed by PHP for the following reasons:', 'event_espresso'), date($date_time_format), $date_time_format).'</p><p><ul>';
685 685
 
686 686
 
687
-				foreach ( $error_msg as $error ) {
688
-					$msg .= '<li>' . $error . '</li>';
687
+				foreach ($error_msg as $error) {
688
+					$msg .= '<li>'.$error.'</li>';
689 689
 				}
690 690
 
691
-				$msg .= '</ul></p><p>' . sprintf( __( '%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso' ), '<span style="color:#D54E21;">', '</span>' ) . '</p>';
691
+				$msg .= '</ul></p><p>'.sprintf(__('%sPlease note that your date and time formats have been reset to "F j, Y" and "g:i a" respectively.%s', 'event_espresso'), '<span style="color:#D54E21;">', '</span>').'</p>';
692 692
 
693 693
 				// trigger WP settings error
694 694
 				add_settings_error(
@@ -698,7 +698,7 @@  discard block
 block discarded – undo
698 698
 				);
699 699
 
700 700
 				// set format to something valid
701
-				switch ( $option ) {
701
+				switch ($option) {
702 702
 					case 'date_format' :
703 703
 						$value = 'F j, Y';
704 704
 						break;
@@ -720,8 +720,8 @@  discard block
 block discarded – undo
720 720
 	 * @param $content
721 721
 	 * @return    string
722 722
 	 */
723
-	public function its_eSpresso( $content ) {
724
-		return str_replace( '[EXPRESSO_', '[ESPRESSO_', $content );
723
+	public function its_eSpresso($content) {
724
+		return str_replace('[EXPRESSO_', '[ESPRESSO_', $content);
725 725
 	}
726 726
 
727 727
 
@@ -733,7 +733,7 @@  discard block
 block discarded – undo
733 733
 	 *  @return 	string
734 734
 	 */
735 735
 	public function espresso_admin_footer() {
736
-		return \EEH_Template::powered_by_event_espresso( 'aln-cntr', '', array( 'utm_content' => 'admin_footer' ));
736
+		return \EEH_Template::powered_by_event_espresso('aln-cntr', '', array('utm_content' => 'admin_footer'));
737 737
 	}
738 738
 
739 739
 
@@ -752,12 +752,12 @@  discard block
 block discarded – undo
752 752
 	 * @param array $config
753 753
 	 * @return void
754 754
 	 */
755
-	public static function register_ee_admin_page( $page_basename, $page_path, $config = array() ) {
756
-		EE_Error::doing_it_wrong( __METHOD__, sprintf( __('Usage is deprecated.  Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3' );
757
-		if ( class_exists( 'EE_Register_Admin_Page' ) ) {
755
+	public static function register_ee_admin_page($page_basename, $page_path, $config = array()) {
756
+		EE_Error::doing_it_wrong(__METHOD__, sprintf(__('Usage is deprecated.  Use EE_Register_Admin_Page::register() for registering the %s admin page.', 'event_espresso'), $page_basename), '4.3');
757
+		if (class_exists('EE_Register_Admin_Page')) {
758 758
 			$config['page_path'] = $page_path;
759 759
 		}
760
-		EE_Register_Admin_Page::register( $page_basename, $config );
760
+		EE_Register_Admin_Page::register($page_basename, $config);
761 761
 
762 762
 	}
763 763
 
@@ -770,7 +770,7 @@  discard block
 block discarded – undo
770 770
 	 * @param  \WP_Post $post
771 771
 	 * @return void
772 772
 	 */
773
-	public static function parse_post_content_on_save( $post_ID, $post ) {
773
+	public static function parse_post_content_on_save($post_ID, $post) {
774 774
 		EE_Error::doing_it_wrong(
775 775
 			__METHOD__,
776 776
 			__(
@@ -779,7 +779,7 @@  discard block
 block discarded – undo
779 779
 			),
780 780
 			'4.8.41'
781 781
 		);
782
-		EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save( $post_ID, $post );
782
+		EventEspresso\core\admin\PostShortcodeTracking::parse_post_content_on_save($post_ID, $post);
783 783
 	}
784 784
 
785 785
 
@@ -792,7 +792,7 @@  discard block
 block discarded – undo
792 792
 	 * @param  $value
793 793
 	 * @return void
794 794
 	 */
795
-	public function reset_page_for_posts_on_change( $option, $old_value, $value ) {
795
+	public function reset_page_for_posts_on_change($option, $old_value, $value) {
796 796
 		EE_Error::doing_it_wrong(
797 797
 			__METHOD__,
798 798
 			__(
@@ -801,7 +801,7 @@  discard block
 block discarded – undo
801 801
 			),
802 802
 			'4.8.41'
803 803
 		);
804
-		EventEspresso\core\admin\PostShortcodeTracking::reset_page_for_posts_on_change( $option, $old_value, $value );
804
+		EventEspresso\core\admin\PostShortcodeTracking::reset_page_for_posts_on_change($option, $old_value, $value);
805 805
 	}
806 806
 
807 807
 }
Please login to merge, or discard this patch.
Braces   +3 added lines, -1 removed lines patch added patch discarded remove patch
@@ -1,4 +1,6 @@
 block discarded – undo
1
-<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) exit('No direct script access allowed');
1
+<?php if ( ! defined('EVENT_ESPRESSO_VERSION')) {
2
+	exit('No direct script access allowed');
3
+}
2 4
 /**
3 5
  * Event Espresso
4 6
  *
Please login to merge, or discard this patch.