Completed
Branch models-cleanup/main (0d2dda)
by
unknown
09:34
created
admin_pages/events/Events_Admin_Page.core.php 2 patches
Indentation   +2926 added lines, -2926 removed lines patch added patch discarded remove patch
@@ -16,2930 +16,2930 @@
 block discarded – undo
16 16
 class Events_Admin_Page extends EE_Admin_Page_CPT
17 17
 {
18 18
 
19
-    /**
20
-     * This will hold the event object for event_details screen.
21
-     *
22
-     * @access protected
23
-     * @var EE_Event $_event
24
-     */
25
-    protected $_event;
26
-
27
-
28
-    /**
29
-     * This will hold the category object for category_details screen.
30
-     *
31
-     * @var stdClass $_category
32
-     */
33
-    protected $_category;
34
-
35
-
36
-    /**
37
-     * @var EEM_Event $_event_model
38
-     */
39
-    protected $_event_model;
40
-
41
-    /**
42
-     * @var EEM_Datetime $datetime_model
43
-     */
44
-    protected $datetime_model;
45
-
46
-    /**
47
-     * @var EEM_Ticket $ticket_model
48
-     */
49
-    protected $ticket_model;
50
-
51
-
52
-    /**
53
-     * @var EE_Event
54
-     */
55
-    protected $_cpt_model_obj;
56
-
57
-
58
-    /**
59
-     * Initialize page props for this admin page group.
60
-     */
61
-    protected function _init_page_props()
62
-    {
63
-        $this->page_slug = EVENTS_PG_SLUG;
64
-        $this->page_label = EVENTS_LABEL;
65
-        $this->_admin_base_url = EVENTS_ADMIN_URL;
66
-        $this->_admin_base_path = EVENTS_ADMIN;
67
-        $this->_cpt_model_names = [
68
-            'create_new' => 'EEM_Event',
69
-            'edit'       => 'EEM_Event',
70
-        ];
71
-        $this->_cpt_edit_routes = [
72
-            'espresso_events' => 'edit',
73
-        ];
74
-        add_action(
75
-            'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
76
-            [$this, 'verify_event_edit'],
77
-            10,
78
-            2
79
-        );
80
-    }
81
-
82
-
83
-    /**
84
-     * Sets the ajax hooks used for this admin page group.
85
-     */
86
-    protected function _ajax_hooks()
87
-    {
88
-        add_action('wp_ajax_ee_save_timezone_setting', [$this, 'save_timezonestring_setting']);
89
-    }
90
-
91
-
92
-    /**
93
-     * Sets the page properties for this admin page group.
94
-     */
95
-    protected function _define_page_props()
96
-    {
97
-        $this->_admin_page_title = EVENTS_LABEL;
98
-        $this->_labels = [
99
-            'buttons'      => [
100
-                'add'             => esc_html__('Add New Event', 'event_espresso'),
101
-                'edit'            => esc_html__('Edit Event', 'event_espresso'),
102
-                'delete'          => esc_html__('Delete Event', 'event_espresso'),
103
-                'add_category'    => esc_html__('Add New Category', 'event_espresso'),
104
-                'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
105
-                'delete_category' => esc_html__('Delete Category', 'event_espresso'),
106
-            ],
107
-            'editor_title' => [
108
-                'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
109
-            ],
110
-            'publishbox'   => [
111
-                'create_new'        => esc_html__('Save New Event', 'event_espresso'),
112
-                'edit'              => esc_html__('Update Event', 'event_espresso'),
113
-                'add_category'      => esc_html__('Save New Category', 'event_espresso'),
114
-                'edit_category'     => esc_html__('Update Category', 'event_espresso'),
115
-                'template_settings' => esc_html__('Update Settings', 'event_espresso'),
116
-            ],
117
-        ];
118
-    }
119
-
120
-
121
-    /**
122
-     * Sets the page routes property for this admin page group.
123
-     */
124
-    protected function _set_page_routes()
125
-    {
126
-        // load formatter helper
127
-        // load field generator helper
128
-        // is there a evt_id in the request?
129
-        $evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
130
-            ? $this->_req_data['EVT_ID']
131
-            : 0;
132
-        $evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
133
-        $this->_page_routes = [
134
-            'default'                       => [
135
-                'func'       => '_events_overview_list_table',
136
-                'capability' => 'ee_read_events',
137
-            ],
138
-            'create_new'                    => [
139
-                'func'       => '_create_new_cpt_item',
140
-                'capability' => 'ee_edit_events',
141
-            ],
142
-            'edit'                          => [
143
-                'func'       => '_edit_cpt_item',
144
-                'capability' => 'ee_edit_event',
145
-                'obj_id'     => $evt_id,
146
-            ],
147
-            'copy_event'                    => [
148
-                'func'       => '_copy_events',
149
-                'capability' => 'ee_edit_event',
150
-                'obj_id'     => $evt_id,
151
-                'noheader'   => true,
152
-            ],
153
-            'trash_event'                   => [
154
-                'func'       => '_trash_or_restore_event',
155
-                'args'       => ['event_status' => 'trash'],
156
-                'capability' => 'ee_delete_event',
157
-                'obj_id'     => $evt_id,
158
-                'noheader'   => true,
159
-            ],
160
-            'trash_events'                  => [
161
-                'func'       => '_trash_or_restore_events',
162
-                'args'       => ['event_status' => 'trash'],
163
-                'capability' => 'ee_delete_events',
164
-                'noheader'   => true,
165
-            ],
166
-            'restore_event'                 => [
167
-                'func'       => '_trash_or_restore_event',
168
-                'args'       => ['event_status' => 'draft'],
169
-                'capability' => 'ee_delete_event',
170
-                'obj_id'     => $evt_id,
171
-                'noheader'   => true,
172
-            ],
173
-            'restore_events'                => [
174
-                'func'       => '_trash_or_restore_events',
175
-                'args'       => ['event_status' => 'draft'],
176
-                'capability' => 'ee_delete_events',
177
-                'noheader'   => true,
178
-            ],
179
-            'delete_event'                  => [
180
-                'func'       => '_delete_event',
181
-                'capability' => 'ee_delete_event',
182
-                'obj_id'     => $evt_id,
183
-                'noheader'   => true,
184
-            ],
185
-            'delete_events'                 => [
186
-                'func'       => '_delete_events',
187
-                'capability' => 'ee_delete_events',
188
-                'noheader'   => true,
189
-            ],
190
-            'view_report'                   => [
191
-                'func'       => '_view_report',
192
-                'capability' => 'ee_edit_events',
193
-            ],
194
-            'default_event_settings'        => [
195
-                'func'       => '_default_event_settings',
196
-                'capability' => 'manage_options',
197
-            ],
198
-            'update_default_event_settings' => [
199
-                'func'       => '_update_default_event_settings',
200
-                'capability' => 'manage_options',
201
-                'noheader'   => true,
202
-            ],
203
-            'template_settings'             => [
204
-                'func'       => '_template_settings',
205
-                'capability' => 'manage_options',
206
-            ],
207
-            // event category tab related
208
-            'add_category'                  => [
209
-                'func'       => '_category_details',
210
-                'capability' => 'ee_edit_event_category',
211
-                'args'       => ['add'],
212
-            ],
213
-            'edit_category'                 => [
214
-                'func'       => '_category_details',
215
-                'capability' => 'ee_edit_event_category',
216
-                'args'       => ['edit'],
217
-            ],
218
-            'delete_categories'             => [
219
-                'func'       => '_delete_categories',
220
-                'capability' => 'ee_delete_event_category',
221
-                'noheader'   => true,
222
-            ],
223
-            'delete_category'               => [
224
-                'func'       => '_delete_categories',
225
-                'capability' => 'ee_delete_event_category',
226
-                'noheader'   => true,
227
-            ],
228
-            'insert_category'               => [
229
-                'func'       => '_insert_or_update_category',
230
-                'args'       => ['new_category' => true],
231
-                'capability' => 'ee_edit_event_category',
232
-                'noheader'   => true,
233
-            ],
234
-            'update_category'               => [
235
-                'func'       => '_insert_or_update_category',
236
-                'args'       => ['new_category' => false],
237
-                'capability' => 'ee_edit_event_category',
238
-                'noheader'   => true,
239
-            ],
240
-            'category_list'                 => [
241
-                'func'       => '_category_list_table',
242
-                'capability' => 'ee_manage_event_categories',
243
-            ],
244
-        ];
245
-    }
246
-
247
-
248
-    /**
249
-     * Set the _page_config property for this admin page group.
250
-     */
251
-    protected function _set_page_config()
252
-    {
253
-        $this->_page_config = [
254
-            'default'                => [
255
-                'nav'           => [
256
-                    'label' => esc_html__('Overview', 'event_espresso'),
257
-                    'order' => 10,
258
-                ],
259
-                'list_table'    => 'Events_Admin_List_Table',
260
-                'help_tabs'     => [
261
-                    'events_overview_help_tab'                       => [
262
-                        'title'    => esc_html__('Events Overview', 'event_espresso'),
263
-                        'filename' => 'events_overview',
264
-                    ],
265
-                    'events_overview_table_column_headings_help_tab' => [
266
-                        'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
267
-                        'filename' => 'events_overview_table_column_headings',
268
-                    ],
269
-                    'events_overview_filters_help_tab'               => [
270
-                        'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
271
-                        'filename' => 'events_overview_filters',
272
-                    ],
273
-                    'events_overview_view_help_tab'                  => [
274
-                        'title'    => esc_html__('Events Overview Views', 'event_espresso'),
275
-                        'filename' => 'events_overview_views',
276
-                    ],
277
-                    'events_overview_other_help_tab'                 => [
278
-                        'title'    => esc_html__('Events Overview Other', 'event_espresso'),
279
-                        'filename' => 'events_overview_other',
280
-                    ],
281
-                ],
282
-                'help_tour'     => [
283
-                    'Event_Overview_Help_Tour',
284
-                    // 'New_Features_Test_Help_Tour' for testing multiple help tour
285
-                ],
286
-                'require_nonce' => false,
287
-                'qtips'         => ['EE_Event_List_Table_Tips'],
288
-            ],
289
-            'create_new'             => [
290
-                'nav'           => [
291
-                    'label'      => esc_html__('Add Event', 'event_espresso'),
292
-                    'order'      => 5,
293
-                    'persistent' => false,
294
-                ],
295
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
296
-                'help_tabs'     => [
297
-                    'event_editor_help_tab'                            => [
298
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
299
-                        'filename' => 'event_editor',
300
-                    ],
301
-                    'event_editor_title_richtexteditor_help_tab'       => [
302
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
303
-                        'filename' => 'event_editor_title_richtexteditor',
304
-                    ],
305
-                    'event_editor_venue_details_help_tab'              => [
306
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
307
-                        'filename' => 'event_editor_venue_details',
308
-                    ],
309
-                    'event_editor_event_datetimes_help_tab'            => [
310
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
311
-                        'filename' => 'event_editor_event_datetimes',
312
-                    ],
313
-                    'event_editor_event_tickets_help_tab'              => [
314
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
315
-                        'filename' => 'event_editor_event_tickets',
316
-                    ],
317
-                    'event_editor_event_registration_options_help_tab' => [
318
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
319
-                        'filename' => 'event_editor_event_registration_options',
320
-                    ],
321
-                    'event_editor_tags_categories_help_tab'            => [
322
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
323
-                        'filename' => 'event_editor_tags_categories',
324
-                    ],
325
-                    'event_editor_questions_registrants_help_tab'      => [
326
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
327
-                        'filename' => 'event_editor_questions_registrants',
328
-                    ],
329
-                    'event_editor_save_new_event_help_tab'             => [
330
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
331
-                        'filename' => 'event_editor_save_new_event',
332
-                    ],
333
-                    'event_editor_other_help_tab'                      => [
334
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
335
-                        'filename' => 'event_editor_other',
336
-                    ],
337
-                ],
338
-                'help_tour'     => [
339
-                    'Event_Editor_Help_Tour',
340
-                ],
341
-                'require_nonce' => false,
342
-            ],
343
-            'edit'                   => [
344
-                'nav'           => [
345
-                    'label'      => esc_html__('Edit Event', 'event_espresso'),
346
-                    'order'      => 5,
347
-                    'persistent' => false,
348
-                    'url'        => isset($this->_req_data['post'])
349
-                        ? EE_Admin_Page::add_query_args_and_nonce(
350
-                            ['post' => $this->_req_data['post'], 'action' => 'edit'],
351
-                            $this->_current_page_view_url
352
-                        )
353
-                        : $this->_admin_base_url,
354
-                ],
355
-                'metaboxes'     => ['_register_event_editor_meta_boxes'],
356
-                'help_tabs'     => [
357
-                    'event_editor_help_tab'                            => [
358
-                        'title'    => esc_html__('Event Editor', 'event_espresso'),
359
-                        'filename' => 'event_editor',
360
-                    ],
361
-                    'event_editor_title_richtexteditor_help_tab'       => [
362
-                        'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
363
-                        'filename' => 'event_editor_title_richtexteditor',
364
-                    ],
365
-                    'event_editor_venue_details_help_tab'              => [
366
-                        'title'    => esc_html__('Event Venue Details', 'event_espresso'),
367
-                        'filename' => 'event_editor_venue_details',
368
-                    ],
369
-                    'event_editor_event_datetimes_help_tab'            => [
370
-                        'title'    => esc_html__('Event Datetimes', 'event_espresso'),
371
-                        'filename' => 'event_editor_event_datetimes',
372
-                    ],
373
-                    'event_editor_event_tickets_help_tab'              => [
374
-                        'title'    => esc_html__('Event Tickets', 'event_espresso'),
375
-                        'filename' => 'event_editor_event_tickets',
376
-                    ],
377
-                    'event_editor_event_registration_options_help_tab' => [
378
-                        'title'    => esc_html__('Event Registration Options', 'event_espresso'),
379
-                        'filename' => 'event_editor_event_registration_options',
380
-                    ],
381
-                    'event_editor_tags_categories_help_tab'            => [
382
-                        'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
383
-                        'filename' => 'event_editor_tags_categories',
384
-                    ],
385
-                    'event_editor_questions_registrants_help_tab'      => [
386
-                        'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
387
-                        'filename' => 'event_editor_questions_registrants',
388
-                    ],
389
-                    'event_editor_save_new_event_help_tab'             => [
390
-                        'title'    => esc_html__('Save New Event', 'event_espresso'),
391
-                        'filename' => 'event_editor_save_new_event',
392
-                    ],
393
-                    'event_editor_other_help_tab'                      => [
394
-                        'title'    => esc_html__('Event Other', 'event_espresso'),
395
-                        'filename' => 'event_editor_other',
396
-                    ],
397
-                ],
398
-                'require_nonce' => false,
399
-            ],
400
-            'default_event_settings' => [
401
-                'nav'           => [
402
-                    'label' => esc_html__('Default Settings', 'event_espresso'),
403
-                    'order' => 40,
404
-                ],
405
-                'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
406
-                'labels'        => [
407
-                    'publishbox' => esc_html__('Update Settings', 'event_espresso'),
408
-                ],
409
-                'help_tabs'     => [
410
-                    'default_settings_help_tab'        => [
411
-                        'title'    => esc_html__('Default Event Settings', 'event_espresso'),
412
-                        'filename' => 'events_default_settings',
413
-                    ],
414
-                    'default_settings_status_help_tab' => [
415
-                        'title'    => esc_html__('Default Registration Status', 'event_espresso'),
416
-                        'filename' => 'events_default_settings_status',
417
-                    ],
418
-                    'default_maximum_tickets_help_tab' => [
419
-                        'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
420
-                        'filename' => 'events_default_settings_max_tickets',
421
-                    ],
422
-                ],
423
-                'help_tour'     => ['Event_Default_Settings_Help_Tour'],
424
-                'require_nonce' => false,
425
-            ],
426
-            // template settings
427
-            'template_settings'      => [
428
-                'nav'           => [
429
-                    'label' => esc_html__('Templates', 'event_espresso'),
430
-                    'order' => 30,
431
-                ],
432
-                'metaboxes'     => $this->_default_espresso_metaboxes,
433
-                'help_tabs'     => [
434
-                    'general_settings_templates_help_tab' => [
435
-                        'title'    => esc_html__('Templates', 'event_espresso'),
436
-                        'filename' => 'general_settings_templates',
437
-                    ],
438
-                ],
439
-                'help_tour'     => ['Templates_Help_Tour'],
440
-                'require_nonce' => false,
441
-            ],
442
-            // event category stuff
443
-            'add_category'           => [
444
-                'nav'           => [
445
-                    'label'      => esc_html__('Add Category', 'event_espresso'),
446
-                    'order'      => 15,
447
-                    'persistent' => false,
448
-                ],
449
-                'help_tabs'     => [
450
-                    'add_category_help_tab' => [
451
-                        'title'    => esc_html__('Add New Event Category', 'event_espresso'),
452
-                        'filename' => 'events_add_category',
453
-                    ],
454
-                ],
455
-                'help_tour'     => ['Event_Add_Category_Help_Tour'],
456
-                'metaboxes'     => ['_publish_post_box'],
457
-                'require_nonce' => false,
458
-            ],
459
-            'edit_category'          => [
460
-                'nav'           => [
461
-                    'label'      => esc_html__('Edit Category', 'event_espresso'),
462
-                    'order'      => 15,
463
-                    'persistent' => false,
464
-                    'url'        => isset($this->_req_data['EVT_CAT_ID'])
465
-                        ? add_query_arg(
466
-                            ['EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']],
467
-                            $this->_current_page_view_url
468
-                        )
469
-                        : $this->_admin_base_url,
470
-                ],
471
-                'help_tabs'     => [
472
-                    'edit_category_help_tab' => [
473
-                        'title'    => esc_html__('Edit Event Category', 'event_espresso'),
474
-                        'filename' => 'events_edit_category',
475
-                    ],
476
-                ],
477
-                /*'help_tour' => array('Event_Edit_Category_Help_Tour'),*/
478
-                'metaboxes'     => ['_publish_post_box'],
479
-                'require_nonce' => false,
480
-            ],
481
-            'category_list'          => [
482
-                'nav'           => [
483
-                    'label' => esc_html__('Categories', 'event_espresso'),
484
-                    'order' => 20,
485
-                ],
486
-                'list_table'    => 'Event_Categories_Admin_List_Table',
487
-                'help_tabs'     => [
488
-                    'events_categories_help_tab'                       => [
489
-                        'title'    => esc_html__('Event Categories', 'event_espresso'),
490
-                        'filename' => 'events_categories',
491
-                    ],
492
-                    'events_categories_table_column_headings_help_tab' => [
493
-                        'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
494
-                        'filename' => 'events_categories_table_column_headings',
495
-                    ],
496
-                    'events_categories_view_help_tab'                  => [
497
-                        'title'    => esc_html__('Event Categories Views', 'event_espresso'),
498
-                        'filename' => 'events_categories_views',
499
-                    ],
500
-                    'events_categories_other_help_tab'                 => [
501
-                        'title'    => esc_html__('Event Categories Other', 'event_espresso'),
502
-                        'filename' => 'events_categories_other',
503
-                    ],
504
-                ],
505
-                'help_tour'     => [
506
-                    'Event_Categories_Help_Tour',
507
-                ],
508
-                'metaboxes'     => $this->_default_espresso_metaboxes,
509
-                'require_nonce' => false,
510
-            ],
511
-        ];
512
-        // only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
513
-        $domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
514
-        if (! $domain->isCaffeinated()) {
515
-            $this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
516
-            $this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
517
-        }
518
-    }
519
-
520
-
521
-    /**
522
-     * Used to register any global screen options if necessary for every route in this admin page group.
523
-     */
524
-    protected function _add_screen_options()
525
-    {
526
-    }
527
-
528
-
529
-    /**
530
-     * Implementing the screen options for the 'default' route.
531
-     *
532
-     * @throws InvalidArgumentException
533
-     * @throws InvalidDataTypeException
534
-     * @throws InvalidInterfaceException
535
-     */
536
-    protected function _add_screen_options_default()
537
-    {
538
-        $this->_per_page_screen_option();
539
-    }
540
-
541
-
542
-    /**
543
-     * Implementing screen options for the category list route.
544
-     *
545
-     * @throws InvalidArgumentException
546
-     * @throws InvalidDataTypeException
547
-     * @throws InvalidInterfaceException
548
-     */
549
-    protected function _add_screen_options_category_list()
550
-    {
551
-        $page_title = $this->_admin_page_title;
552
-        $this->_admin_page_title = esc_html__('Categories', 'event_espresso');
553
-        $this->_per_page_screen_option();
554
-        $this->_admin_page_title = $page_title;
555
-    }
556
-
557
-
558
-    /**
559
-     * Used to register any global feature pointers for the admin page group.
560
-     */
561
-    protected function _add_feature_pointers()
562
-    {
563
-    }
564
-
565
-
566
-    /**
567
-     * Registers and enqueues any global scripts and styles for the entire admin page group.
568
-     */
569
-    public function load_scripts_styles()
570
-    {
571
-        wp_register_style(
572
-            'events-admin-css',
573
-            EVENTS_ASSETS_URL . 'events-admin-page.css',
574
-            [],
575
-            EVENT_ESPRESSO_VERSION
576
-        );
577
-        wp_register_style(
578
-            'ee-cat-admin',
579
-            EVENTS_ASSETS_URL . 'ee-cat-admin.css',
580
-            [],
581
-            EVENT_ESPRESSO_VERSION
582
-        );
583
-        wp_enqueue_style('events-admin-css');
584
-        wp_enqueue_style('ee-cat-admin');
585
-        // scripts
586
-        wp_register_script(
587
-            'event_editor_js',
588
-            EVENTS_ASSETS_URL . 'event_editor.js',
589
-            ['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
590
-            EVENT_ESPRESSO_VERSION,
591
-            true
592
-        );
593
-    }
594
-
595
-
596
-    /**
597
-     * Enqueuing scripts and styles specific to this view
598
-     */
599
-    public function load_scripts_styles_create_new()
600
-    {
601
-        $this->load_scripts_styles_edit();
602
-    }
603
-
604
-
605
-    /**
606
-     * Enqueuing scripts and styles specific to this view
607
-     */
608
-    public function load_scripts_styles_edit()
609
-    {
610
-        // styles
611
-        wp_enqueue_style('espresso-ui-theme');
612
-        wp_register_style(
613
-            'event-editor-css',
614
-            EVENTS_ASSETS_URL . 'event-editor.css',
615
-            ['ee-admin-css'],
616
-            EVENT_ESPRESSO_VERSION
617
-        );
618
-        wp_enqueue_style('event-editor-css');
619
-        // scripts
620
-        if (! $this->admin_config->useAdvancedEditor()) {
621
-            wp_register_script(
622
-                'event-datetime-metabox',
623
-                EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
624
-                ['event_editor_js', 'ee-datepicker'],
625
-                EVENT_ESPRESSO_VERSION
626
-            );
627
-            wp_enqueue_script('event-datetime-metabox');
628
-        }
629
-    }
630
-
631
-
632
-    /**
633
-     * Populating the _views property for the category list table view.
634
-     */
635
-    protected function _set_list_table_views_category_list()
636
-    {
637
-        $this->_views = [
638
-            'all' => [
639
-                'slug'        => 'all',
640
-                'label'       => esc_html__('All', 'event_espresso'),
641
-                'count'       => 0,
642
-                'bulk_action' => [
643
-                    'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
644
-                ],
645
-            ],
646
-        ];
647
-    }
648
-
649
-
650
-    /**
651
-     * For adding anything that fires on the admin_init hook for any route within this admin page group.
652
-     */
653
-    public function admin_init()
654
-    {
655
-        EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
656
-            'Do you really want to delete this image? Please remember to update your event to complete the removal.',
657
-            'event_espresso'
658
-        );
659
-    }
660
-
661
-
662
-    /**
663
-     * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
664
-     * group.
665
-     */
666
-    public function admin_notices()
667
-    {
668
-    }
669
-
670
-
671
-    /**
672
-     * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
673
-     * this admin page group.
674
-     */
675
-    public function admin_footer_scripts()
676
-    {
677
-    }
678
-
679
-
680
-    /**
681
-     * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
682
-     * warning (via EE_Error::add_error());
683
-     *
684
-     * @param EE_Event $event Event object
685
-     * @param string   $req_type
686
-     * @return void
687
-     * @throws EE_Error
688
-     * @access public
689
-     */
690
-    public function verify_event_edit($event = null, $req_type = '')
691
-    {
692
-        // don't need to do this when processing
693
-        if (! empty($req_type)) {
694
-            return;
695
-        }
696
-        // no event?
697
-        if (! $event instanceof EE_Event) {
698
-            $event = $this->_cpt_model_obj;
699
-        }
700
-        // STILL no event?
701
-        if (! $event instanceof EE_Event) {
702
-            return;
703
-        }
704
-        $orig_status = $event->status();
705
-        // first check if event is active.
706
-        if (
707
-            $orig_status === EEM_Event::cancelled
708
-            || $orig_status === EEM_Event::postponed
709
-            || $event->is_expired()
710
-            || $event->is_inactive()
711
-        ) {
712
-            return;
713
-        }
714
-        // made it here so it IS active... next check that any of the tickets are sold.
715
-        if ($event->is_sold_out(true)) {
716
-            if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
717
-                EE_Error::add_attention(
718
-                    sprintf(
719
-                        esc_html__(
720
-                            'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.',
721
-                            'event_espresso'
722
-                        ),
723
-                        EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
724
-                    )
725
-                );
726
-            }
727
-            return;
728
-        }
729
-        if ($orig_status === EEM_Event::sold_out) {
730
-            EE_Error::add_attention(
731
-                sprintf(
732
-                    esc_html__(
733
-                        'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
734
-                        'event_espresso'
735
-                    ),
736
-                    EEH_Template::pretty_status($event->status(), false, 'sentence')
737
-                )
738
-            );
739
-        }
740
-        // now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
741
-        if (! $event->tickets_on_sale()) {
742
-            return;
743
-        }
744
-        // made it here so show warning
745
-        $this->_edit_event_warning();
746
-    }
747
-
748
-
749
-    /**
750
-     * This is the text used for when an event is being edited that is public and has tickets for sale.
751
-     * When needed, hook this into a EE_Error::add_error() notice.
752
-     *
753
-     * @access protected
754
-     * @return void
755
-     */
756
-    protected function _edit_event_warning()
757
-    {
758
-        // we don't want to add warnings during these requests
759
-        if (isset($this->_req_data['action']) && $this->_req_data['action'] === 'editpost') {
760
-            return;
761
-        }
762
-        EE_Error::add_attention(
763
-            sprintf(
764
-                esc_html__(
765
-                    'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
766
-                    'event_espresso'
767
-                ),
768
-                '<a class="espresso-help-tab-lnk">',
769
-                '</a>'
770
-            )
771
-        );
772
-    }
773
-
774
-
775
-    /**
776
-     * When a user is creating a new event, notify them if they haven't set their timezone.
777
-     * Otherwise, do the normal logic
778
-     *
779
-     * @throws EE_Error
780
-     * @throws InvalidArgumentException
781
-     * @throws InvalidDataTypeException
782
-     */
783
-    protected function _create_new_cpt_item()
784
-    {
785
-        $has_timezone_string = get_option('timezone_string');
786
-        // only nag them about setting their timezone if it's their first event, and they haven't already done it
787
-        if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
788
-            EE_Error::add_attention(
789
-                sprintf(
790
-                    __(
791
-                        'Your website\'s timezone is currently set to a UTC offset. We recommend updating your timezone to a city or region near you before you create an event. Change your timezone now:%1$s%2$s%3$sChange Timezone%4$s',
792
-                        'event_espresso'
793
-                    ),
794
-                    '<br>',
795
-                    '<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
796
-                    . EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
797
-                    . '</select>',
798
-                    '<button class="button button-secondary timezone-submit">',
799
-                    '</button><span class="spinner"></span>'
800
-                ),
801
-                __FILE__,
802
-                __FUNCTION__,
803
-                __LINE__
804
-            );
805
-        }
806
-        parent::_create_new_cpt_item();
807
-    }
808
-
809
-
810
-    /**
811
-     * Sets the _views property for the default route in this admin page group.
812
-     */
813
-    protected function _set_list_table_views_default()
814
-    {
815
-        $this->_views = [
816
-            'all'   => [
817
-                'slug'        => 'all',
818
-                'label'       => esc_html__('View All Events', 'event_espresso'),
819
-                'count'       => 0,
820
-                'bulk_action' => [
821
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
822
-                ],
823
-            ],
824
-            'draft' => [
825
-                'slug'        => 'draft',
826
-                'label'       => esc_html__('Draft', 'event_espresso'),
827
-                'count'       => 0,
828
-                'bulk_action' => [
829
-                    'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
830
-                ],
831
-            ],
832
-        ];
833
-        if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
834
-            $this->_views['trash'] = [
835
-                'slug'        => 'trash',
836
-                'label'       => esc_html__('Trash', 'event_espresso'),
837
-                'count'       => 0,
838
-                'bulk_action' => [
839
-                    'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
840
-                    'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
841
-                ],
842
-            ];
843
-        }
844
-    }
845
-
846
-
847
-    /**
848
-     * Provides the legend item array for the default list table view.
849
-     *
850
-     * @return array
851
-     */
852
-    protected function _event_legend_items()
853
-    {
854
-        $items = [
855
-            'view_details'   => [
856
-                'class' => 'dashicons dashicons-search',
857
-                'desc'  => esc_html__('View Event', 'event_espresso'),
858
-            ],
859
-            'edit_event'     => [
860
-                'class' => 'ee-icon ee-icon-calendar-edit',
861
-                'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
862
-            ],
863
-            'view_attendees' => [
864
-                'class' => 'dashicons dashicons-groups',
865
-                'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
866
-            ],
867
-        ];
868
-        $items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
869
-        $statuses = [
870
-            'sold_out_status'  => [
871
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
872
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
873
-            ],
874
-            'active_status'    => [
875
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
876
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
877
-            ],
878
-            'upcoming_status'  => [
879
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
880
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
881
-            ],
882
-            'postponed_status' => [
883
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
884
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
885
-            ],
886
-            'cancelled_status' => [
887
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
888
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
889
-            ],
890
-            'expired_status'   => [
891
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
892
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
893
-            ],
894
-            'inactive_status'  => [
895
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
896
-                'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
897
-            ],
898
-        ];
899
-        $statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
900
-        return array_merge($items, $statuses);
901
-    }
902
-
903
-
904
-    /**
905
-     * @return EEM_Event
906
-     * @throws EE_Error
907
-     */
908
-    private function eventModel()
909
-    {
910
-        if (! $this->_event_model instanceof EEM_Event) {
911
-            $this->_event_model = EEM_Event::instance();
912
-        }
913
-        return $this->_event_model;
914
-    }
915
-
916
-
917
-    /**
918
-     * @param string $event_timezone_string
919
-     * @return EEM_Datetime
920
-     * @throws EE_Error
921
-     */
922
-    private function datetimeModel($event_timezone_string = '')
923
-    {
924
-        if (! $this->datetime_model instanceof EEM_Datetime) {
925
-            $this->datetime_model = EEM_Datetime::instance($event_timezone_string);
926
-        }
927
-        return $this->datetime_model;
928
-    }
929
-
930
-
931
-    /**
932
-     * @param string $event_timezone_string
933
-     * @return EEM_Ticket
934
-     * @throws EE_Error
935
-     */
936
-    private function ticketModel($event_timezone_string = '')
937
-    {
938
-        if (! $this->ticket_model instanceof EEM_Ticket) {
939
-            $this->ticket_model = EEM_Ticket::instance($event_timezone_string);
940
-        }
941
-        return $this->ticket_model;
942
-    }
943
-
944
-
945
-    /**
946
-     * Adds extra buttons to the WP CPT permalink field row.
947
-     * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
948
-     *
949
-     * @param string $return    the current html
950
-     * @param int    $id        the post id for the page
951
-     * @param string $new_title What the title is
952
-     * @param string $new_slug  what the slug is
953
-     * @return string            The new html string for the permalink area
954
-     */
955
-    public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
956
-    {
957
-        // make sure this is only when editing
958
-        if (! empty($id)) {
959
-            $post = get_post($id);
960
-            $return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
961
-                       . esc_html__('Shortcode', 'event_espresso')
962
-                       . '</a> ';
963
-            $return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
964
-                       . $post->ID
965
-                       . ']">';
966
-        }
967
-        return $return;
968
-    }
969
-
970
-
971
-    /**
972
-     * _events_overview_list_table
973
-     * This contains the logic for showing the events_overview list
974
-     *
975
-     * @access protected
976
-     * @return void
977
-     * @throws DomainException
978
-     * @throws EE_Error
979
-     * @throws InvalidArgumentException
980
-     * @throws InvalidDataTypeException
981
-     * @throws InvalidInterfaceException
982
-     */
983
-    protected function _events_overview_list_table()
984
-    {
985
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
986
-        $this->_template_args['after_list_table'] = ! empty($this->_template_args['after_list_table'])
987
-            ? (array) $this->_template_args['after_list_table']
988
-            : [];
989
-        $this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
990
-                                                                              . EEH_Template::get_button_or_link(
991
-                                                                                  get_post_type_archive_link('espresso_events'),
992
-                                                                                  esc_html__('View Event Archive Page', 'event_espresso'),
993
-                                                                                  'button'
994
-                                                                              );
995
-        $this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
996
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
997
-            'create_new',
998
-            'add',
999
-            [],
1000
-            'add-new-h2'
1001
-        );
1002
-        $this->display_admin_list_table_page_with_no_sidebar();
1003
-    }
1004
-
1005
-
1006
-    /**
1007
-     * this allows for extra misc actions in the default WP publish box
1008
-     *
1009
-     * @return void
1010
-     * @throws DomainException
1011
-     * @throws EE_Error
1012
-     * @throws InvalidArgumentException
1013
-     * @throws InvalidDataTypeException
1014
-     * @throws InvalidInterfaceException
1015
-     * @throws ReflectionException
1016
-     */
1017
-    public function extra_misc_actions_publish_box()
1018
-    {
1019
-        $this->_generate_publish_box_extra_content();
1020
-    }
1021
-
1022
-
1023
-    /**
1024
-     * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
1025
-     * saved.
1026
-     * Typically you would use this to save any additional data.
1027
-     * Keep in mind also that "save_post" runs on EVERY post update to the database.
1028
-     * ALSO very important.  When a post transitions from scheduled to published,
1029
-     * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
1030
-     * other meta saves. So MAKE sure that you handle this accordingly.
1031
-     *
1032
-     * @access protected
1033
-     * @abstract
1034
-     * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1035
-     * @param object $post    The post object of the cpt that was saved.
1036
-     * @return void
1037
-     * @throws EE_Error
1038
-     * @throws InvalidArgumentException
1039
-     * @throws InvalidDataTypeException
1040
-     * @throws InvalidInterfaceException
1041
-     * @throws ReflectionException
1042
-     */
1043
-    protected function _insert_update_cpt_item($post_id, $post)
1044
-    {
1045
-        if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1046
-            // get out we're not processing an event save.
1047
-            return;
1048
-        }
1049
-        $event_values = [
1050
-            'EVT_member_only'     => ! empty($this->_req_data['member_only']) ? 1 : 0,
1051
-            'EVT_allow_overflow'  => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
1052
-            'EVT_timezone_string' => ! empty($this->_req_data['timezone_string'])
1053
-                ? sanitize_text_field($this->_req_data['timezone_string'])
1054
-                : null,
1055
-        ];
1056
-        /** @var FeatureFlags $flags */
1057
-        $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1058
-        // check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1059
-        if (! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1060
-            $event_values['EVT_display_ticket_selector'] =
1061
-                ! empty($this->_req_data['display_ticket_selector'])
1062
-                    ? 1
1063
-                    : 0;
1064
-            $event_values['EVT_additional_limit'] = min(
1065
-                apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1066
-                ! empty($this->_req_data['additional_limit'])
1067
-                    ? absint($this->_req_data['additional_limit'])
1068
-                    : null
1069
-            );
1070
-            $event_values['EVT_default_registration_status'] =
1071
-                ! empty($this->_req_data['EVT_default_registration_status'])
1072
-                    ? sanitize_text_field($this->_req_data['EVT_default_registration_status'])
1073
-                    : EE_Registry::instance()->CFG->registration->default_STS_ID;
1074
-            $event_values['EVT_external_URL'] = ! empty($this->_req_data['externalURL'])
1075
-                ? esc_url_raw($this->_req_data['externalURL'])
1076
-                : null;
1077
-            $event_values['EVT_phone'] = ! empty($this->_req_data['event_phone'])
1078
-                ? sanitize_text_field($this->_req_data['event_phone'])
1079
-                : null;
1080
-        }
1081
-        // update event
1082
-        $success = $this->eventModel()->update_by_ID($event_values, $post_id);
1083
-        // get event_object for other metaboxes...
1084
-        // though it would seem to make sense to just use $this->eventModel()->get_one_by_ID( $post_id )..
1085
-        // i have to setup where conditions to override the filters in the model
1086
-        // that filter out autodraft and inherit statuses so we GET the inherit id!
1087
-        $get_one_where = [
1088
-            $this->eventModel()->primary_key_name() => $post_id,
1089
-            'OR'                                    => [
1090
-                'status'   => $post->post_status,
1091
-                // if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1092
-                // but the returned object here has a status of "publish", so use the original post status as well
1093
-                'status*1' => $this->_req_data['original_post_status'],
1094
-            ],
1095
-        ];
1096
-        $event = $this->eventModel()->get_one([$get_one_where]);
1097
-        // the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
1098
-        $event_update_callbacks = apply_filters(
1099
-            'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1100
-            [
1101
-                [$this, '_default_venue_update'],
1102
-                [$this, '_default_tickets_update'],
1103
-            ]
1104
-        );
1105
-        $att_success = true;
1106
-        foreach ($event_update_callbacks as $e_callback) {
1107
-            $_success = is_callable($e_callback)
1108
-                ? $e_callback($event, $this->_req_data)
1109
-                : false;
1110
-            // if ANY of these updates fail then we want the appropriate global error message
1111
-            $att_success = ! $att_success ? $att_success : $_success;
1112
-        }
1113
-        // any errors?
1114
-        if ($success && false === $att_success) {
1115
-            EE_Error::add_error(
1116
-                esc_html__(
1117
-                    'Event Details saved successfully but something went wrong with saving attachments.',
1118
-                    'event_espresso'
1119
-                ),
1120
-                __FILE__,
1121
-                __FUNCTION__,
1122
-                __LINE__
1123
-            );
1124
-        } elseif ($success === false) {
1125
-            EE_Error::add_error(
1126
-                esc_html__('Event Details did not save successfully.', 'event_espresso'),
1127
-                __FILE__,
1128
-                __FUNCTION__,
1129
-                __LINE__
1130
-            );
1131
-        }
1132
-    }
1133
-
1134
-
1135
-    /**
1136
-     * @param int $post_id
1137
-     * @param int $revision_id
1138
-     * @throws EE_Error
1139
-     * @throws InvalidArgumentException
1140
-     * @throws InvalidDataTypeException
1141
-     * @throws InvalidInterfaceException
1142
-     * @throws ReflectionException
1143
-     * @see parent::restore_item()
1144
-     */
1145
-    protected function _restore_cpt_item($post_id, $revision_id)
1146
-    {
1147
-        // copy existing event meta to new post
1148
-        $post_evt = $this->eventModel()->get_one_by_ID($post_id);
1149
-        if ($post_evt instanceof EE_Event) {
1150
-            // meta revision restore
1151
-            $post_evt->restore_revision($revision_id);
1152
-            // related objs restore
1153
-            $post_evt->restore_revision($revision_id, ['Venue', 'Datetime', 'Price']);
1154
-        }
1155
-    }
1156
-
1157
-
1158
-    /**
1159
-     * Attach the venue to the Event
1160
-     *
1161
-     * @param EE_Event $evtobj Event Object to add the venue to
1162
-     * @param array    $data   The request data from the form
1163
-     * @return bool           Success or fail.
1164
-     * @throws EE_Error
1165
-     * @throws InvalidArgumentException
1166
-     * @throws InvalidDataTypeException
1167
-     * @throws InvalidInterfaceException
1168
-     * @throws ReflectionException
1169
-     */
1170
-    protected function _default_venue_update(EE_Event $evtobj, $data)
1171
-    {
1172
-        require_once(EE_MODELS . 'EEM_Venue.model.php');
1173
-        $venue_model = EEM_Venue::instance();
1174
-        $rows_affected = null;
1175
-        $venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1176
-        // very important.  If we don't have a venue name...
1177
-        // then we'll get out because not necessary to create empty venue
1178
-        if (empty($data['venue_title'])) {
1179
-            return false;
1180
-        }
1181
-        $venue_array = [
1182
-            'VNU_wp_user'         => $evtobj->get('EVT_wp_user'),
1183
-            'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1184
-            'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1185
-            'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1186
-            'VNU_short_desc'      => ! empty($data['venue_short_description']) ? $data['venue_short_description']
1187
-                : null,
1188
-            'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1189
-            'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1190
-            'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1191
-            'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1192
-            'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1193
-            'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1194
-            'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1195
-            'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1196
-            'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1197
-            'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1198
-            'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1199
-            'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1200
-            'status'              => 'publish',
1201
-        ];
1202
-        // if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1203
-        if (! empty($venue_id)) {
1204
-            $update_where = [$venue_model->primary_key_name() => $venue_id];
1205
-            $rows_affected = $venue_model->update($venue_array, [$update_where]);
1206
-            // we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
1207
-            $evtobj->_add_relation_to($venue_id, 'Venue');
1208
-            return $rows_affected > 0;
1209
-        }
1210
-        // we insert the venue
1211
-        $venue_id = $venue_model->insert($venue_array);
1212
-        $evtobj->_add_relation_to($venue_id, 'Venue');
1213
-        return ! empty($venue_id) ? true : false;
1214
-        // when we have the ancestor come in it's already been handled by the revision save.
1215
-    }
1216
-
1217
-
1218
-    /**
1219
-     * Handles saving everything related to Tickets (datetimes, tickets, prices)
1220
-     *
1221
-     * @param EE_Event $evtobj The Event object we're attaching data to
1222
-     * @param array    $data   The request data from the form
1223
-     * @return array
1224
-     * @throws EE_Error
1225
-     * @throws InvalidArgumentException
1226
-     * @throws InvalidDataTypeException
1227
-     * @throws InvalidInterfaceException
1228
-     * @throws ReflectionException
1229
-     * @throws Exception
1230
-     */
1231
-    protected function _default_tickets_update(EE_Event $evtobj, $data)
1232
-    {
1233
-        if ($this->admin_config->useAdvancedEditor()) {
1234
-            return [];
1235
-        }
1236
-        $saved_dtt = null;
1237
-        $saved_tickets = [];
1238
-        $incoming_date_formats = ['Y-m-d', 'h:i a'];
1239
-        $event_timezone_string = $evtobj->get_timezone();
1240
-        $event_timezone = new DateTimeZone($event_timezone_string);
1241
-        // let's use now in the set timezone.
1242
-        $now = new DateTime('now', $event_timezone);
1243
-        foreach ($data['edit_event_datetimes'] as $row => $dtt) {
1244
-            // trim all values to ensure any excess whitespace is removed.
1245
-            $dtt = array_map('trim', $dtt);
1246
-            $dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end'])
1247
-                ? $dtt['DTT_EVT_end']
1248
-                : $dtt['DTT_EVT_start'];
1249
-            $datetime_values = [
1250
-                'DTT_ID'        => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : null,
1251
-                'DTT_EVT_start' => $dtt['DTT_EVT_start'],
1252
-                'DTT_EVT_end'   => $dtt['DTT_EVT_end'],
1253
-                'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? EE_INF : $dtt['DTT_reg_limit'],
1254
-                'DTT_order'     => $row,
1255
-            ];
1256
-            // if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1257
-            if (! empty($dtt['DTT_ID'])) {
1258
-                $DTM = $this->datetimeModel($event_timezone_string)->get_one_by_ID($dtt['DTT_ID']);
1259
-                $DTM->set_date_format($incoming_date_formats[0]);
1260
-                $DTM->set_time_format($incoming_date_formats[1]);
1261
-                foreach ($datetime_values as $field => $value) {
1262
-                    $DTM->set($field, $value);
1263
-                }
1264
-                // make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1265
-                $saved_dtts[ $DTM->ID() ] = $DTM;
1266
-            } else {
1267
-                $DTM = EE_Registry::instance()->load_class(
1268
-                    'Datetime',
1269
-                    [$datetime_values, $event_timezone_string, $incoming_date_formats],
1270
-                    false,
1271
-                    false
1272
-                );
1273
-                foreach ($datetime_values as $field => $value) {
1274
-                    $DTM->set($field, $value);
1275
-                }
1276
-            }
1277
-            $DTM->save();
1278
-            $DTM = $evtobj->_add_relation_to($DTM, 'Datetime');
1279
-            // load DTT helper
1280
-            // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1281
-            if ($DTM->get_raw('DTT_EVT_start') > $DTM->get_raw('DTT_EVT_end')) {
1282
-                $DTM->set('DTT_EVT_end', $DTM->get('DTT_EVT_start'));
1283
-                $DTM = EEH_DTT_Helper::date_time_add($DTM, 'DTT_EVT_end', 'days');
1284
-                $DTM->save();
1285
-            }
1286
-            // now we got to make sure we add the new DTT_ID to the $saved_dtts array
1287
-            //  because it is possible there was a new one created for the autosave.
1288
-            $saved_dtt = $DTM;
1289
-            // if ANY of these updates fail then we want the appropriate global error message.
1290
-            // //todo this is actually sucky we need a better error message but this is what it is for now.
1291
-        }
1292
-        // no dtts get deleted so we don't do any of that logic here.
1293
-        // update tickets next
1294
-        $old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : [];
1295
-        foreach ($data['edit_tickets'] as $row => $tkt) {
1296
-            $incoming_date_formats = ['Y-m-d', 'h:i a'];
1297
-            $update_prices = false;
1298
-            $ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1299
-                ? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1300
-            // trim inputs to ensure any excess whitespace is removed.
1301
-            $tkt = array_map('trim', $tkt);
1302
-            if (empty($tkt['TKT_start_date'])) {
1303
-                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1304
-            }
1305
-            if (empty($tkt['TKT_end_date'])) {
1306
-                // use the start date of the first datetime
1307
-                $dtt = $evtobj->first_datetime();
1308
-                $tkt['TKT_end_date'] = $dtt->start_date_and_time(
1309
-                    $incoming_date_formats[0],
1310
-                    $incoming_date_formats[1]
1311
-                );
1312
-            }
1313
-            $TKT_values = [
1314
-                'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
1315
-                'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
1316
-                'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
1317
-                'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
1318
-                'TKT_start_date'  => $tkt['TKT_start_date'],
1319
-                'TKT_end_date'    => $tkt['TKT_end_date'],
1320
-                'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1321
-                'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1322
-                'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
1323
-                'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
1324
-                'TKT_row'         => $row,
1325
-                'TKT_order'       => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
1326
-                'TKT_price'       => $ticket_price,
1327
-            ];
1328
-            // if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1329
-            if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1330
-                $TKT_values['TKT_ID'] = 0;
1331
-                $TKT_values['TKT_is_default'] = 0;
1332
-                $TKT_values['TKT_price'] = $ticket_price;
1333
-                $update_prices = true;
1334
-            }
1335
-            // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1336
-            // we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1337
-            // keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1338
-            if (! empty($tkt['TKT_ID'])) {
1339
-                $TKT = $this->ticketModel($event_timezone_string)->get_one_by_ID($tkt['TKT_ID']);
1340
-                if ($TKT instanceof EE_Ticket) {
1341
-                    $ticket_sold = $TKT->count_related(
1342
-                        'Registration',
1343
-                        [
1344
-                                [
1345
-                                    'STS_ID' => [
1346
-                                        'NOT IN',
1347
-                                        [EEM_Registration::status_id_incomplete],
1348
-                                    ],
1349
-                                ],
1350
-                            ]
1351
-                    ) > 0;
1352
-                    // let's just check the total price for the existing ticket and determine if it matches the new
1353
-                    // total price.  if they are different then we create a new ticket (if tickets sold)
1354
-                    // if they aren't different then we go ahead and modify existing ticket.
1355
-                    $create_new_TKT = $ticket_sold && ! $TKT->deleted()
1356
-                                      && EEH_Money::compare_floats(
1357
-                                          $ticket_price,
1358
-                                          $TKT->get('TKT_price'),
1359
-                                          '!=='
1360
-                                      );
1361
-                    $TKT->set_date_format($incoming_date_formats[0]);
1362
-                    $TKT->set_time_format($incoming_date_formats[1]);
1363
-                    // set new values
1364
-                    foreach ($TKT_values as $field => $value) {
1365
-                        if ($field === 'TKT_qty') {
1366
-                            $TKT->set_qty($value);
1367
-                        } else {
1368
-                            $TKT->set($field, $value);
1369
-                        }
1370
-                    }
1371
-                    // if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1372
-                    if ($create_new_TKT) {
1373
-                        // archive the old ticket first
1374
-                        $TKT->set('TKT_deleted', 1);
1375
-                        $TKT->save();
1376
-                        // make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1377
-                        $saved_tickets[ $TKT->ID() ] = $TKT;
1378
-                        // create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1379
-                        $TKT = clone $TKT;
1380
-                        $TKT->set('TKT_ID', 0);
1381
-                        $TKT->set('TKT_deleted', 0);
1382
-                        $TKT->set('TKT_price', $ticket_price);
1383
-                        $TKT->set('TKT_sold', 0);
1384
-                        // now we need to make sure that $new prices are created as well and attached to new ticket.
1385
-                        $update_prices = true;
1386
-                    }
1387
-                    // make sure price is set if it hasn't been already
1388
-                    $TKT->set('TKT_price', $ticket_price);
1389
-                }
1390
-            } else {
1391
-                // no TKT_id so a new TKT
1392
-                $TKT_values['TKT_price'] = $ticket_price;
1393
-                $TKT = EE_Registry::instance()->load_class('Ticket', [$TKT_values], false, false);
1394
-                if ($TKT instanceof EE_Ticket) {
1395
-                    // need to reset values to properly account for the date formats
1396
-                    $TKT->set_date_format($incoming_date_formats[0]);
1397
-                    $TKT->set_time_format($incoming_date_formats[1]);
1398
-                    $TKT->set_timezone($evtobj->get_timezone());
1399
-                    // set new values
1400
-                    foreach ($TKT_values as $field => $value) {
1401
-                        if ($field === 'TKT_qty') {
1402
-                            $TKT->set_qty($value);
1403
-                        } else {
1404
-                            $TKT->set($field, $value);
1405
-                        }
1406
-                    }
1407
-                    $update_prices = true;
1408
-                }
1409
-            }
1410
-            // cap ticket qty by datetime reg limits
1411
-            $TKT->set_qty(min($TKT->qty(), $TKT->qty('reg_limit')));
1412
-            // update ticket.
1413
-            $TKT->save();
1414
-            // before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1415
-            if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1416
-                $TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1417
-                $TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1418
-                $TKT->save();
1419
-            }
1420
-            // initially let's add the ticket to the dtt
1421
-            $saved_dtt->_add_relation_to($TKT, 'Ticket');
1422
-            $saved_tickets[ $TKT->ID() ] = $TKT;
1423
-            // add prices to ticket
1424
-            $this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1425
-        }
1426
-        // however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1427
-        $old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
1428
-        $tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1429
-        foreach ($tickets_removed as $id) {
1430
-            $id = absint($id);
1431
-            // get the ticket for this id
1432
-            $tkt_to_remove = $this->ticketModel($event_timezone_string)->get_one_by_ID($id);
1433
-            // need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1434
-            $dtts = $tkt_to_remove->get_many_related('Datetime');
1435
-            foreach ($dtts as $dtt) {
1436
-                $tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1437
-            }
1438
-            // need to do the same for prices (except these prices can also be deleted because again, tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1439
-            $tkt_to_remove->delete_related_permanently('Price');
1440
-            // finally let's delete this ticket (which should not be blocked at this point b/c we've removed all our relationships)
1441
-            $tkt_to_remove->delete_permanently();
1442
-        }
1443
-        return [$saved_dtt, $saved_tickets];
1444
-    }
1445
-
1446
-
1447
-    /**
1448
-     * This attaches a list of given prices to a ticket.
1449
-     * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
1450
-     * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
1451
-     * price info and prices are automatically "archived" via the ticket.
1452
-     *
1453
-     * @access  private
1454
-     * @param array     $prices     Array of prices from the form.
1455
-     * @param EE_Ticket $ticket     EE_Ticket object that prices are being attached to.
1456
-     * @param bool      $new_prices Whether attach existing incoming prices or create new ones.
1457
-     * @return  void
1458
-     * @throws EE_Error
1459
-     * @throws InvalidArgumentException
1460
-     * @throws InvalidDataTypeException
1461
-     * @throws InvalidInterfaceException
1462
-     * @throws ReflectionException
1463
-     */
1464
-    private function _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = false)
1465
-    {
1466
-        foreach ($prices as $row => $prc) {
1467
-            $PRC_values = [
1468
-                'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
1469
-                'PRT_ID'         => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null,
1470
-                'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1471
-                'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1472
-                'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1473
-                'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1474
-                'PRC_order'      => $row,
1475
-            ];
1476
-            if ($new_prices || empty($PRC_values['PRC_ID'])) {
1477
-                $PRC_values['PRC_ID'] = 0;
1478
-                $PRC = EE_Registry::instance()->load_class('Price', [$PRC_values], false, false);
1479
-            } else {
1480
-                $PRC = EEM_Price::instance()->get_one_by_ID($prc['PRC_ID']);
1481
-                // update this price with new values
1482
-                foreach ($PRC_values as $field => $newprc) {
1483
-                    $PRC->set($field, $newprc);
1484
-                }
1485
-                $PRC->save();
1486
-            }
1487
-            $ticket->_add_relation_to($PRC, 'Price');
1488
-        }
1489
-    }
1490
-
1491
-
1492
-    /**
1493
-     * Add in our autosave ajax handlers
1494
-     *
1495
-     */
1496
-    protected function _ee_autosave_create_new()
1497
-    {
1498
-    }
1499
-
1500
-
1501
-    /**
1502
-     * More autosave handlers.
1503
-     */
1504
-    protected function _ee_autosave_edit()
1505
-    {
1506
-    }
1507
-
1508
-
1509
-    /**
1510
-     *    _generate_publish_box_extra_content
1511
-     *
1512
-     * @throws DomainException
1513
-     * @throws EE_Error
1514
-     * @throws InvalidArgumentException
1515
-     * @throws InvalidDataTypeException
1516
-     * @throws InvalidInterfaceException
1517
-     * @throws ReflectionException
1518
-     */
1519
-    private function _generate_publish_box_extra_content()
1520
-    {
1521
-        // load formatter helper
1522
-        // args for getting related registrations
1523
-        $approved_query_args = [
1524
-            [
1525
-                'REG_deleted' => 0,
1526
-                'STS_ID'      => EEM_Registration::status_id_approved,
1527
-            ],
1528
-        ];
1529
-        $not_approved_query_args = [
1530
-            [
1531
-                'REG_deleted' => 0,
1532
-                'STS_ID'      => EEM_Registration::status_id_not_approved,
1533
-            ],
1534
-        ];
1535
-        $pending_payment_query_args = [
1536
-            [
1537
-                'REG_deleted' => 0,
1538
-                'STS_ID'      => EEM_Registration::status_id_pending_payment,
1539
-            ],
1540
-        ];
1541
-        // publish box
1542
-        $publish_box_extra_args = [
1543
-            'view_approved_reg_url'        => add_query_arg(
1544
-                [
1545
-                    'action'      => 'default',
1546
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1547
-                    '_reg_status' => EEM_Registration::status_id_approved,
1548
-                ],
1549
-                REG_ADMIN_URL
1550
-            ),
1551
-            'view_not_approved_reg_url'    => add_query_arg(
1552
-                [
1553
-                    'action'      => 'default',
1554
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1555
-                    '_reg_status' => EEM_Registration::status_id_not_approved,
1556
-                ],
1557
-                REG_ADMIN_URL
1558
-            ),
1559
-            'view_pending_payment_reg_url' => add_query_arg(
1560
-                [
1561
-                    'action'      => 'default',
1562
-                    'event_id'    => $this->_cpt_model_obj->ID(),
1563
-                    '_reg_status' => EEM_Registration::status_id_pending_payment,
1564
-                ],
1565
-                REG_ADMIN_URL
1566
-            ),
1567
-            'approved_regs'                => $this->_cpt_model_obj->count_related(
1568
-                'Registration',
1569
-                $approved_query_args
1570
-            ),
1571
-            'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1572
-                'Registration',
1573
-                $not_approved_query_args
1574
-            ),
1575
-            'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1576
-                'Registration',
1577
-                $pending_payment_query_args
1578
-            ),
1579
-            'misc_pub_section_class'       => apply_filters(
1580
-                'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1581
-                'misc-pub-section'
1582
-            ),
1583
-        ];
1584
-        ob_start();
1585
-        do_action(
1586
-            'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1587
-            $this->_cpt_model_obj
1588
-        );
1589
-        $publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1590
-        // load template
1591
-        EEH_Template::display_template(
1592
-            EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1593
-            $publish_box_extra_args
1594
-        );
1595
-    }
1596
-
1597
-
1598
-    /**
1599
-     * @return EE_Event
1600
-     */
1601
-    public function get_event_object()
1602
-    {
1603
-        return $this->_cpt_model_obj;
1604
-    }
1605
-
1606
-
1607
-
1608
-
1609
-    /** METABOXES * */
1610
-    /**
1611
-     * _register_event_editor_meta_boxes
1612
-     * add all metaboxes related to the event_editor
1613
-     *
1614
-     * @return void
1615
-     * @throws EE_Error
1616
-     * @throws InvalidArgumentException
1617
-     * @throws InvalidDataTypeException
1618
-     * @throws InvalidInterfaceException
1619
-     * @throws ReflectionException
1620
-     */
1621
-    protected function _register_event_editor_meta_boxes()
1622
-    {
1623
-        $this->verify_cpt_object();
1624
-        $use_advanced_editor = $this->admin_config->useAdvancedEditor();
1625
-        /** @var FeatureFlags $flags */
1626
-        $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1627
-        // check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1628
-        if (! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1629
-            add_meta_box(
1630
-                'espresso_event_editor_event_options',
1631
-                esc_html__('Event Registration Options', 'event_espresso'),
1632
-                [$this, 'registration_options_meta_box'],
1633
-                $this->page_slug,
1634
-                'side'
1635
-            );
1636
-        }
1637
-        if (! $use_advanced_editor) {
1638
-            add_meta_box(
1639
-                'espresso_event_editor_tickets',
1640
-                esc_html__('Event Datetime & Ticket', 'event_espresso'),
1641
-                [$this, 'ticket_metabox'],
1642
-                $this->page_slug,
1643
-                'normal',
1644
-                'high'
1645
-            );
1646
-        } else {
1647
-            if ($flags->featureAllowed('use_reg_options_meta_box')) {
1648
-                add_action(
1649
-                    'add_meta_boxes_espresso_events',
1650
-                    function () {
1651
-                        global $current_screen;
1652
-                        remove_meta_box('authordiv', $current_screen, 'normal');
1653
-                    },
1654
-                    99
1655
-                );
1656
-            }
1657
-        }
1658
-        // NOTE: if you're looking for other metaboxes in here,
1659
-        // where a metabox has a related management page in the admin
1660
-        // you will find it setup in the related management page's "_Hooks" file.
1661
-        // i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1662
-    }
1663
-
1664
-
1665
-    /**
1666
-     * @throws DomainException
1667
-     * @throws EE_Error
1668
-     * @throws InvalidArgumentException
1669
-     * @throws InvalidDataTypeException
1670
-     * @throws InvalidInterfaceException
1671
-     * @throws ReflectionException
1672
-     */
1673
-    public function ticket_metabox()
1674
-    {
1675
-        $existing_datetime_ids = $existing_ticket_ids = [];
1676
-        // defaults for template args
1677
-        $template_args = [
1678
-            'existing_datetime_ids'    => '',
1679
-            'event_datetime_help_link' => '',
1680
-            'ticket_options_help_link' => '',
1681
-            'time'                     => null,
1682
-            'ticket_rows'              => '',
1683
-            'existing_ticket_ids'      => '',
1684
-            'total_ticket_rows'        => 1,
1685
-            'ticket_js_structure'      => '',
1686
-            'trash_icon'               => 'ee-lock-icon',
1687
-            'disabled'                 => '',
1688
-        ];
1689
-        $event_id = $this->_cpt_model_obj instanceof EE_Event ? $this->_cpt_model_obj->ID() : 0;
1690
-        $event_timezone_string = $this->_cpt_model_obj instanceof EE_Event
1691
-            ? $this->_cpt_model_obj->timezone_string()
1692
-            : '';
1693
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1694
-        /**
1695
-         * 1. Start with retrieving Datetimes
1696
-         * 2. Fore each datetime get related tickets
1697
-         * 3. For each ticket get related prices
1698
-         */
1699
-        $times = $this->datetimeModel($event_timezone_string)->get_all_event_dates($event_id);
1700
-        /** @type EE_Datetime $first_datetime */
1701
-        $first_datetime = reset($times);
1702
-        // do we get related tickets?
1703
-        if (
1704
-            $first_datetime instanceof EE_Datetime
1705
-            && $first_datetime->ID() !== 0
1706
-        ) {
1707
-            $existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1708
-            $template_args['time'] = $first_datetime;
1709
-            $related_tickets = $first_datetime->tickets(
1710
-                [
1711
-                    ['OR' => ['TKT_deleted' => 1, 'TKT_deleted*' => 0]],
1712
-                    'default_where_conditions' => 'none',
1713
-                ]
1714
-            );
1715
-            if (! empty($related_tickets)) {
1716
-                $template_args['total_ticket_rows'] = count($related_tickets);
1717
-                $row = 0;
1718
-                foreach ($related_tickets as $ticket) {
1719
-                    $existing_ticket_ids[] = $ticket->get('TKT_ID');
1720
-                    $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1721
-                    $row++;
1722
-                }
1723
-            } else {
1724
-                $template_args['total_ticket_rows'] = 1;
1725
-                /** @type EE_Ticket $ticket */
1726
-                $ticket = $this->ticketModel($event_timezone_string)->create_default_object();
1727
-                $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1728
-            }
1729
-        } else {
1730
-            $template_args['time'] = $times[0];
1731
-            /** @type EE_Ticket $ticket */
1732
-            $ticket = $this->ticketModel($event_timezone_string)->get_all_default_tickets();
1733
-            $template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]);
1734
-            // NOTE: we're just sending the first default row
1735
-            // (decaf can't manage default tickets so this should be sufficient);
1736
-        }
1737
-        $template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1738
-            'event_editor_event_datetimes_help_tab'
1739
-        );
1740
-        $template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1741
-        $template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1742
-        $template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1743
-        $template_args['ticket_js_structure'] = $this->_get_ticket_row(
1744
-            $this->ticketModel($event_timezone_string)->create_default_object(),
1745
-            true
1746
-        );
1747
-        $template = apply_filters(
1748
-            'FHEE__Events_Admin_Page__ticket_metabox__template',
1749
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1750
-        );
1751
-        EEH_Template::display_template($template, $template_args);
1752
-    }
1753
-
1754
-
1755
-    /**
1756
-     * Setup an individual ticket form for the decaf event editor page
1757
-     *
1758
-     * @access private
1759
-     * @param EE_Ticket $ticket   the ticket object
1760
-     * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1761
-     * @param int       $row
1762
-     * @return string generated html for the ticket row.
1763
-     * @throws DomainException
1764
-     * @throws EE_Error
1765
-     * @throws InvalidArgumentException
1766
-     * @throws InvalidDataTypeException
1767
-     * @throws InvalidInterfaceException
1768
-     * @throws ReflectionException
1769
-     */
1770
-    private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1771
-    {
1772
-        $template_args = [
1773
-            'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1774
-            'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1775
-                : '',
1776
-            'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1777
-            'TKT_ID'              => $ticket->get('TKT_ID'),
1778
-            'TKT_name'            => $ticket->get('TKT_name'),
1779
-            'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1780
-            'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1781
-            'TKT_is_default'      => $ticket->get('TKT_is_default'),
1782
-            'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1783
-            'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1784
-            'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1785
-            'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1786
-                                     && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1787
-                ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1788
-            'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1789
-                : ' disabled=disabled',
1790
-        ];
1791
-        $price = $ticket->ID() !== 0
1792
-            ? $ticket->get_first_related('Price', ['default_where_conditions' => 'none'])
1793
-            : EEM_Price::instance()->create_default_object();
1794
-        $price_args = [
1795
-            'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1796
-            'PRC_amount'            => $price->get('PRC_amount'),
1797
-            'PRT_ID'                => $price->get('PRT_ID'),
1798
-            'PRC_ID'                => $price->get('PRC_ID'),
1799
-            'PRC_is_default'        => $price->get('PRC_is_default'),
1800
-        ];
1801
-        // make sure we have default start and end dates if skeleton
1802
-        // handle rows that should NOT be empty
1803
-        if (empty($template_args['TKT_start_date'])) {
1804
-            // if empty then the start date will be now.
1805
-            $template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1806
-        }
1807
-        if (empty($template_args['TKT_end_date'])) {
1808
-            // get the earliest datetime (if present);
1809
-            $earliest_dtt = $this->_cpt_model_obj->ID() > 0
1810
-                ? $this->_cpt_model_obj->get_first_related(
1811
-                    'Datetime',
1812
-                    ['order_by' => ['DTT_EVT_start' => 'ASC']]
1813
-                )
1814
-                : null;
1815
-            if (! empty($earliest_dtt)) {
1816
-                $template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1817
-            } else {
1818
-                $template_args['TKT_end_date'] = date(
1819
-                    'Y-m-d h:i a',
1820
-                    mktime(0, 0, 0, date('m'), date('d') + 7, date('Y'))
1821
-                );
1822
-            }
1823
-        }
1824
-        $template_args = array_merge($template_args, $price_args);
1825
-        $template = apply_filters(
1826
-            'FHEE__Events_Admin_Page__get_ticket_row__template',
1827
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1828
-            $ticket
1829
-        );
1830
-        return EEH_Template::display_template($template, $template_args, true);
1831
-    }
1832
-
1833
-
1834
-    /**
1835
-     * @throws DomainException
1836
-     * @throws EE_Error
1837
-     */
1838
-    public function registration_options_meta_box()
1839
-    {
1840
-        $yes_no_values = [
1841
-            ['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
1842
-            ['id' => false, 'text' => esc_html__('No', 'event_espresso')],
1843
-        ];
1844
-        $default_reg_status_values = EEM_Registration::reg_status_array(
1845
-            [
1846
-                EEM_Registration::status_id_cancelled,
1847
-                EEM_Registration::status_id_declined,
1848
-                EEM_Registration::status_id_incomplete,
1849
-            ],
1850
-            true
1851
-        );
1852
-        // $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1853
-        $template_args['_event'] = $this->_cpt_model_obj;
1854
-        $template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1855
-        $template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1856
-        $template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1857
-            'default_reg_status',
1858
-            $default_reg_status_values,
1859
-            $this->_cpt_model_obj->default_registration_status()
1860
-        );
1861
-        $template_args['display_description'] = EEH_Form_Fields::select_input(
1862
-            'display_desc',
1863
-            $yes_no_values,
1864
-            $this->_cpt_model_obj->display_description()
1865
-        );
1866
-        $template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1867
-            'display_ticket_selector',
1868
-            $yes_no_values,
1869
-            $this->_cpt_model_obj->display_ticket_selector(),
1870
-            '',
1871
-            '',
1872
-            false
1873
-        );
1874
-        $template_args['additional_registration_options'] = apply_filters(
1875
-            'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1876
-            '',
1877
-            $template_args,
1878
-            $yes_no_values,
1879
-            $default_reg_status_values
1880
-        );
1881
-        EEH_Template::display_template(
1882
-            EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1883
-            $template_args
1884
-        );
1885
-    }
1886
-
1887
-
1888
-    /**
1889
-     * _get_events()
1890
-     * This method simply returns all the events (for the given _view and paging)
1891
-     *
1892
-     * @access public
1893
-     * @param int  $per_page     count of items per page (20 default);
1894
-     * @param int  $current_page what is the current page being viewed.
1895
-     * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1896
-     *                           If FALSE then we return an array of event objects
1897
-     *                           that match the given _view and paging parameters.
1898
-     * @return array an array of event objects.
1899
-     * @throws EE_Error
1900
-     * @throws InvalidArgumentException
1901
-     * @throws InvalidDataTypeException
1902
-     * @throws InvalidInterfaceException
1903
-     * @throws ReflectionException
1904
-     * @throws Exception
1905
-     * @throws Exception
1906
-     * @throws Exception
1907
-     */
1908
-    public function get_events($per_page = 10, $current_page = 1, $count = false)
1909
-    {
1910
-        $EEME = $this->eventModel();
1911
-        $offset = ($current_page - 1) * $per_page;
1912
-        $limit = $count ? null : $offset . ',' . $per_page;
1913
-        $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1914
-        $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1915
-        if (isset($this->_req_data['month_range'])) {
1916
-            $pieces = explode(' ', $this->_req_data['month_range'], 3);
1917
-            // simulate the FIRST day of the month, that fixes issues for months like February
1918
-            // where PHP doesn't know what to assume for date.
1919
-            // @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1920
-            $month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1921
-            $year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1922
-        }
1923
-        $where = [];
1924
-        $status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1925
-        // determine what post_status our condition will have for the query.
1926
-        switch ($status) {
1927
-            case 'month':
1928
-            case 'today':
1929
-            case null:
1930
-            case 'all':
1931
-                break;
1932
-            case 'draft':
1933
-                $where['status'] = ['IN', ['draft', 'auto-draft']];
1934
-                break;
1935
-            default:
1936
-                $where['status'] = $status;
1937
-        }
1938
-        // categories?
1939
-        $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1940
-            ? $this->_req_data['EVT_CAT'] : null;
1941
-        if (! empty($category)) {
1942
-            $where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1943
-            $where['Term_Taxonomy.term_id'] = $category;
1944
-        }
1945
-        // date where conditions
1946
-        $start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1947
-        if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1948
-            $DateTime = new DateTime(
1949
-                $year_r . '-' . $month_r . '-01 00:00:00',
1950
-                new DateTimeZone('UTC')
1951
-            );
1952
-            $start = $DateTime->getTimestamp();
1953
-            // set the datetime to be the end of the month
1954
-            $DateTime->setDate(
1955
-                $year_r,
1956
-                $month_r,
1957
-                $DateTime->format('t')
1958
-            )->setTime(23, 59, 59);
1959
-            $end = $DateTime->getTimestamp();
1960
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1961
-        } elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'today') {
1962
-            $DateTime = new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1963
-            $start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1964
-            $end = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1965
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1966
-        } elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'month') {
1967
-            $now = date('Y-m-01');
1968
-            $DateTime = new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1969
-            $start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1970
-            $end = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1971
-                            ->setTime(23, 59, 59)
1972
-                            ->format(implode(' ', $start_formats));
1973
-            $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1974
-        }
1975
-        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1976
-            $where['EVT_wp_user'] = get_current_user_id();
1977
-        } elseif (
1978
-            ! isset($where['status'])
1979
-                  && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1980
-        ) {
1981
-            $where['OR'] = [
1982
-                'status*restrict_private' => ['!=', 'private'],
1983
-                'AND'                     => [
1984
-                    'status*inclusive' => ['=', 'private'],
1985
-                    'EVT_wp_user'      => get_current_user_id(),
1986
-                ],
1987
-            ];
1988
-        }
1989
-
1990
-        if (
1991
-            isset($this->_req_data['EVT_wp_user'])
1992
-            && (int) $this->_req_data['EVT_wp_user'] !== (int) get_current_user_id()
1993
-            && EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1994
-        ) {
1995
-            $where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1996
-        }
1997
-        // search query handling
1998
-        if (isset($this->_req_data['s'])) {
1999
-            $search_string = '%' . $this->_req_data['s'] . '%';
2000
-            $where['OR'] = [
2001
-                'EVT_name'       => ['LIKE', $search_string],
2002
-                'EVT_desc'       => ['LIKE', $search_string],
2003
-                'EVT_short_desc' => ['LIKE', $search_string],
2004
-            ];
2005
-        }
2006
-        // filter events by venue.
2007
-        if (isset($this->_req_data['venue']) && ! empty($this->_req_data['venue'])) {
2008
-            $where['Venue.VNU_ID'] = absint($this->_req_data['venue']);
2009
-        }
2010
-        $where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
2011
-        $query_params = apply_filters(
2012
-            'FHEE__Events_Admin_Page__get_events__query_params',
2013
-            [
2014
-                $where,
2015
-                'limit'    => $limit,
2016
-                'order_by' => $orderby,
2017
-                'order'    => $order,
2018
-                'group_by' => 'EVT_ID',
2019
-            ],
2020
-            $this->_req_data
2021
-        );
2022
-
2023
-        // let's first check if we have special requests coming in.
2024
-        if (isset($this->_req_data['active_status'])) {
2025
-            switch ($this->_req_data['active_status']) {
2026
-                case 'upcoming':
2027
-                    return $EEME->get_upcoming_events($query_params, $count);
2028
-                    break;
2029
-                case 'expired':
2030
-                    return $EEME->get_expired_events($query_params, $count);
2031
-                    break;
2032
-                case 'active':
2033
-                    return $EEME->get_active_events($query_params, $count);
2034
-                    break;
2035
-                case 'inactive':
2036
-                    return $EEME->get_inactive_events($query_params, $count);
2037
-                    break;
2038
-            }
2039
-        }
2040
-
2041
-        $events = $count ? $EEME->count([$where], 'EVT_ID', true) : $EEME->get_all($query_params);
2042
-        return $events;
2043
-    }
2044
-
2045
-
2046
-    /**
2047
-     * handling for WordPress CPT actions (trash, restore, delete)
2048
-     *
2049
-     * @param string $post_id
2050
-     * @throws EE_Error
2051
-     * @throws InvalidArgumentException
2052
-     * @throws InvalidDataTypeException
2053
-     * @throws InvalidInterfaceException
2054
-     * @throws ReflectionException
2055
-     */
2056
-    public function trash_cpt_item($post_id)
2057
-    {
2058
-        $this->_req_data['EVT_ID'] = $post_id;
2059
-        $this->_trash_or_restore_event('trash', false);
2060
-    }
2061
-
2062
-
2063
-    /**
2064
-     * @param string $post_id
2065
-     * @throws EE_Error
2066
-     * @throws InvalidArgumentException
2067
-     * @throws InvalidDataTypeException
2068
-     * @throws InvalidInterfaceException
2069
-     * @throws ReflectionException
2070
-     */
2071
-    public function restore_cpt_item($post_id)
2072
-    {
2073
-        $this->_req_data['EVT_ID'] = $post_id;
2074
-        $this->_trash_or_restore_event('draft', false);
2075
-    }
2076
-
2077
-
2078
-    /**
2079
-     * @param string $post_id
2080
-     * @throws EE_Error
2081
-     * @throws InvalidArgumentException
2082
-     * @throws InvalidDataTypeException
2083
-     * @throws InvalidInterfaceException
2084
-     * @throws ReflectionException
2085
-     */
2086
-    public function delete_cpt_item($post_id)
2087
-    {
2088
-        $this->_req_data['EVT_ID'] = $post_id;
2089
-        $this->_delete_event(false);
2090
-    }
2091
-
2092
-
2093
-    /**
2094
-     * _trash_or_restore_event
2095
-     *
2096
-     * @access protected
2097
-     * @param string $event_status
2098
-     * @param bool   $redirect_after
2099
-     * @throws EE_Error
2100
-     * @throws InvalidArgumentException
2101
-     * @throws InvalidDataTypeException
2102
-     * @throws InvalidInterfaceException
2103
-     * @throws ReflectionException
2104
-     */
2105
-    protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2106
-    {
2107
-        // determine the event id and set to array.
2108
-        $EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : false;
2109
-        // loop thru events
2110
-        if ($EVT_ID) {
2111
-            // clean status
2112
-            $event_status = sanitize_key($event_status);
2113
-            // grab status
2114
-            if (! empty($event_status)) {
2115
-                $success = $this->_change_event_status($EVT_ID, $event_status);
2116
-            } else {
2117
-                $success = false;
2118
-                $msg = esc_html__(
2119
-                    'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2120
-                    'event_espresso'
2121
-                );
2122
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2123
-            }
2124
-        } else {
2125
-            $success = false;
2126
-            $msg = esc_html__(
2127
-                'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2128
-                'event_espresso'
2129
-            );
2130
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2131
-        }
2132
-        $action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2133
-        if ($redirect_after) {
2134
-            $this->_redirect_after_action($success, 'Event', $action, ['action' => 'default']);
2135
-        }
2136
-    }
2137
-
2138
-
2139
-    /**
2140
-     * _trash_or_restore_events
2141
-     *
2142
-     * @access protected
2143
-     * @param string $event_status
2144
-     * @return void
2145
-     * @throws EE_Error
2146
-     * @throws InvalidArgumentException
2147
-     * @throws InvalidDataTypeException
2148
-     * @throws InvalidInterfaceException
2149
-     * @throws ReflectionException
2150
-     */
2151
-    protected function _trash_or_restore_events($event_status = 'trash')
2152
-    {
2153
-        // clean status
2154
-        $event_status = sanitize_key($event_status);
2155
-        // grab status
2156
-        if (! empty($event_status)) {
2157
-            $success = true;
2158
-            // determine the event id and set to array.
2159
-            $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2160
-            // loop thru events
2161
-            foreach ($EVT_IDs as $EVT_ID) {
2162
-                if ($EVT_ID = absint($EVT_ID)) {
2163
-                    $results = $this->_change_event_status($EVT_ID, $event_status);
2164
-                    $success = $results !== false ? $success : false;
2165
-                } else {
2166
-                    $msg = sprintf(
2167
-                        esc_html__(
2168
-                            'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2169
-                            'event_espresso'
2170
-                        ),
2171
-                        $EVT_ID
2172
-                    );
2173
-                    EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2174
-                    $success = false;
2175
-                }
2176
-            }
2177
-        } else {
2178
-            $success = false;
2179
-            $msg = esc_html__(
2180
-                'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2181
-                'event_espresso'
2182
-            );
2183
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2184
-        }
2185
-        // in order to force a pluralized result message we need to send back a success status greater than 1
2186
-        $success = $success ? 2 : false;
2187
-        $action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2188
-        $this->_redirect_after_action($success, 'Events', $action, ['action' => 'default']);
2189
-    }
2190
-
2191
-
2192
-    /**
2193
-     * _trash_or_restore_events
2194
-     *
2195
-     * @access  private
2196
-     * @param int    $EVT_ID
2197
-     * @param string $event_status
2198
-     * @return bool
2199
-     * @throws EE_Error
2200
-     * @throws InvalidArgumentException
2201
-     * @throws InvalidDataTypeException
2202
-     * @throws InvalidInterfaceException
2203
-     * @throws ReflectionException
2204
-     */
2205
-    private function _change_event_status($EVT_ID = 0, $event_status = '')
2206
-    {
2207
-        // grab event id
2208
-        if (! $EVT_ID) {
2209
-            $msg = esc_html__(
2210
-                'An error occurred. No Event ID or an invalid Event ID was received.',
2211
-                'event_espresso'
2212
-            );
2213
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2214
-            return false;
2215
-        }
2216
-        $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2217
-        // clean status
2218
-        $event_status = sanitize_key($event_status);
2219
-        // grab status
2220
-        if (empty($event_status)) {
2221
-            $msg = esc_html__(
2222
-                'An error occurred. No Event Status or an invalid Event Status was received.',
2223
-                'event_espresso'
2224
-            );
2225
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2226
-            return false;
2227
-        }
2228
-        // was event trashed or restored ?
2229
-        switch ($event_status) {
2230
-            case 'draft':
2231
-                $action = 'restored from the trash';
2232
-                $hook = 'AHEE_event_restored_from_trash';
2233
-                break;
2234
-            case 'trash':
2235
-                $action = 'moved to the trash';
2236
-                $hook = 'AHEE_event_moved_to_trash';
2237
-                break;
2238
-            default:
2239
-                $action = 'updated';
2240
-                $hook = false;
2241
-        }
2242
-        // use class to change status
2243
-        $this->_cpt_model_obj->set_status($event_status);
2244
-        $success = $this->_cpt_model_obj->save();
2245
-        if ($success === false) {
2246
-            $msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2247
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2248
-            return false;
2249
-        }
2250
-        if ($hook) {
2251
-            do_action($hook);
2252
-        }
2253
-        return true;
2254
-    }
2255
-
2256
-
2257
-    /**
2258
-     * _delete_event
2259
-     *
2260
-     * @access protected
2261
-     * @param bool $redirect_after
2262
-     * @throws EE_Error
2263
-     * @throws InvalidArgumentException
2264
-     * @throws InvalidDataTypeException
2265
-     * @throws InvalidInterfaceException
2266
-     * @throws ReflectionException
2267
-     */
2268
-    protected function _delete_event($redirect_after = true)
2269
-    {
2270
-        // determine the event id and set to array.
2271
-        $EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : null;
2272
-        $EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
2273
-        // loop thru events
2274
-        if ($EVT_ID) {
2275
-            $success = $this->_permanently_delete_event($EVT_ID);
2276
-            // get list of events with no prices
2277
-            $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2278
-            // remove this event from the list of events with no prices
2279
-            if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2280
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2281
-            }
2282
-            update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2283
-        } else {
2284
-            $success = false;
2285
-            $msg = esc_html__(
2286
-                'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2287
-                'event_espresso'
2288
-            );
2289
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2290
-        }
2291
-        if ($redirect_after) {
2292
-            $this->_redirect_after_action(
2293
-                $success,
2294
-                'Event',
2295
-                'deleted',
2296
-                ['action' => 'default', 'status' => 'trash']
2297
-            );
2298
-        }
2299
-    }
2300
-
2301
-
2302
-    /**
2303
-     * _delete_events
2304
-     *
2305
-     * @access protected
2306
-     * @return void
2307
-     * @throws EE_Error
2308
-     * @throws InvalidArgumentException
2309
-     * @throws InvalidDataTypeException
2310
-     * @throws InvalidInterfaceException
2311
-     * @throws ReflectionException
2312
-     */
2313
-    protected function _delete_events()
2314
-    {
2315
-        $success = true;
2316
-        // get list of events with no prices
2317
-        $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2318
-        // determine the event id and set to array.
2319
-        $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2320
-        // loop thru events
2321
-        foreach ($EVT_IDs as $EVT_ID) {
2322
-            $EVT_ID = absint($EVT_ID);
2323
-            if ($EVT_ID) {
2324
-                $results = $this->_permanently_delete_event($EVT_ID);
2325
-                $success = $results !== false ? $success : false;
2326
-                // remove this event from the list of events with no prices
2327
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2328
-            } else {
2329
-                $success = false;
2330
-                $msg = esc_html__(
2331
-                    'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2332
-                    'event_espresso'
2333
-                );
2334
-                EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2335
-            }
2336
-        }
2337
-        update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2338
-        // in order to force a pluralized result message we need to send back a success status greater than 1
2339
-        $success = $success ? 2 : false;
2340
-        $this->_redirect_after_action($success, 'Events', 'deleted', ['action' => 'default']);
2341
-    }
2342
-
2343
-
2344
-    /**
2345
-     * _permanently_delete_event
2346
-     *
2347
-     * @access  private
2348
-     * @param int $EVT_ID
2349
-     * @return bool
2350
-     * @throws EE_Error
2351
-     * @throws InvalidArgumentException
2352
-     * @throws InvalidDataTypeException
2353
-     * @throws InvalidInterfaceException
2354
-     * @throws ReflectionException
2355
-     */
2356
-    private function _permanently_delete_event($EVT_ID = 0)
2357
-    {
2358
-        // grab event id
2359
-        if (! $EVT_ID) {
2360
-            $msg = esc_html__(
2361
-                'An error occurred. No Event ID or an invalid Event ID was received.',
2362
-                'event_espresso'
2363
-            );
2364
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2365
-            return false;
2366
-        }
2367
-        if (
2368
-            ! $this->_cpt_model_obj instanceof EE_Event
2369
-            || $this->_cpt_model_obj->ID() !== $EVT_ID
2370
-        ) {
2371
-            $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2372
-        }
2373
-        if (! $this->_cpt_model_obj instanceof EE_Event) {
2374
-            return false;
2375
-        }
2376
-        // need to delete related tickets and prices first.
2377
-        $datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
2378
-        foreach ($datetimes as $datetime) {
2379
-            $this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
2380
-            $tickets = $datetime->get_many_related('Ticket');
2381
-            foreach ($tickets as $ticket) {
2382
-                $ticket->_remove_relation_to($datetime, 'Datetime');
2383
-                $ticket->delete_related_permanently('Price');
2384
-                $ticket->delete_permanently();
2385
-            }
2386
-            $datetime->delete();
2387
-        }
2388
-        // what about related venues or terms?
2389
-        $venues = $this->_cpt_model_obj->get_many_related('Venue');
2390
-        foreach ($venues as $venue) {
2391
-            $this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
2392
-        }
2393
-        // any attached question groups?
2394
-        $question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2395
-        if (! empty($question_groups)) {
2396
-            foreach ($question_groups as $question_group) {
2397
-                $this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2398
-            }
2399
-        }
2400
-        // Message Template Groups
2401
-        $this->_cpt_model_obj->_remove_relations('Message_Template_Group');
2402
-        /** @type EE_Term_Taxonomy[] $term_taxonomies */
2403
-        $term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
2404
-        foreach ($term_taxonomies as $term_taxonomy) {
2405
-            $this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
2406
-        }
2407
-        $success = $this->_cpt_model_obj->delete_permanently();
2408
-        // did it all go as planned ?
2409
-        if ($success) {
2410
-            $msg = sprintf(esc_html__('Event ID # %d has been deleted.', 'event_espresso'), $EVT_ID);
2411
-            EE_Error::add_success($msg);
2412
-        } else {
2413
-            $msg = sprintf(
2414
-                esc_html__('An error occurred. Event ID # %d could not be deleted.', 'event_espresso'),
2415
-                $EVT_ID
2416
-            );
2417
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2418
-            return false;
2419
-        }
2420
-        do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID);
2421
-        return true;
2422
-    }
2423
-
2424
-
2425
-    /**
2426
-     * get total number of events
2427
-     *
2428
-     * @access public
2429
-     * @return int
2430
-     * @throws EE_Error
2431
-     * @throws InvalidArgumentException
2432
-     * @throws InvalidDataTypeException
2433
-     * @throws InvalidInterfaceException
2434
-     */
2435
-    public function total_events()
2436
-    {
2437
-        $count = EEM_Event::instance()->count(['caps' => 'read_admin'], 'EVT_ID', true);
2438
-        return $count;
2439
-    }
2440
-
2441
-
2442
-    /**
2443
-     * get total number of draft events
2444
-     *
2445
-     * @access public
2446
-     * @return int
2447
-     * @throws EE_Error
2448
-     * @throws InvalidArgumentException
2449
-     * @throws InvalidDataTypeException
2450
-     * @throws InvalidInterfaceException
2451
-     */
2452
-    public function total_events_draft()
2453
-    {
2454
-        $where = [
2455
-            'status' => ['IN', ['draft', 'auto-draft']],
2456
-        ];
2457
-        $count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2458
-        return $count;
2459
-    }
2460
-
2461
-
2462
-    /**
2463
-     * get total number of trashed events
2464
-     *
2465
-     * @access public
2466
-     * @return int
2467
-     * @throws EE_Error
2468
-     * @throws InvalidArgumentException
2469
-     * @throws InvalidDataTypeException
2470
-     * @throws InvalidInterfaceException
2471
-     */
2472
-    public function total_trashed_events()
2473
-    {
2474
-        $where = [
2475
-            'status' => 'trash',
2476
-        ];
2477
-        $count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2478
-        return $count;
2479
-    }
2480
-
2481
-
2482
-    /**
2483
-     *    _default_event_settings
2484
-     *    This generates the Default Settings Tab
2485
-     *
2486
-     * @return void
2487
-     * @throws DomainException
2488
-     * @throws EE_Error
2489
-     * @throws InvalidArgumentException
2490
-     * @throws InvalidDataTypeException
2491
-     * @throws InvalidInterfaceException
2492
-     */
2493
-    protected function _default_event_settings()
2494
-    {
2495
-        $this->_set_add_edit_form_tags('update_default_event_settings');
2496
-        $this->_set_publish_post_box_vars(null, false, false, null, false);
2497
-        $this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2498
-        $this->display_admin_page_with_sidebar();
2499
-    }
2500
-
2501
-
2502
-    /**
2503
-     * Return the form for event settings.
2504
-     *
2505
-     * @return EE_Form_Section_Proper
2506
-     * @throws EE_Error
2507
-     */
2508
-    protected function _default_event_settings_form()
2509
-    {
2510
-        $registration_config = EE_Registry::instance()->CFG->registration;
2511
-        $registration_stati_for_selection = EEM_Registration::reg_status_array(
2512
-        // exclude
2513
-            [
2514
-                EEM_Registration::status_id_cancelled,
2515
-                EEM_Registration::status_id_declined,
2516
-                EEM_Registration::status_id_incomplete,
2517
-                EEM_Registration::status_id_wait_list,
2518
-            ],
2519
-            true
2520
-        );
2521
-        return new EE_Form_Section_Proper(
2522
-            [
2523
-                'name'            => 'update_default_event_settings',
2524
-                'html_id'         => 'update_default_event_settings',
2525
-                'html_class'      => 'form-table',
2526
-                'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2527
-                'subsections'     => apply_filters(
2528
-                    'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2529
-                    [
2530
-                        'default_reg_status'  => new EE_Select_Input(
2531
-                            $registration_stati_for_selection,
2532
-                            [
2533
-                                'default'         => isset($registration_config->default_STS_ID)
2534
-                                                     && array_key_exists(
2535
-                                                         $registration_config->default_STS_ID,
2536
-                                                         $registration_stati_for_selection
2537
-                                                     )
2538
-                                    ? sanitize_text_field($registration_config->default_STS_ID)
2539
-                                    : EEM_Registration::status_id_pending_payment,
2540
-                                'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2541
-                                                     . EEH_Template::get_help_tab_link(
2542
-                                                         'default_settings_status_help_tab'
2543
-                                                     ),
2544
-                                'html_help_text'  => esc_html__(
2545
-                                    'This setting allows you to preselect what the default registration status setting is when creating an event.  Note that changing this setting does NOT retroactively apply it to existing events.',
2546
-                                    'event_espresso'
2547
-                                ),
2548
-                            ]
2549
-                        ),
2550
-                        'default_max_tickets' => new EE_Integer_Input(
2551
-                            [
2552
-                                'default'         => isset($registration_config->default_maximum_number_of_tickets)
2553
-                                    ? $registration_config->default_maximum_number_of_tickets
2554
-                                    : EEM_Event::get_default_additional_limit(),
2555
-                                'html_label_text' => esc_html__(
2556
-                                    'Default Maximum Tickets Allowed Per Order:',
2557
-                                    'event_espresso'
2558
-                                )
2559
-                                                     . EEH_Template::get_help_tab_link(
2560
-                                                         'default_maximum_tickets_help_tab"'
2561
-                                                     ),
2562
-                                'html_help_text'  => esc_html__(
2563
-                                    'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2564
-                                    'event_espresso'
2565
-                                ),
2566
-                            ]
2567
-                        ),
2568
-                    ]
2569
-                ),
2570
-            ]
2571
-        );
2572
-    }
2573
-
2574
-
2575
-    /**
2576
-     * @return void
2577
-     * @throws EE_Error
2578
-     * @throws InvalidArgumentException
2579
-     * @throws InvalidDataTypeException
2580
-     * @throws InvalidInterfaceException
2581
-     */
2582
-    protected function _update_default_event_settings()
2583
-    {
2584
-        $form = $this->_default_event_settings_form();
2585
-        if ($form->was_submitted()) {
2586
-            $form->receive_form_submission();
2587
-            if ($form->is_valid()) {
2588
-                $registration_config = EE_Registry::instance()->CFG->registration;
2589
-                $valid_data = $form->valid_data();
2590
-                if (isset($valid_data['default_reg_status'])) {
2591
-                    $registration_config->default_STS_ID = $valid_data['default_reg_status'];
2592
-                }
2593
-                if (isset($valid_data['default_max_tickets'])) {
2594
-                    $registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2595
-                }
2596
-                do_action(
2597
-                    'AHEE__Events_Admin_Page___update_default_event_settings',
2598
-                    $valid_data,
2599
-                    EE_Registry::instance()->CFG,
2600
-                    $this
2601
-                );
2602
-                // update because data was valid!
2603
-                EE_Registry::instance()->CFG->update_espresso_config();
2604
-                EE_Error::overwrite_success();
2605
-                EE_Error::add_success(
2606
-                    __('Default Event Settings were updated', 'event_espresso')
2607
-                );
2608
-            }
2609
-        }
2610
-        $this->_redirect_after_action(0, '', '', ['action' => 'default_event_settings'], true);
2611
-    }
2612
-
2613
-
2614
-    /*************        Templates        *************/
2615
-    protected function _template_settings()
2616
-    {
2617
-        $this->_admin_page_title = esc_html__('Template Settings (Preview)', 'event_espresso');
2618
-        $this->_template_args['preview_img'] = '<img src="'
2619
-                                               . EVENTS_ASSETS_URL
2620
-                                               . '/images/'
2621
-                                               . 'caffeinated_template_features.jpg" alt="'
2622
-                                               . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2623
-                                               . '" />';
2624
-        $this->_template_args['preview_text'] = '<strong>'
2625
-                                                . esc_html__(
2626
-                                                    'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2627
-                                                    'event_espresso'
2628
-                                                ) . '</strong>';
2629
-        $this->display_admin_caf_preview_page('template_settings_tab');
2630
-    }
2631
-
2632
-
2633
-    /** Event Category Stuff **/
2634
-    /**
2635
-     * set the _category property with the category object for the loaded page.
2636
-     *
2637
-     * @access private
2638
-     * @return void
2639
-     */
2640
-    private function _set_category_object()
2641
-    {
2642
-        if (isset($this->_category->id) && ! empty($this->_category->id)) {
2643
-            return;
2644
-        } //already have the category object so get out.
2645
-        // set default category object
2646
-        $this->_set_empty_category_object();
2647
-        // only set if we've got an id
2648
-        if (! isset($this->_req_data['EVT_CAT_ID'])) {
2649
-            return;
2650
-        }
2651
-        $category_id = absint($this->_req_data['EVT_CAT_ID']);
2652
-        $term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2653
-        if (! empty($term)) {
2654
-            $this->_category->category_name = $term->name;
2655
-            $this->_category->category_identifier = $term->slug;
2656
-            $this->_category->category_desc = $term->description;
2657
-            $this->_category->id = $term->term_id;
2658
-            $this->_category->parent = $term->parent;
2659
-        }
2660
-    }
2661
-
2662
-
2663
-    /**
2664
-     * Clears out category properties.
2665
-     */
2666
-    private function _set_empty_category_object()
2667
-    {
2668
-        $this->_category = new stdClass();
2669
-        $this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2670
-        $this->_category->id = $this->_category->parent = 0;
2671
-    }
2672
-
2673
-
2674
-    /**
2675
-     * @throws DomainException
2676
-     * @throws EE_Error
2677
-     * @throws InvalidArgumentException
2678
-     * @throws InvalidDataTypeException
2679
-     * @throws InvalidInterfaceException
2680
-     */
2681
-    protected function _category_list_table()
2682
-    {
2683
-        do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2684
-        $this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2685
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2686
-            'add_category',
2687
-            'add_category',
2688
-            [],
2689
-            'add-new-h2'
2690
-        );
2691
-        $this->display_admin_list_table_page_with_sidebar();
2692
-    }
2693
-
2694
-
2695
-    /**
2696
-     * Output category details view.
2697
-     *
2698
-     * @param string $view
2699
-     * @throws DomainException
2700
-     * @throws EE_Error
2701
-     * @throws InvalidArgumentException
2702
-     * @throws InvalidDataTypeException
2703
-     * @throws InvalidInterfaceException
2704
-     */
2705
-    protected function _category_details($view)
2706
-    {
2707
-        // load formatter helper
2708
-        // load field generator helper
2709
-        $route = $view === 'edit' ? 'update_category' : 'insert_category';
2710
-        $this->_set_add_edit_form_tags($route);
2711
-        $this->_set_category_object();
2712
-        $id = ! empty($this->_category->id) ? $this->_category->id : '';
2713
-        $delete_action = 'delete_category';
2714
-        // custom redirect
2715
-        $redirect = EE_Admin_Page::add_query_args_and_nonce(
2716
-            ['action' => 'category_list'],
2717
-            $this->_admin_base_url
2718
-        );
2719
-        $this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2720
-        // take care of contents
2721
-        $this->_template_args['admin_page_content'] = $this->_category_details_content();
2722
-        $this->display_admin_page_with_sidebar();
2723
-    }
2724
-
2725
-
2726
-    /**
2727
-     * Output category details content.
2728
-     *
2729
-     * @throws DomainException
2730
-     */
2731
-    protected function _category_details_content()
2732
-    {
2733
-        $editor_args['category_desc'] = [
2734
-            'type'          => 'wp_editor',
2735
-            'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2736
-            'class'         => 'my_editor_custom',
2737
-            'wpeditor_args' => ['media_buttons' => false],
2738
-        ];
2739
-        $_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2740
-        $all_terms = get_terms(
2741
-            [EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY],
2742
-            ['hide_empty' => 0, 'exclude' => [$this->_category->id]]
2743
-        );
2744
-        // setup category select for term parents.
2745
-        $category_select_values[] = [
2746
-            'text' => esc_html__('No Parent', 'event_espresso'),
2747
-            'id'   => 0,
2748
-        ];
2749
-        foreach ($all_terms as $term) {
2750
-            $category_select_values[] = [
2751
-                'text' => $term->name,
2752
-                'id'   => $term->term_id,
2753
-            ];
2754
-        }
2755
-        $category_select = EEH_Form_Fields::select_input(
2756
-            'category_parent',
2757
-            $category_select_values,
2758
-            $this->_category->parent
2759
-        );
2760
-        $template_args = [
2761
-            'category'                 => $this->_category,
2762
-            'category_select'          => $category_select,
2763
-            'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2764
-            'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2765
-            'disable'                  => '',
2766
-            'disabled_message'         => false,
2767
-        ];
2768
-        $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2769
-        return EEH_Template::display_template($template, $template_args, true);
2770
-    }
2771
-
2772
-
2773
-    /**
2774
-     * Handles deleting categories.
2775
-     */
2776
-    protected function _delete_categories()
2777
-    {
2778
-        $cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID']
2779
-            : (array) $this->_req_data['category_id'];
2780
-        foreach ($cat_ids as $cat_id) {
2781
-            $this->_delete_category($cat_id);
2782
-        }
2783
-        // doesn't matter what page we're coming from... we're going to the same place after delete.
2784
-        $query_args = [
2785
-            'action' => 'category_list',
2786
-        ];
2787
-        $this->_redirect_after_action(0, '', '', $query_args);
2788
-    }
2789
-
2790
-
2791
-    /**
2792
-     * Handles deleting specific category.
2793
-     *
2794
-     * @param int $cat_id
2795
-     */
2796
-    protected function _delete_category($cat_id)
2797
-    {
2798
-        $cat_id = absint($cat_id);
2799
-        wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2800
-    }
2801
-
2802
-
2803
-    /**
2804
-     * Handles triggering the update or insertion of a new category.
2805
-     *
2806
-     * @param bool $new_category true means we're triggering the insert of a new category.
2807
-     * @throws EE_Error
2808
-     * @throws InvalidArgumentException
2809
-     * @throws InvalidDataTypeException
2810
-     * @throws InvalidInterfaceException
2811
-     */
2812
-    protected function _insert_or_update_category($new_category)
2813
-    {
2814
-        $cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2815
-        $success = 0; // we already have a success message so lets not send another.
2816
-        if ($cat_id) {
2817
-            $query_args = [
2818
-                'action'     => 'edit_category',
2819
-                'EVT_CAT_ID' => $cat_id,
2820
-            ];
2821
-        } else {
2822
-            $query_args = ['action' => 'add_category'];
2823
-        }
2824
-        $this->_redirect_after_action($success, '', '', $query_args, true);
2825
-    }
2826
-
2827
-
2828
-    /**
2829
-     * Inserts or updates category
2830
-     *
2831
-     * @param bool $update (true indicates we're updating a category).
2832
-     * @return bool|mixed|string
2833
-     */
2834
-    private function _insert_category($update = false)
2835
-    {
2836
-        $cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2837
-        $category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2838
-        $category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2839
-        $category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2840
-        if (empty($category_name)) {
2841
-            $msg = esc_html__('You must add a name for the category.', 'event_espresso');
2842
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2843
-            return false;
2844
-        }
2845
-        $term_args = [
2846
-            'name'        => $category_name,
2847
-            'description' => $category_desc,
2848
-            'parent'      => $category_parent,
2849
-        ];
2850
-        // was the category_identifier input disabled?
2851
-        if (isset($this->_req_data['category_identifier'])) {
2852
-            $term_args['slug'] = $this->_req_data['category_identifier'];
2853
-        }
2854
-        $insert_ids = $update
2855
-            ? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2856
-            : wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2857
-        if (! is_array($insert_ids)) {
2858
-            $msg = esc_html__(
2859
-                'An error occurred and the category has not been saved to the database.',
2860
-                'event_espresso'
2861
-            );
2862
-            EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2863
-        } else {
2864
-            $cat_id = $insert_ids['term_id'];
2865
-            $msg = sprintf(esc_html__('The category %s was successfully saved', 'event_espresso'), $category_name);
2866
-            EE_Error::add_success($msg);
2867
-        }
2868
-        return $cat_id;
2869
-    }
2870
-
2871
-
2872
-    /**
2873
-     * Gets categories or count of categories matching the arguments in the request.
2874
-     *
2875
-     * @param int  $per_page
2876
-     * @param int  $current_page
2877
-     * @param bool $count
2878
-     * @return EE_Base_Class[]|EE_Term_Taxonomy[]|int
2879
-     * @throws EE_Error
2880
-     * @throws InvalidArgumentException
2881
-     * @throws InvalidDataTypeException
2882
-     * @throws InvalidInterfaceException
2883
-     */
2884
-    public function get_categories($per_page = 10, $current_page = 1, $count = false)
2885
-    {
2886
-        // testing term stuff
2887
-        $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2888
-        $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2889
-        $limit = ($current_page - 1) * $per_page;
2890
-        $where = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2891
-        if (isset($this->_req_data['s'])) {
2892
-            $sstr = '%' . $this->_req_data['s'] . '%';
2893
-            $where['OR'] = [
2894
-                'Term.name'   => ['LIKE', $sstr],
2895
-                'description' => ['LIKE', $sstr],
2896
-            ];
2897
-        }
2898
-        $query_params = [
2899
-            $where,
2900
-            'order_by'   => [$orderby => $order],
2901
-            'limit'      => $limit . ',' . $per_page,
2902
-            'force_join' => ['Term'],
2903
-        ];
2904
-        $categories = $count
2905
-            ? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2906
-            : EEM_Term_Taxonomy::instance()->get_all($query_params);
2907
-        return $categories;
2908
-    }
2909
-
2910
-    /* end category stuff */
2911
-    /**************/
2912
-
2913
-
2914
-    /**
2915
-     * Callback for the `ee_save_timezone_setting` ajax action.
2916
-     *
2917
-     * @throws EE_Error
2918
-     * @throws InvalidArgumentException
2919
-     * @throws InvalidDataTypeException
2920
-     * @throws InvalidInterfaceException
2921
-     */
2922
-    public function save_timezonestring_setting()
2923
-    {
2924
-        $timezone_string = isset($this->_req_data['timezone_selected'])
2925
-            ? $this->_req_data['timezone_selected']
2926
-            : '';
2927
-        if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2928
-            EE_Error::add_error(
2929
-                esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2930
-                __FILE__,
2931
-                __FUNCTION__,
2932
-                __LINE__
2933
-            );
2934
-            $this->_template_args['error'] = true;
2935
-            $this->_return_json();
2936
-        }
2937
-
2938
-        update_option('timezone_string', $timezone_string);
2939
-        EE_Error::add_success(
2940
-            esc_html__('Your timezone string was updated.', 'event_espresso')
2941
-        );
2942
-        $this->_template_args['success'] = true;
2943
-        $this->_return_json(true, ['action' => 'create_new']);
2944
-    }
19
+	/**
20
+	 * This will hold the event object for event_details screen.
21
+	 *
22
+	 * @access protected
23
+	 * @var EE_Event $_event
24
+	 */
25
+	protected $_event;
26
+
27
+
28
+	/**
29
+	 * This will hold the category object for category_details screen.
30
+	 *
31
+	 * @var stdClass $_category
32
+	 */
33
+	protected $_category;
34
+
35
+
36
+	/**
37
+	 * @var EEM_Event $_event_model
38
+	 */
39
+	protected $_event_model;
40
+
41
+	/**
42
+	 * @var EEM_Datetime $datetime_model
43
+	 */
44
+	protected $datetime_model;
45
+
46
+	/**
47
+	 * @var EEM_Ticket $ticket_model
48
+	 */
49
+	protected $ticket_model;
50
+
51
+
52
+	/**
53
+	 * @var EE_Event
54
+	 */
55
+	protected $_cpt_model_obj;
56
+
57
+
58
+	/**
59
+	 * Initialize page props for this admin page group.
60
+	 */
61
+	protected function _init_page_props()
62
+	{
63
+		$this->page_slug = EVENTS_PG_SLUG;
64
+		$this->page_label = EVENTS_LABEL;
65
+		$this->_admin_base_url = EVENTS_ADMIN_URL;
66
+		$this->_admin_base_path = EVENTS_ADMIN;
67
+		$this->_cpt_model_names = [
68
+			'create_new' => 'EEM_Event',
69
+			'edit'       => 'EEM_Event',
70
+		];
71
+		$this->_cpt_edit_routes = [
72
+			'espresso_events' => 'edit',
73
+		];
74
+		add_action(
75
+			'AHEE__EE_Admin_Page_CPT__set_model_object__after_set_object',
76
+			[$this, 'verify_event_edit'],
77
+			10,
78
+			2
79
+		);
80
+	}
81
+
82
+
83
+	/**
84
+	 * Sets the ajax hooks used for this admin page group.
85
+	 */
86
+	protected function _ajax_hooks()
87
+	{
88
+		add_action('wp_ajax_ee_save_timezone_setting', [$this, 'save_timezonestring_setting']);
89
+	}
90
+
91
+
92
+	/**
93
+	 * Sets the page properties for this admin page group.
94
+	 */
95
+	protected function _define_page_props()
96
+	{
97
+		$this->_admin_page_title = EVENTS_LABEL;
98
+		$this->_labels = [
99
+			'buttons'      => [
100
+				'add'             => esc_html__('Add New Event', 'event_espresso'),
101
+				'edit'            => esc_html__('Edit Event', 'event_espresso'),
102
+				'delete'          => esc_html__('Delete Event', 'event_espresso'),
103
+				'add_category'    => esc_html__('Add New Category', 'event_espresso'),
104
+				'edit_category'   => esc_html__('Edit Category', 'event_espresso'),
105
+				'delete_category' => esc_html__('Delete Category', 'event_espresso'),
106
+			],
107
+			'editor_title' => [
108
+				'espresso_events' => esc_html__('Enter event title here', 'event_espresso'),
109
+			],
110
+			'publishbox'   => [
111
+				'create_new'        => esc_html__('Save New Event', 'event_espresso'),
112
+				'edit'              => esc_html__('Update Event', 'event_espresso'),
113
+				'add_category'      => esc_html__('Save New Category', 'event_espresso'),
114
+				'edit_category'     => esc_html__('Update Category', 'event_espresso'),
115
+				'template_settings' => esc_html__('Update Settings', 'event_espresso'),
116
+			],
117
+		];
118
+	}
119
+
120
+
121
+	/**
122
+	 * Sets the page routes property for this admin page group.
123
+	 */
124
+	protected function _set_page_routes()
125
+	{
126
+		// load formatter helper
127
+		// load field generator helper
128
+		// is there a evt_id in the request?
129
+		$evt_id = ! empty($this->_req_data['EVT_ID']) && ! is_array($this->_req_data['EVT_ID'])
130
+			? $this->_req_data['EVT_ID']
131
+			: 0;
132
+		$evt_id = ! empty($this->_req_data['post']) ? $this->_req_data['post'] : $evt_id;
133
+		$this->_page_routes = [
134
+			'default'                       => [
135
+				'func'       => '_events_overview_list_table',
136
+				'capability' => 'ee_read_events',
137
+			],
138
+			'create_new'                    => [
139
+				'func'       => '_create_new_cpt_item',
140
+				'capability' => 'ee_edit_events',
141
+			],
142
+			'edit'                          => [
143
+				'func'       => '_edit_cpt_item',
144
+				'capability' => 'ee_edit_event',
145
+				'obj_id'     => $evt_id,
146
+			],
147
+			'copy_event'                    => [
148
+				'func'       => '_copy_events',
149
+				'capability' => 'ee_edit_event',
150
+				'obj_id'     => $evt_id,
151
+				'noheader'   => true,
152
+			],
153
+			'trash_event'                   => [
154
+				'func'       => '_trash_or_restore_event',
155
+				'args'       => ['event_status' => 'trash'],
156
+				'capability' => 'ee_delete_event',
157
+				'obj_id'     => $evt_id,
158
+				'noheader'   => true,
159
+			],
160
+			'trash_events'                  => [
161
+				'func'       => '_trash_or_restore_events',
162
+				'args'       => ['event_status' => 'trash'],
163
+				'capability' => 'ee_delete_events',
164
+				'noheader'   => true,
165
+			],
166
+			'restore_event'                 => [
167
+				'func'       => '_trash_or_restore_event',
168
+				'args'       => ['event_status' => 'draft'],
169
+				'capability' => 'ee_delete_event',
170
+				'obj_id'     => $evt_id,
171
+				'noheader'   => true,
172
+			],
173
+			'restore_events'                => [
174
+				'func'       => '_trash_or_restore_events',
175
+				'args'       => ['event_status' => 'draft'],
176
+				'capability' => 'ee_delete_events',
177
+				'noheader'   => true,
178
+			],
179
+			'delete_event'                  => [
180
+				'func'       => '_delete_event',
181
+				'capability' => 'ee_delete_event',
182
+				'obj_id'     => $evt_id,
183
+				'noheader'   => true,
184
+			],
185
+			'delete_events'                 => [
186
+				'func'       => '_delete_events',
187
+				'capability' => 'ee_delete_events',
188
+				'noheader'   => true,
189
+			],
190
+			'view_report'                   => [
191
+				'func'       => '_view_report',
192
+				'capability' => 'ee_edit_events',
193
+			],
194
+			'default_event_settings'        => [
195
+				'func'       => '_default_event_settings',
196
+				'capability' => 'manage_options',
197
+			],
198
+			'update_default_event_settings' => [
199
+				'func'       => '_update_default_event_settings',
200
+				'capability' => 'manage_options',
201
+				'noheader'   => true,
202
+			],
203
+			'template_settings'             => [
204
+				'func'       => '_template_settings',
205
+				'capability' => 'manage_options',
206
+			],
207
+			// event category tab related
208
+			'add_category'                  => [
209
+				'func'       => '_category_details',
210
+				'capability' => 'ee_edit_event_category',
211
+				'args'       => ['add'],
212
+			],
213
+			'edit_category'                 => [
214
+				'func'       => '_category_details',
215
+				'capability' => 'ee_edit_event_category',
216
+				'args'       => ['edit'],
217
+			],
218
+			'delete_categories'             => [
219
+				'func'       => '_delete_categories',
220
+				'capability' => 'ee_delete_event_category',
221
+				'noheader'   => true,
222
+			],
223
+			'delete_category'               => [
224
+				'func'       => '_delete_categories',
225
+				'capability' => 'ee_delete_event_category',
226
+				'noheader'   => true,
227
+			],
228
+			'insert_category'               => [
229
+				'func'       => '_insert_or_update_category',
230
+				'args'       => ['new_category' => true],
231
+				'capability' => 'ee_edit_event_category',
232
+				'noheader'   => true,
233
+			],
234
+			'update_category'               => [
235
+				'func'       => '_insert_or_update_category',
236
+				'args'       => ['new_category' => false],
237
+				'capability' => 'ee_edit_event_category',
238
+				'noheader'   => true,
239
+			],
240
+			'category_list'                 => [
241
+				'func'       => '_category_list_table',
242
+				'capability' => 'ee_manage_event_categories',
243
+			],
244
+		];
245
+	}
246
+
247
+
248
+	/**
249
+	 * Set the _page_config property for this admin page group.
250
+	 */
251
+	protected function _set_page_config()
252
+	{
253
+		$this->_page_config = [
254
+			'default'                => [
255
+				'nav'           => [
256
+					'label' => esc_html__('Overview', 'event_espresso'),
257
+					'order' => 10,
258
+				],
259
+				'list_table'    => 'Events_Admin_List_Table',
260
+				'help_tabs'     => [
261
+					'events_overview_help_tab'                       => [
262
+						'title'    => esc_html__('Events Overview', 'event_espresso'),
263
+						'filename' => 'events_overview',
264
+					],
265
+					'events_overview_table_column_headings_help_tab' => [
266
+						'title'    => esc_html__('Events Overview Table Column Headings', 'event_espresso'),
267
+						'filename' => 'events_overview_table_column_headings',
268
+					],
269
+					'events_overview_filters_help_tab'               => [
270
+						'title'    => esc_html__('Events Overview Filters', 'event_espresso'),
271
+						'filename' => 'events_overview_filters',
272
+					],
273
+					'events_overview_view_help_tab'                  => [
274
+						'title'    => esc_html__('Events Overview Views', 'event_espresso'),
275
+						'filename' => 'events_overview_views',
276
+					],
277
+					'events_overview_other_help_tab'                 => [
278
+						'title'    => esc_html__('Events Overview Other', 'event_espresso'),
279
+						'filename' => 'events_overview_other',
280
+					],
281
+				],
282
+				'help_tour'     => [
283
+					'Event_Overview_Help_Tour',
284
+					// 'New_Features_Test_Help_Tour' for testing multiple help tour
285
+				],
286
+				'require_nonce' => false,
287
+				'qtips'         => ['EE_Event_List_Table_Tips'],
288
+			],
289
+			'create_new'             => [
290
+				'nav'           => [
291
+					'label'      => esc_html__('Add Event', 'event_espresso'),
292
+					'order'      => 5,
293
+					'persistent' => false,
294
+				],
295
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
296
+				'help_tabs'     => [
297
+					'event_editor_help_tab'                            => [
298
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
299
+						'filename' => 'event_editor',
300
+					],
301
+					'event_editor_title_richtexteditor_help_tab'       => [
302
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
303
+						'filename' => 'event_editor_title_richtexteditor',
304
+					],
305
+					'event_editor_venue_details_help_tab'              => [
306
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
307
+						'filename' => 'event_editor_venue_details',
308
+					],
309
+					'event_editor_event_datetimes_help_tab'            => [
310
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
311
+						'filename' => 'event_editor_event_datetimes',
312
+					],
313
+					'event_editor_event_tickets_help_tab'              => [
314
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
315
+						'filename' => 'event_editor_event_tickets',
316
+					],
317
+					'event_editor_event_registration_options_help_tab' => [
318
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
319
+						'filename' => 'event_editor_event_registration_options',
320
+					],
321
+					'event_editor_tags_categories_help_tab'            => [
322
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
323
+						'filename' => 'event_editor_tags_categories',
324
+					],
325
+					'event_editor_questions_registrants_help_tab'      => [
326
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
327
+						'filename' => 'event_editor_questions_registrants',
328
+					],
329
+					'event_editor_save_new_event_help_tab'             => [
330
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
331
+						'filename' => 'event_editor_save_new_event',
332
+					],
333
+					'event_editor_other_help_tab'                      => [
334
+						'title'    => esc_html__('Event Other', 'event_espresso'),
335
+						'filename' => 'event_editor_other',
336
+					],
337
+				],
338
+				'help_tour'     => [
339
+					'Event_Editor_Help_Tour',
340
+				],
341
+				'require_nonce' => false,
342
+			],
343
+			'edit'                   => [
344
+				'nav'           => [
345
+					'label'      => esc_html__('Edit Event', 'event_espresso'),
346
+					'order'      => 5,
347
+					'persistent' => false,
348
+					'url'        => isset($this->_req_data['post'])
349
+						? EE_Admin_Page::add_query_args_and_nonce(
350
+							['post' => $this->_req_data['post'], 'action' => 'edit'],
351
+							$this->_current_page_view_url
352
+						)
353
+						: $this->_admin_base_url,
354
+				],
355
+				'metaboxes'     => ['_register_event_editor_meta_boxes'],
356
+				'help_tabs'     => [
357
+					'event_editor_help_tab'                            => [
358
+						'title'    => esc_html__('Event Editor', 'event_espresso'),
359
+						'filename' => 'event_editor',
360
+					],
361
+					'event_editor_title_richtexteditor_help_tab'       => [
362
+						'title'    => esc_html__('Event Title & Rich Text Editor', 'event_espresso'),
363
+						'filename' => 'event_editor_title_richtexteditor',
364
+					],
365
+					'event_editor_venue_details_help_tab'              => [
366
+						'title'    => esc_html__('Event Venue Details', 'event_espresso'),
367
+						'filename' => 'event_editor_venue_details',
368
+					],
369
+					'event_editor_event_datetimes_help_tab'            => [
370
+						'title'    => esc_html__('Event Datetimes', 'event_espresso'),
371
+						'filename' => 'event_editor_event_datetimes',
372
+					],
373
+					'event_editor_event_tickets_help_tab'              => [
374
+						'title'    => esc_html__('Event Tickets', 'event_espresso'),
375
+						'filename' => 'event_editor_event_tickets',
376
+					],
377
+					'event_editor_event_registration_options_help_tab' => [
378
+						'title'    => esc_html__('Event Registration Options', 'event_espresso'),
379
+						'filename' => 'event_editor_event_registration_options',
380
+					],
381
+					'event_editor_tags_categories_help_tab'            => [
382
+						'title'    => esc_html__('Event Tags & Categories', 'event_espresso'),
383
+						'filename' => 'event_editor_tags_categories',
384
+					],
385
+					'event_editor_questions_registrants_help_tab'      => [
386
+						'title'    => esc_html__('Questions for Registrants', 'event_espresso'),
387
+						'filename' => 'event_editor_questions_registrants',
388
+					],
389
+					'event_editor_save_new_event_help_tab'             => [
390
+						'title'    => esc_html__('Save New Event', 'event_espresso'),
391
+						'filename' => 'event_editor_save_new_event',
392
+					],
393
+					'event_editor_other_help_tab'                      => [
394
+						'title'    => esc_html__('Event Other', 'event_espresso'),
395
+						'filename' => 'event_editor_other',
396
+					],
397
+				],
398
+				'require_nonce' => false,
399
+			],
400
+			'default_event_settings' => [
401
+				'nav'           => [
402
+					'label' => esc_html__('Default Settings', 'event_espresso'),
403
+					'order' => 40,
404
+				],
405
+				'metaboxes'     => array_merge($this->_default_espresso_metaboxes, ['_publish_post_box']),
406
+				'labels'        => [
407
+					'publishbox' => esc_html__('Update Settings', 'event_espresso'),
408
+				],
409
+				'help_tabs'     => [
410
+					'default_settings_help_tab'        => [
411
+						'title'    => esc_html__('Default Event Settings', 'event_espresso'),
412
+						'filename' => 'events_default_settings',
413
+					],
414
+					'default_settings_status_help_tab' => [
415
+						'title'    => esc_html__('Default Registration Status', 'event_espresso'),
416
+						'filename' => 'events_default_settings_status',
417
+					],
418
+					'default_maximum_tickets_help_tab' => [
419
+						'title'    => esc_html__('Default Maximum Tickets Per Order', 'event_espresso'),
420
+						'filename' => 'events_default_settings_max_tickets',
421
+					],
422
+				],
423
+				'help_tour'     => ['Event_Default_Settings_Help_Tour'],
424
+				'require_nonce' => false,
425
+			],
426
+			// template settings
427
+			'template_settings'      => [
428
+				'nav'           => [
429
+					'label' => esc_html__('Templates', 'event_espresso'),
430
+					'order' => 30,
431
+				],
432
+				'metaboxes'     => $this->_default_espresso_metaboxes,
433
+				'help_tabs'     => [
434
+					'general_settings_templates_help_tab' => [
435
+						'title'    => esc_html__('Templates', 'event_espresso'),
436
+						'filename' => 'general_settings_templates',
437
+					],
438
+				],
439
+				'help_tour'     => ['Templates_Help_Tour'],
440
+				'require_nonce' => false,
441
+			],
442
+			// event category stuff
443
+			'add_category'           => [
444
+				'nav'           => [
445
+					'label'      => esc_html__('Add Category', 'event_espresso'),
446
+					'order'      => 15,
447
+					'persistent' => false,
448
+				],
449
+				'help_tabs'     => [
450
+					'add_category_help_tab' => [
451
+						'title'    => esc_html__('Add New Event Category', 'event_espresso'),
452
+						'filename' => 'events_add_category',
453
+					],
454
+				],
455
+				'help_tour'     => ['Event_Add_Category_Help_Tour'],
456
+				'metaboxes'     => ['_publish_post_box'],
457
+				'require_nonce' => false,
458
+			],
459
+			'edit_category'          => [
460
+				'nav'           => [
461
+					'label'      => esc_html__('Edit Category', 'event_espresso'),
462
+					'order'      => 15,
463
+					'persistent' => false,
464
+					'url'        => isset($this->_req_data['EVT_CAT_ID'])
465
+						? add_query_arg(
466
+							['EVT_CAT_ID' => $this->_req_data['EVT_CAT_ID']],
467
+							$this->_current_page_view_url
468
+						)
469
+						: $this->_admin_base_url,
470
+				],
471
+				'help_tabs'     => [
472
+					'edit_category_help_tab' => [
473
+						'title'    => esc_html__('Edit Event Category', 'event_espresso'),
474
+						'filename' => 'events_edit_category',
475
+					],
476
+				],
477
+				/*'help_tour' => array('Event_Edit_Category_Help_Tour'),*/
478
+				'metaboxes'     => ['_publish_post_box'],
479
+				'require_nonce' => false,
480
+			],
481
+			'category_list'          => [
482
+				'nav'           => [
483
+					'label' => esc_html__('Categories', 'event_espresso'),
484
+					'order' => 20,
485
+				],
486
+				'list_table'    => 'Event_Categories_Admin_List_Table',
487
+				'help_tabs'     => [
488
+					'events_categories_help_tab'                       => [
489
+						'title'    => esc_html__('Event Categories', 'event_espresso'),
490
+						'filename' => 'events_categories',
491
+					],
492
+					'events_categories_table_column_headings_help_tab' => [
493
+						'title'    => esc_html__('Event Categories Table Column Headings', 'event_espresso'),
494
+						'filename' => 'events_categories_table_column_headings',
495
+					],
496
+					'events_categories_view_help_tab'                  => [
497
+						'title'    => esc_html__('Event Categories Views', 'event_espresso'),
498
+						'filename' => 'events_categories_views',
499
+					],
500
+					'events_categories_other_help_tab'                 => [
501
+						'title'    => esc_html__('Event Categories Other', 'event_espresso'),
502
+						'filename' => 'events_categories_other',
503
+					],
504
+				],
505
+				'help_tour'     => [
506
+					'Event_Categories_Help_Tour',
507
+				],
508
+				'metaboxes'     => $this->_default_espresso_metaboxes,
509
+				'require_nonce' => false,
510
+			],
511
+		];
512
+		// only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
513
+		$domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
514
+		if (! $domain->isCaffeinated()) {
515
+			$this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
516
+			$this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
517
+		}
518
+	}
519
+
520
+
521
+	/**
522
+	 * Used to register any global screen options if necessary for every route in this admin page group.
523
+	 */
524
+	protected function _add_screen_options()
525
+	{
526
+	}
527
+
528
+
529
+	/**
530
+	 * Implementing the screen options for the 'default' route.
531
+	 *
532
+	 * @throws InvalidArgumentException
533
+	 * @throws InvalidDataTypeException
534
+	 * @throws InvalidInterfaceException
535
+	 */
536
+	protected function _add_screen_options_default()
537
+	{
538
+		$this->_per_page_screen_option();
539
+	}
540
+
541
+
542
+	/**
543
+	 * Implementing screen options for the category list route.
544
+	 *
545
+	 * @throws InvalidArgumentException
546
+	 * @throws InvalidDataTypeException
547
+	 * @throws InvalidInterfaceException
548
+	 */
549
+	protected function _add_screen_options_category_list()
550
+	{
551
+		$page_title = $this->_admin_page_title;
552
+		$this->_admin_page_title = esc_html__('Categories', 'event_espresso');
553
+		$this->_per_page_screen_option();
554
+		$this->_admin_page_title = $page_title;
555
+	}
556
+
557
+
558
+	/**
559
+	 * Used to register any global feature pointers for the admin page group.
560
+	 */
561
+	protected function _add_feature_pointers()
562
+	{
563
+	}
564
+
565
+
566
+	/**
567
+	 * Registers and enqueues any global scripts and styles for the entire admin page group.
568
+	 */
569
+	public function load_scripts_styles()
570
+	{
571
+		wp_register_style(
572
+			'events-admin-css',
573
+			EVENTS_ASSETS_URL . 'events-admin-page.css',
574
+			[],
575
+			EVENT_ESPRESSO_VERSION
576
+		);
577
+		wp_register_style(
578
+			'ee-cat-admin',
579
+			EVENTS_ASSETS_URL . 'ee-cat-admin.css',
580
+			[],
581
+			EVENT_ESPRESSO_VERSION
582
+		);
583
+		wp_enqueue_style('events-admin-css');
584
+		wp_enqueue_style('ee-cat-admin');
585
+		// scripts
586
+		wp_register_script(
587
+			'event_editor_js',
588
+			EVENTS_ASSETS_URL . 'event_editor.js',
589
+			['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
590
+			EVENT_ESPRESSO_VERSION,
591
+			true
592
+		);
593
+	}
594
+
595
+
596
+	/**
597
+	 * Enqueuing scripts and styles specific to this view
598
+	 */
599
+	public function load_scripts_styles_create_new()
600
+	{
601
+		$this->load_scripts_styles_edit();
602
+	}
603
+
604
+
605
+	/**
606
+	 * Enqueuing scripts and styles specific to this view
607
+	 */
608
+	public function load_scripts_styles_edit()
609
+	{
610
+		// styles
611
+		wp_enqueue_style('espresso-ui-theme');
612
+		wp_register_style(
613
+			'event-editor-css',
614
+			EVENTS_ASSETS_URL . 'event-editor.css',
615
+			['ee-admin-css'],
616
+			EVENT_ESPRESSO_VERSION
617
+		);
618
+		wp_enqueue_style('event-editor-css');
619
+		// scripts
620
+		if (! $this->admin_config->useAdvancedEditor()) {
621
+			wp_register_script(
622
+				'event-datetime-metabox',
623
+				EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
624
+				['event_editor_js', 'ee-datepicker'],
625
+				EVENT_ESPRESSO_VERSION
626
+			);
627
+			wp_enqueue_script('event-datetime-metabox');
628
+		}
629
+	}
630
+
631
+
632
+	/**
633
+	 * Populating the _views property for the category list table view.
634
+	 */
635
+	protected function _set_list_table_views_category_list()
636
+	{
637
+		$this->_views = [
638
+			'all' => [
639
+				'slug'        => 'all',
640
+				'label'       => esc_html__('All', 'event_espresso'),
641
+				'count'       => 0,
642
+				'bulk_action' => [
643
+					'delete_categories' => esc_html__('Delete Permanently', 'event_espresso'),
644
+				],
645
+			],
646
+		];
647
+	}
648
+
649
+
650
+	/**
651
+	 * For adding anything that fires on the admin_init hook for any route within this admin page group.
652
+	 */
653
+	public function admin_init()
654
+	{
655
+		EE_Registry::$i18n_js_strings['image_confirm'] = esc_html__(
656
+			'Do you really want to delete this image? Please remember to update your event to complete the removal.',
657
+			'event_espresso'
658
+		);
659
+	}
660
+
661
+
662
+	/**
663
+	 * For adding anything that should be triggered on the admin_notices hook for any route within this admin page
664
+	 * group.
665
+	 */
666
+	public function admin_notices()
667
+	{
668
+	}
669
+
670
+
671
+	/**
672
+	 * For adding anything that should be triggered on the `admin_print_footer_scripts` hook for any route within
673
+	 * this admin page group.
674
+	 */
675
+	public function admin_footer_scripts()
676
+	{
677
+	}
678
+
679
+
680
+	/**
681
+	 * Call this function to verify if an event is public and has tickets for sale.  If it does, then we need to show a
682
+	 * warning (via EE_Error::add_error());
683
+	 *
684
+	 * @param EE_Event $event Event object
685
+	 * @param string   $req_type
686
+	 * @return void
687
+	 * @throws EE_Error
688
+	 * @access public
689
+	 */
690
+	public function verify_event_edit($event = null, $req_type = '')
691
+	{
692
+		// don't need to do this when processing
693
+		if (! empty($req_type)) {
694
+			return;
695
+		}
696
+		// no event?
697
+		if (! $event instanceof EE_Event) {
698
+			$event = $this->_cpt_model_obj;
699
+		}
700
+		// STILL no event?
701
+		if (! $event instanceof EE_Event) {
702
+			return;
703
+		}
704
+		$orig_status = $event->status();
705
+		// first check if event is active.
706
+		if (
707
+			$orig_status === EEM_Event::cancelled
708
+			|| $orig_status === EEM_Event::postponed
709
+			|| $event->is_expired()
710
+			|| $event->is_inactive()
711
+		) {
712
+			return;
713
+		}
714
+		// made it here so it IS active... next check that any of the tickets are sold.
715
+		if ($event->is_sold_out(true)) {
716
+			if ($orig_status !== EEM_Event::sold_out && $event->status() !== $orig_status) {
717
+				EE_Error::add_attention(
718
+					sprintf(
719
+						esc_html__(
720
+							'Please note that the Event Status has automatically been changed to %s because there are no more spaces available for this event.  However, this change is not permanent until you update the event.  You can change the status back to something else before updating if you wish.',
721
+							'event_espresso'
722
+						),
723
+						EEH_Template::pretty_status(EEM_Event::sold_out, false, 'sentence')
724
+					)
725
+				);
726
+			}
727
+			return;
728
+		}
729
+		if ($orig_status === EEM_Event::sold_out) {
730
+			EE_Error::add_attention(
731
+				sprintf(
732
+					esc_html__(
733
+						'Please note that the Event Status has automatically been changed to %s because more spaces have become available for this event, most likely due to abandoned transactions freeing up reserved tickets.  However, this change is not permanent until you update the event. If you wish, you can change the status back to something else before updating.',
734
+						'event_espresso'
735
+					),
736
+					EEH_Template::pretty_status($event->status(), false, 'sentence')
737
+				)
738
+			);
739
+		}
740
+		// now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
741
+		if (! $event->tickets_on_sale()) {
742
+			return;
743
+		}
744
+		// made it here so show warning
745
+		$this->_edit_event_warning();
746
+	}
747
+
748
+
749
+	/**
750
+	 * This is the text used for when an event is being edited that is public and has tickets for sale.
751
+	 * When needed, hook this into a EE_Error::add_error() notice.
752
+	 *
753
+	 * @access protected
754
+	 * @return void
755
+	 */
756
+	protected function _edit_event_warning()
757
+	{
758
+		// we don't want to add warnings during these requests
759
+		if (isset($this->_req_data['action']) && $this->_req_data['action'] === 'editpost') {
760
+			return;
761
+		}
762
+		EE_Error::add_attention(
763
+			sprintf(
764
+				esc_html__(
765
+					'Your event is open for registration. Making changes may disrupt any transactions in progress. %sLearn more%s',
766
+					'event_espresso'
767
+				),
768
+				'<a class="espresso-help-tab-lnk">',
769
+				'</a>'
770
+			)
771
+		);
772
+	}
773
+
774
+
775
+	/**
776
+	 * When a user is creating a new event, notify them if they haven't set their timezone.
777
+	 * Otherwise, do the normal logic
778
+	 *
779
+	 * @throws EE_Error
780
+	 * @throws InvalidArgumentException
781
+	 * @throws InvalidDataTypeException
782
+	 */
783
+	protected function _create_new_cpt_item()
784
+	{
785
+		$has_timezone_string = get_option('timezone_string');
786
+		// only nag them about setting their timezone if it's their first event, and they haven't already done it
787
+		if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
788
+			EE_Error::add_attention(
789
+				sprintf(
790
+					__(
791
+						'Your website\'s timezone is currently set to a UTC offset. We recommend updating your timezone to a city or region near you before you create an event. Change your timezone now:%1$s%2$s%3$sChange Timezone%4$s',
792
+						'event_espresso'
793
+					),
794
+					'<br>',
795
+					'<select id="timezone_string" name="timezone_string" aria-describedby="timezone-description">'
796
+					. EEH_DTT_Helper::wp_timezone_choice('', EEH_DTT_Helper::get_user_locale())
797
+					. '</select>',
798
+					'<button class="button button-secondary timezone-submit">',
799
+					'</button><span class="spinner"></span>'
800
+				),
801
+				__FILE__,
802
+				__FUNCTION__,
803
+				__LINE__
804
+			);
805
+		}
806
+		parent::_create_new_cpt_item();
807
+	}
808
+
809
+
810
+	/**
811
+	 * Sets the _views property for the default route in this admin page group.
812
+	 */
813
+	protected function _set_list_table_views_default()
814
+	{
815
+		$this->_views = [
816
+			'all'   => [
817
+				'slug'        => 'all',
818
+				'label'       => esc_html__('View All Events', 'event_espresso'),
819
+				'count'       => 0,
820
+				'bulk_action' => [
821
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
822
+				],
823
+			],
824
+			'draft' => [
825
+				'slug'        => 'draft',
826
+				'label'       => esc_html__('Draft', 'event_espresso'),
827
+				'count'       => 0,
828
+				'bulk_action' => [
829
+					'trash_events' => esc_html__('Move to Trash', 'event_espresso'),
830
+				],
831
+			],
832
+		];
833
+		if (EE_Registry::instance()->CAP->current_user_can('ee_delete_events', 'espresso_events_trash_events')) {
834
+			$this->_views['trash'] = [
835
+				'slug'        => 'trash',
836
+				'label'       => esc_html__('Trash', 'event_espresso'),
837
+				'count'       => 0,
838
+				'bulk_action' => [
839
+					'restore_events' => esc_html__('Restore From Trash', 'event_espresso'),
840
+					'delete_events'  => esc_html__('Delete Permanently', 'event_espresso'),
841
+				],
842
+			];
843
+		}
844
+	}
845
+
846
+
847
+	/**
848
+	 * Provides the legend item array for the default list table view.
849
+	 *
850
+	 * @return array
851
+	 */
852
+	protected function _event_legend_items()
853
+	{
854
+		$items = [
855
+			'view_details'   => [
856
+				'class' => 'dashicons dashicons-search',
857
+				'desc'  => esc_html__('View Event', 'event_espresso'),
858
+			],
859
+			'edit_event'     => [
860
+				'class' => 'ee-icon ee-icon-calendar-edit',
861
+				'desc'  => esc_html__('Edit Event Details', 'event_espresso'),
862
+			],
863
+			'view_attendees' => [
864
+				'class' => 'dashicons dashicons-groups',
865
+				'desc'  => esc_html__('View Registrations for Event', 'event_espresso'),
866
+			],
867
+		];
868
+		$items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
869
+		$statuses = [
870
+			'sold_out_status'  => [
871
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
872
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
873
+			],
874
+			'active_status'    => [
875
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
876
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
877
+			],
878
+			'upcoming_status'  => [
879
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
880
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
881
+			],
882
+			'postponed_status' => [
883
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
884
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
885
+			],
886
+			'cancelled_status' => [
887
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
888
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
889
+			],
890
+			'expired_status'   => [
891
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
892
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
893
+			],
894
+			'inactive_status'  => [
895
+				'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
896
+				'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
897
+			],
898
+		];
899
+		$statuses = apply_filters('FHEE__Events_Admin_Page__event_legend_items__statuses', $statuses);
900
+		return array_merge($items, $statuses);
901
+	}
902
+
903
+
904
+	/**
905
+	 * @return EEM_Event
906
+	 * @throws EE_Error
907
+	 */
908
+	private function eventModel()
909
+	{
910
+		if (! $this->_event_model instanceof EEM_Event) {
911
+			$this->_event_model = EEM_Event::instance();
912
+		}
913
+		return $this->_event_model;
914
+	}
915
+
916
+
917
+	/**
918
+	 * @param string $event_timezone_string
919
+	 * @return EEM_Datetime
920
+	 * @throws EE_Error
921
+	 */
922
+	private function datetimeModel($event_timezone_string = '')
923
+	{
924
+		if (! $this->datetime_model instanceof EEM_Datetime) {
925
+			$this->datetime_model = EEM_Datetime::instance($event_timezone_string);
926
+		}
927
+		return $this->datetime_model;
928
+	}
929
+
930
+
931
+	/**
932
+	 * @param string $event_timezone_string
933
+	 * @return EEM_Ticket
934
+	 * @throws EE_Error
935
+	 */
936
+	private function ticketModel($event_timezone_string = '')
937
+	{
938
+		if (! $this->ticket_model instanceof EEM_Ticket) {
939
+			$this->ticket_model = EEM_Ticket::instance($event_timezone_string);
940
+		}
941
+		return $this->ticket_model;
942
+	}
943
+
944
+
945
+	/**
946
+	 * Adds extra buttons to the WP CPT permalink field row.
947
+	 * Method is called from parent and is hooked into the wp 'get_sample_permalink_html' filter.
948
+	 *
949
+	 * @param string $return    the current html
950
+	 * @param int    $id        the post id for the page
951
+	 * @param string $new_title What the title is
952
+	 * @param string $new_slug  what the slug is
953
+	 * @return string            The new html string for the permalink area
954
+	 */
955
+	public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
956
+	{
957
+		// make sure this is only when editing
958
+		if (! empty($id)) {
959
+			$post = get_post($id);
960
+			$return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
961
+					   . esc_html__('Shortcode', 'event_espresso')
962
+					   . '</a> ';
963
+			$return .= '<input id="shortcode" type="hidden" value="[ESPRESSO_TICKET_SELECTOR event_id='
964
+					   . $post->ID
965
+					   . ']">';
966
+		}
967
+		return $return;
968
+	}
969
+
970
+
971
+	/**
972
+	 * _events_overview_list_table
973
+	 * This contains the logic for showing the events_overview list
974
+	 *
975
+	 * @access protected
976
+	 * @return void
977
+	 * @throws DomainException
978
+	 * @throws EE_Error
979
+	 * @throws InvalidArgumentException
980
+	 * @throws InvalidDataTypeException
981
+	 * @throws InvalidInterfaceException
982
+	 */
983
+	protected function _events_overview_list_table()
984
+	{
985
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
986
+		$this->_template_args['after_list_table'] = ! empty($this->_template_args['after_list_table'])
987
+			? (array) $this->_template_args['after_list_table']
988
+			: [];
989
+		$this->_template_args['after_list_table']['view_event_list_button'] = EEH_HTML::br()
990
+																			  . EEH_Template::get_button_or_link(
991
+																				  get_post_type_archive_link('espresso_events'),
992
+																				  esc_html__('View Event Archive Page', 'event_espresso'),
993
+																				  'button'
994
+																			  );
995
+		$this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
996
+		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
997
+			'create_new',
998
+			'add',
999
+			[],
1000
+			'add-new-h2'
1001
+		);
1002
+		$this->display_admin_list_table_page_with_no_sidebar();
1003
+	}
1004
+
1005
+
1006
+	/**
1007
+	 * this allows for extra misc actions in the default WP publish box
1008
+	 *
1009
+	 * @return void
1010
+	 * @throws DomainException
1011
+	 * @throws EE_Error
1012
+	 * @throws InvalidArgumentException
1013
+	 * @throws InvalidDataTypeException
1014
+	 * @throws InvalidInterfaceException
1015
+	 * @throws ReflectionException
1016
+	 */
1017
+	public function extra_misc_actions_publish_box()
1018
+	{
1019
+		$this->_generate_publish_box_extra_content();
1020
+	}
1021
+
1022
+
1023
+	/**
1024
+	 * This is hooked into the WordPress do_action('save_post') hook and runs after the custom post type has been
1025
+	 * saved.
1026
+	 * Typically you would use this to save any additional data.
1027
+	 * Keep in mind also that "save_post" runs on EVERY post update to the database.
1028
+	 * ALSO very important.  When a post transitions from scheduled to published,
1029
+	 * the save_post action is fired but you will NOT have any _POST data containing any extra info you may have from
1030
+	 * other meta saves. So MAKE sure that you handle this accordingly.
1031
+	 *
1032
+	 * @access protected
1033
+	 * @abstract
1034
+	 * @param string $post_id The ID of the cpt that was saved (so you can link relationally)
1035
+	 * @param object $post    The post object of the cpt that was saved.
1036
+	 * @return void
1037
+	 * @throws EE_Error
1038
+	 * @throws InvalidArgumentException
1039
+	 * @throws InvalidDataTypeException
1040
+	 * @throws InvalidInterfaceException
1041
+	 * @throws ReflectionException
1042
+	 */
1043
+	protected function _insert_update_cpt_item($post_id, $post)
1044
+	{
1045
+		if ($post instanceof WP_Post && $post->post_type !== 'espresso_events') {
1046
+			// get out we're not processing an event save.
1047
+			return;
1048
+		}
1049
+		$event_values = [
1050
+			'EVT_member_only'     => ! empty($this->_req_data['member_only']) ? 1 : 0,
1051
+			'EVT_allow_overflow'  => ! empty($this->_req_data['EVT_allow_overflow']) ? 1 : 0,
1052
+			'EVT_timezone_string' => ! empty($this->_req_data['timezone_string'])
1053
+				? sanitize_text_field($this->_req_data['timezone_string'])
1054
+				: null,
1055
+		];
1056
+		/** @var FeatureFlags $flags */
1057
+		$flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1058
+		// check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1059
+		if (! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1060
+			$event_values['EVT_display_ticket_selector'] =
1061
+				! empty($this->_req_data['display_ticket_selector'])
1062
+					? 1
1063
+					: 0;
1064
+			$event_values['EVT_additional_limit'] = min(
1065
+				apply_filters('FHEE__EE_Events_Admin__insert_update_cpt_item__EVT_additional_limit_max', 255),
1066
+				! empty($this->_req_data['additional_limit'])
1067
+					? absint($this->_req_data['additional_limit'])
1068
+					: null
1069
+			);
1070
+			$event_values['EVT_default_registration_status'] =
1071
+				! empty($this->_req_data['EVT_default_registration_status'])
1072
+					? sanitize_text_field($this->_req_data['EVT_default_registration_status'])
1073
+					: EE_Registry::instance()->CFG->registration->default_STS_ID;
1074
+			$event_values['EVT_external_URL'] = ! empty($this->_req_data['externalURL'])
1075
+				? esc_url_raw($this->_req_data['externalURL'])
1076
+				: null;
1077
+			$event_values['EVT_phone'] = ! empty($this->_req_data['event_phone'])
1078
+				? sanitize_text_field($this->_req_data['event_phone'])
1079
+				: null;
1080
+		}
1081
+		// update event
1082
+		$success = $this->eventModel()->update_by_ID($event_values, $post_id);
1083
+		// get event_object for other metaboxes...
1084
+		// though it would seem to make sense to just use $this->eventModel()->get_one_by_ID( $post_id )..
1085
+		// i have to setup where conditions to override the filters in the model
1086
+		// that filter out autodraft and inherit statuses so we GET the inherit id!
1087
+		$get_one_where = [
1088
+			$this->eventModel()->primary_key_name() => $post_id,
1089
+			'OR'                                    => [
1090
+				'status'   => $post->post_status,
1091
+				// if trying to "Publish" a sold out event, it's status will get switched back to "sold_out" in the db,
1092
+				// but the returned object here has a status of "publish", so use the original post status as well
1093
+				'status*1' => $this->_req_data['original_post_status'],
1094
+			],
1095
+		];
1096
+		$event = $this->eventModel()->get_one([$get_one_where]);
1097
+		// the following are default callbacks for event attachment updates that can be overridden by caffeinated functionality and/or addons.
1098
+		$event_update_callbacks = apply_filters(
1099
+			'FHEE__Events_Admin_Page___insert_update_cpt_item__event_update_callbacks',
1100
+			[
1101
+				[$this, '_default_venue_update'],
1102
+				[$this, '_default_tickets_update'],
1103
+			]
1104
+		);
1105
+		$att_success = true;
1106
+		foreach ($event_update_callbacks as $e_callback) {
1107
+			$_success = is_callable($e_callback)
1108
+				? $e_callback($event, $this->_req_data)
1109
+				: false;
1110
+			// if ANY of these updates fail then we want the appropriate global error message
1111
+			$att_success = ! $att_success ? $att_success : $_success;
1112
+		}
1113
+		// any errors?
1114
+		if ($success && false === $att_success) {
1115
+			EE_Error::add_error(
1116
+				esc_html__(
1117
+					'Event Details saved successfully but something went wrong with saving attachments.',
1118
+					'event_espresso'
1119
+				),
1120
+				__FILE__,
1121
+				__FUNCTION__,
1122
+				__LINE__
1123
+			);
1124
+		} elseif ($success === false) {
1125
+			EE_Error::add_error(
1126
+				esc_html__('Event Details did not save successfully.', 'event_espresso'),
1127
+				__FILE__,
1128
+				__FUNCTION__,
1129
+				__LINE__
1130
+			);
1131
+		}
1132
+	}
1133
+
1134
+
1135
+	/**
1136
+	 * @param int $post_id
1137
+	 * @param int $revision_id
1138
+	 * @throws EE_Error
1139
+	 * @throws InvalidArgumentException
1140
+	 * @throws InvalidDataTypeException
1141
+	 * @throws InvalidInterfaceException
1142
+	 * @throws ReflectionException
1143
+	 * @see parent::restore_item()
1144
+	 */
1145
+	protected function _restore_cpt_item($post_id, $revision_id)
1146
+	{
1147
+		// copy existing event meta to new post
1148
+		$post_evt = $this->eventModel()->get_one_by_ID($post_id);
1149
+		if ($post_evt instanceof EE_Event) {
1150
+			// meta revision restore
1151
+			$post_evt->restore_revision($revision_id);
1152
+			// related objs restore
1153
+			$post_evt->restore_revision($revision_id, ['Venue', 'Datetime', 'Price']);
1154
+		}
1155
+	}
1156
+
1157
+
1158
+	/**
1159
+	 * Attach the venue to the Event
1160
+	 *
1161
+	 * @param EE_Event $evtobj Event Object to add the venue to
1162
+	 * @param array    $data   The request data from the form
1163
+	 * @return bool           Success or fail.
1164
+	 * @throws EE_Error
1165
+	 * @throws InvalidArgumentException
1166
+	 * @throws InvalidDataTypeException
1167
+	 * @throws InvalidInterfaceException
1168
+	 * @throws ReflectionException
1169
+	 */
1170
+	protected function _default_venue_update(EE_Event $evtobj, $data)
1171
+	{
1172
+		require_once(EE_MODELS . 'EEM_Venue.model.php');
1173
+		$venue_model = EEM_Venue::instance();
1174
+		$rows_affected = null;
1175
+		$venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
1176
+		// very important.  If we don't have a venue name...
1177
+		// then we'll get out because not necessary to create empty venue
1178
+		if (empty($data['venue_title'])) {
1179
+			return false;
1180
+		}
1181
+		$venue_array = [
1182
+			'VNU_wp_user'         => $evtobj->get('EVT_wp_user'),
1183
+			'VNU_name'            => ! empty($data['venue_title']) ? $data['venue_title'] : null,
1184
+			'VNU_desc'            => ! empty($data['venue_description']) ? $data['venue_description'] : null,
1185
+			'VNU_identifier'      => ! empty($data['venue_identifier']) ? $data['venue_identifier'] : null,
1186
+			'VNU_short_desc'      => ! empty($data['venue_short_description']) ? $data['venue_short_description']
1187
+				: null,
1188
+			'VNU_address'         => ! empty($data['address']) ? $data['address'] : null,
1189
+			'VNU_address2'        => ! empty($data['address2']) ? $data['address2'] : null,
1190
+			'VNU_city'            => ! empty($data['city']) ? $data['city'] : null,
1191
+			'STA_ID'              => ! empty($data['state']) ? $data['state'] : null,
1192
+			'CNT_ISO'             => ! empty($data['countries']) ? $data['countries'] : null,
1193
+			'VNU_zip'             => ! empty($data['zip']) ? $data['zip'] : null,
1194
+			'VNU_phone'           => ! empty($data['venue_phone']) ? $data['venue_phone'] : null,
1195
+			'VNU_capacity'        => ! empty($data['venue_capacity']) ? $data['venue_capacity'] : null,
1196
+			'VNU_url'             => ! empty($data['venue_url']) ? $data['venue_url'] : null,
1197
+			'VNU_virtual_phone'   => ! empty($data['virtual_phone']) ? $data['virtual_phone'] : null,
1198
+			'VNU_virtual_url'     => ! empty($data['virtual_url']) ? $data['virtual_url'] : null,
1199
+			'VNU_enable_for_gmap' => isset($data['enable_for_gmap']) ? 1 : 0,
1200
+			'status'              => 'publish',
1201
+		];
1202
+		// if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1203
+		if (! empty($venue_id)) {
1204
+			$update_where = [$venue_model->primary_key_name() => $venue_id];
1205
+			$rows_affected = $venue_model->update($venue_array, [$update_where]);
1206
+			// we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
1207
+			$evtobj->_add_relation_to($venue_id, 'Venue');
1208
+			return $rows_affected > 0;
1209
+		}
1210
+		// we insert the venue
1211
+		$venue_id = $venue_model->insert($venue_array);
1212
+		$evtobj->_add_relation_to($venue_id, 'Venue');
1213
+		return ! empty($venue_id) ? true : false;
1214
+		// when we have the ancestor come in it's already been handled by the revision save.
1215
+	}
1216
+
1217
+
1218
+	/**
1219
+	 * Handles saving everything related to Tickets (datetimes, tickets, prices)
1220
+	 *
1221
+	 * @param EE_Event $evtobj The Event object we're attaching data to
1222
+	 * @param array    $data   The request data from the form
1223
+	 * @return array
1224
+	 * @throws EE_Error
1225
+	 * @throws InvalidArgumentException
1226
+	 * @throws InvalidDataTypeException
1227
+	 * @throws InvalidInterfaceException
1228
+	 * @throws ReflectionException
1229
+	 * @throws Exception
1230
+	 */
1231
+	protected function _default_tickets_update(EE_Event $evtobj, $data)
1232
+	{
1233
+		if ($this->admin_config->useAdvancedEditor()) {
1234
+			return [];
1235
+		}
1236
+		$saved_dtt = null;
1237
+		$saved_tickets = [];
1238
+		$incoming_date_formats = ['Y-m-d', 'h:i a'];
1239
+		$event_timezone_string = $evtobj->get_timezone();
1240
+		$event_timezone = new DateTimeZone($event_timezone_string);
1241
+		// let's use now in the set timezone.
1242
+		$now = new DateTime('now', $event_timezone);
1243
+		foreach ($data['edit_event_datetimes'] as $row => $dtt) {
1244
+			// trim all values to ensure any excess whitespace is removed.
1245
+			$dtt = array_map('trim', $dtt);
1246
+			$dtt['DTT_EVT_end'] = isset($dtt['DTT_EVT_end']) && ! empty($dtt['DTT_EVT_end'])
1247
+				? $dtt['DTT_EVT_end']
1248
+				: $dtt['DTT_EVT_start'];
1249
+			$datetime_values = [
1250
+				'DTT_ID'        => ! empty($dtt['DTT_ID']) ? $dtt['DTT_ID'] : null,
1251
+				'DTT_EVT_start' => $dtt['DTT_EVT_start'],
1252
+				'DTT_EVT_end'   => $dtt['DTT_EVT_end'],
1253
+				'DTT_reg_limit' => empty($dtt['DTT_reg_limit']) ? EE_INF : $dtt['DTT_reg_limit'],
1254
+				'DTT_order'     => $row,
1255
+			];
1256
+			// if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1257
+			if (! empty($dtt['DTT_ID'])) {
1258
+				$DTM = $this->datetimeModel($event_timezone_string)->get_one_by_ID($dtt['DTT_ID']);
1259
+				$DTM->set_date_format($incoming_date_formats[0]);
1260
+				$DTM->set_time_format($incoming_date_formats[1]);
1261
+				foreach ($datetime_values as $field => $value) {
1262
+					$DTM->set($field, $value);
1263
+				}
1264
+				// make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1265
+				$saved_dtts[ $DTM->ID() ] = $DTM;
1266
+			} else {
1267
+				$DTM = EE_Registry::instance()->load_class(
1268
+					'Datetime',
1269
+					[$datetime_values, $event_timezone_string, $incoming_date_formats],
1270
+					false,
1271
+					false
1272
+				);
1273
+				foreach ($datetime_values as $field => $value) {
1274
+					$DTM->set($field, $value);
1275
+				}
1276
+			}
1277
+			$DTM->save();
1278
+			$DTM = $evtobj->_add_relation_to($DTM, 'Datetime');
1279
+			// load DTT helper
1280
+			// before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1281
+			if ($DTM->get_raw('DTT_EVT_start') > $DTM->get_raw('DTT_EVT_end')) {
1282
+				$DTM->set('DTT_EVT_end', $DTM->get('DTT_EVT_start'));
1283
+				$DTM = EEH_DTT_Helper::date_time_add($DTM, 'DTT_EVT_end', 'days');
1284
+				$DTM->save();
1285
+			}
1286
+			// now we got to make sure we add the new DTT_ID to the $saved_dtts array
1287
+			//  because it is possible there was a new one created for the autosave.
1288
+			$saved_dtt = $DTM;
1289
+			// if ANY of these updates fail then we want the appropriate global error message.
1290
+			// //todo this is actually sucky we need a better error message but this is what it is for now.
1291
+		}
1292
+		// no dtts get deleted so we don't do any of that logic here.
1293
+		// update tickets next
1294
+		$old_tickets = isset($data['ticket_IDs']) ? explode(',', $data['ticket_IDs']) : [];
1295
+		foreach ($data['edit_tickets'] as $row => $tkt) {
1296
+			$incoming_date_formats = ['Y-m-d', 'h:i a'];
1297
+			$update_prices = false;
1298
+			$ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1299
+				? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1300
+			// trim inputs to ensure any excess whitespace is removed.
1301
+			$tkt = array_map('trim', $tkt);
1302
+			if (empty($tkt['TKT_start_date'])) {
1303
+				$tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1304
+			}
1305
+			if (empty($tkt['TKT_end_date'])) {
1306
+				// use the start date of the first datetime
1307
+				$dtt = $evtobj->first_datetime();
1308
+				$tkt['TKT_end_date'] = $dtt->start_date_and_time(
1309
+					$incoming_date_formats[0],
1310
+					$incoming_date_formats[1]
1311
+				);
1312
+			}
1313
+			$TKT_values = [
1314
+				'TKT_ID'          => ! empty($tkt['TKT_ID']) ? $tkt['TKT_ID'] : null,
1315
+				'TTM_ID'          => ! empty($tkt['TTM_ID']) ? $tkt['TTM_ID'] : 0,
1316
+				'TKT_name'        => ! empty($tkt['TKT_name']) ? $tkt['TKT_name'] : '',
1317
+				'TKT_description' => ! empty($tkt['TKT_description']) ? $tkt['TKT_description'] : '',
1318
+				'TKT_start_date'  => $tkt['TKT_start_date'],
1319
+				'TKT_end_date'    => $tkt['TKT_end_date'],
1320
+				'TKT_qty'         => ! isset($tkt['TKT_qty']) || $tkt['TKT_qty'] === '' ? EE_INF : $tkt['TKT_qty'],
1321
+				'TKT_uses'        => ! isset($tkt['TKT_uses']) || $tkt['TKT_uses'] === '' ? EE_INF : $tkt['TKT_uses'],
1322
+				'TKT_min'         => empty($tkt['TKT_min']) ? 0 : $tkt['TKT_min'],
1323
+				'TKT_max'         => empty($tkt['TKT_max']) ? EE_INF : $tkt['TKT_max'],
1324
+				'TKT_row'         => $row,
1325
+				'TKT_order'       => isset($tkt['TKT_order']) ? $tkt['TKT_order'] : $row,
1326
+				'TKT_price'       => $ticket_price,
1327
+			];
1328
+			// if this is a default TKT, then we need to set the TKT_ID to 0 and update accordingly, which means in turn that the prices will become new prices as well.
1329
+			if (isset($tkt['TKT_is_default']) && $tkt['TKT_is_default']) {
1330
+				$TKT_values['TKT_ID'] = 0;
1331
+				$TKT_values['TKT_is_default'] = 0;
1332
+				$TKT_values['TKT_price'] = $ticket_price;
1333
+				$update_prices = true;
1334
+			}
1335
+			// if we have a TKT_ID then we need to get that existing TKT_obj and update it
1336
+			// we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1337
+			// keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1338
+			if (! empty($tkt['TKT_ID'])) {
1339
+				$TKT = $this->ticketModel($event_timezone_string)->get_one_by_ID($tkt['TKT_ID']);
1340
+				if ($TKT instanceof EE_Ticket) {
1341
+					$ticket_sold = $TKT->count_related(
1342
+						'Registration',
1343
+						[
1344
+								[
1345
+									'STS_ID' => [
1346
+										'NOT IN',
1347
+										[EEM_Registration::status_id_incomplete],
1348
+									],
1349
+								],
1350
+							]
1351
+					) > 0;
1352
+					// let's just check the total price for the existing ticket and determine if it matches the new
1353
+					// total price.  if they are different then we create a new ticket (if tickets sold)
1354
+					// if they aren't different then we go ahead and modify existing ticket.
1355
+					$create_new_TKT = $ticket_sold && ! $TKT->deleted()
1356
+									  && EEH_Money::compare_floats(
1357
+										  $ticket_price,
1358
+										  $TKT->get('TKT_price'),
1359
+										  '!=='
1360
+									  );
1361
+					$TKT->set_date_format($incoming_date_formats[0]);
1362
+					$TKT->set_time_format($incoming_date_formats[1]);
1363
+					// set new values
1364
+					foreach ($TKT_values as $field => $value) {
1365
+						if ($field === 'TKT_qty') {
1366
+							$TKT->set_qty($value);
1367
+						} else {
1368
+							$TKT->set($field, $value);
1369
+						}
1370
+					}
1371
+					// if $create_new_TKT is false then we can safely update the existing ticket.  Otherwise we have to create a new ticket.
1372
+					if ($create_new_TKT) {
1373
+						// archive the old ticket first
1374
+						$TKT->set('TKT_deleted', 1);
1375
+						$TKT->save();
1376
+						// make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1377
+						$saved_tickets[ $TKT->ID() ] = $TKT;
1378
+						// create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1379
+						$TKT = clone $TKT;
1380
+						$TKT->set('TKT_ID', 0);
1381
+						$TKT->set('TKT_deleted', 0);
1382
+						$TKT->set('TKT_price', $ticket_price);
1383
+						$TKT->set('TKT_sold', 0);
1384
+						// now we need to make sure that $new prices are created as well and attached to new ticket.
1385
+						$update_prices = true;
1386
+					}
1387
+					// make sure price is set if it hasn't been already
1388
+					$TKT->set('TKT_price', $ticket_price);
1389
+				}
1390
+			} else {
1391
+				// no TKT_id so a new TKT
1392
+				$TKT_values['TKT_price'] = $ticket_price;
1393
+				$TKT = EE_Registry::instance()->load_class('Ticket', [$TKT_values], false, false);
1394
+				if ($TKT instanceof EE_Ticket) {
1395
+					// need to reset values to properly account for the date formats
1396
+					$TKT->set_date_format($incoming_date_formats[0]);
1397
+					$TKT->set_time_format($incoming_date_formats[1]);
1398
+					$TKT->set_timezone($evtobj->get_timezone());
1399
+					// set new values
1400
+					foreach ($TKT_values as $field => $value) {
1401
+						if ($field === 'TKT_qty') {
1402
+							$TKT->set_qty($value);
1403
+						} else {
1404
+							$TKT->set($field, $value);
1405
+						}
1406
+					}
1407
+					$update_prices = true;
1408
+				}
1409
+			}
1410
+			// cap ticket qty by datetime reg limits
1411
+			$TKT->set_qty(min($TKT->qty(), $TKT->qty('reg_limit')));
1412
+			// update ticket.
1413
+			$TKT->save();
1414
+			// before going any further make sure our dates are setup correctly so that the end date is always equal or greater than the start date.
1415
+			if ($TKT->get_raw('TKT_start_date') > $TKT->get_raw('TKT_end_date')) {
1416
+				$TKT->set('TKT_end_date', $TKT->get('TKT_start_date'));
1417
+				$TKT = EEH_DTT_Helper::date_time_add($TKT, 'TKT_end_date', 'days');
1418
+				$TKT->save();
1419
+			}
1420
+			// initially let's add the ticket to the dtt
1421
+			$saved_dtt->_add_relation_to($TKT, 'Ticket');
1422
+			$saved_tickets[ $TKT->ID() ] = $TKT;
1423
+			// add prices to ticket
1424
+			$this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1425
+		}
1426
+		// however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1427
+		$old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
1428
+		$tickets_removed = array_diff($old_tickets, array_keys($saved_tickets));
1429
+		foreach ($tickets_removed as $id) {
1430
+			$id = absint($id);
1431
+			// get the ticket for this id
1432
+			$tkt_to_remove = $this->ticketModel($event_timezone_string)->get_one_by_ID($id);
1433
+			// need to get all the related datetimes on this ticket and remove from every single one of them (remember this process can ONLY kick off if there are NO tkts_sold)
1434
+			$dtts = $tkt_to_remove->get_many_related('Datetime');
1435
+			foreach ($dtts as $dtt) {
1436
+				$tkt_to_remove->_remove_relation_to($dtt, 'Datetime');
1437
+			}
1438
+			// need to do the same for prices (except these prices can also be deleted because again, tickets can only be trashed if they don't have any TKTs sold (otherwise they are just archived))
1439
+			$tkt_to_remove->delete_related_permanently('Price');
1440
+			// finally let's delete this ticket (which should not be blocked at this point b/c we've removed all our relationships)
1441
+			$tkt_to_remove->delete_permanently();
1442
+		}
1443
+		return [$saved_dtt, $saved_tickets];
1444
+	}
1445
+
1446
+
1447
+	/**
1448
+	 * This attaches a list of given prices to a ticket.
1449
+	 * Note we dont' have to worry about ever removing relationships (or archiving prices) because if there is a change
1450
+	 * in price information on a ticket, a new ticket is created anyways so the archived ticket will retain the old
1451
+	 * price info and prices are automatically "archived" via the ticket.
1452
+	 *
1453
+	 * @access  private
1454
+	 * @param array     $prices     Array of prices from the form.
1455
+	 * @param EE_Ticket $ticket     EE_Ticket object that prices are being attached to.
1456
+	 * @param bool      $new_prices Whether attach existing incoming prices or create new ones.
1457
+	 * @return  void
1458
+	 * @throws EE_Error
1459
+	 * @throws InvalidArgumentException
1460
+	 * @throws InvalidDataTypeException
1461
+	 * @throws InvalidInterfaceException
1462
+	 * @throws ReflectionException
1463
+	 */
1464
+	private function _add_prices_to_ticket($prices, EE_Ticket $ticket, $new_prices = false)
1465
+	{
1466
+		foreach ($prices as $row => $prc) {
1467
+			$PRC_values = [
1468
+				'PRC_ID'         => ! empty($prc['PRC_ID']) ? $prc['PRC_ID'] : null,
1469
+				'PRT_ID'         => ! empty($prc['PRT_ID']) ? $prc['PRT_ID'] : null,
1470
+				'PRC_amount'     => ! empty($prc['PRC_amount']) ? $prc['PRC_amount'] : 0,
1471
+				'PRC_name'       => ! empty($prc['PRC_name']) ? $prc['PRC_name'] : '',
1472
+				'PRC_desc'       => ! empty($prc['PRC_desc']) ? $prc['PRC_desc'] : '',
1473
+				'PRC_is_default' => 0, // make sure prices are NOT set as default from this context
1474
+				'PRC_order'      => $row,
1475
+			];
1476
+			if ($new_prices || empty($PRC_values['PRC_ID'])) {
1477
+				$PRC_values['PRC_ID'] = 0;
1478
+				$PRC = EE_Registry::instance()->load_class('Price', [$PRC_values], false, false);
1479
+			} else {
1480
+				$PRC = EEM_Price::instance()->get_one_by_ID($prc['PRC_ID']);
1481
+				// update this price with new values
1482
+				foreach ($PRC_values as $field => $newprc) {
1483
+					$PRC->set($field, $newprc);
1484
+				}
1485
+				$PRC->save();
1486
+			}
1487
+			$ticket->_add_relation_to($PRC, 'Price');
1488
+		}
1489
+	}
1490
+
1491
+
1492
+	/**
1493
+	 * Add in our autosave ajax handlers
1494
+	 *
1495
+	 */
1496
+	protected function _ee_autosave_create_new()
1497
+	{
1498
+	}
1499
+
1500
+
1501
+	/**
1502
+	 * More autosave handlers.
1503
+	 */
1504
+	protected function _ee_autosave_edit()
1505
+	{
1506
+	}
1507
+
1508
+
1509
+	/**
1510
+	 *    _generate_publish_box_extra_content
1511
+	 *
1512
+	 * @throws DomainException
1513
+	 * @throws EE_Error
1514
+	 * @throws InvalidArgumentException
1515
+	 * @throws InvalidDataTypeException
1516
+	 * @throws InvalidInterfaceException
1517
+	 * @throws ReflectionException
1518
+	 */
1519
+	private function _generate_publish_box_extra_content()
1520
+	{
1521
+		// load formatter helper
1522
+		// args for getting related registrations
1523
+		$approved_query_args = [
1524
+			[
1525
+				'REG_deleted' => 0,
1526
+				'STS_ID'      => EEM_Registration::status_id_approved,
1527
+			],
1528
+		];
1529
+		$not_approved_query_args = [
1530
+			[
1531
+				'REG_deleted' => 0,
1532
+				'STS_ID'      => EEM_Registration::status_id_not_approved,
1533
+			],
1534
+		];
1535
+		$pending_payment_query_args = [
1536
+			[
1537
+				'REG_deleted' => 0,
1538
+				'STS_ID'      => EEM_Registration::status_id_pending_payment,
1539
+			],
1540
+		];
1541
+		// publish box
1542
+		$publish_box_extra_args = [
1543
+			'view_approved_reg_url'        => add_query_arg(
1544
+				[
1545
+					'action'      => 'default',
1546
+					'event_id'    => $this->_cpt_model_obj->ID(),
1547
+					'_reg_status' => EEM_Registration::status_id_approved,
1548
+				],
1549
+				REG_ADMIN_URL
1550
+			),
1551
+			'view_not_approved_reg_url'    => add_query_arg(
1552
+				[
1553
+					'action'      => 'default',
1554
+					'event_id'    => $this->_cpt_model_obj->ID(),
1555
+					'_reg_status' => EEM_Registration::status_id_not_approved,
1556
+				],
1557
+				REG_ADMIN_URL
1558
+			),
1559
+			'view_pending_payment_reg_url' => add_query_arg(
1560
+				[
1561
+					'action'      => 'default',
1562
+					'event_id'    => $this->_cpt_model_obj->ID(),
1563
+					'_reg_status' => EEM_Registration::status_id_pending_payment,
1564
+				],
1565
+				REG_ADMIN_URL
1566
+			),
1567
+			'approved_regs'                => $this->_cpt_model_obj->count_related(
1568
+				'Registration',
1569
+				$approved_query_args
1570
+			),
1571
+			'not_approved_regs'            => $this->_cpt_model_obj->count_related(
1572
+				'Registration',
1573
+				$not_approved_query_args
1574
+			),
1575
+			'pending_payment_regs'         => $this->_cpt_model_obj->count_related(
1576
+				'Registration',
1577
+				$pending_payment_query_args
1578
+			),
1579
+			'misc_pub_section_class'       => apply_filters(
1580
+				'FHEE_Events_Admin_Page___generate_publish_box_extra_content__misc_pub_section_class',
1581
+				'misc-pub-section'
1582
+			),
1583
+		];
1584
+		ob_start();
1585
+		do_action(
1586
+			'AHEE__Events_Admin_Page___generate_publish_box_extra_content__event_editor_overview_add',
1587
+			$this->_cpt_model_obj
1588
+		);
1589
+		$publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1590
+		// load template
1591
+		EEH_Template::display_template(
1592
+			EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1593
+			$publish_box_extra_args
1594
+		);
1595
+	}
1596
+
1597
+
1598
+	/**
1599
+	 * @return EE_Event
1600
+	 */
1601
+	public function get_event_object()
1602
+	{
1603
+		return $this->_cpt_model_obj;
1604
+	}
1605
+
1606
+
1607
+
1608
+
1609
+	/** METABOXES * */
1610
+	/**
1611
+	 * _register_event_editor_meta_boxes
1612
+	 * add all metaboxes related to the event_editor
1613
+	 *
1614
+	 * @return void
1615
+	 * @throws EE_Error
1616
+	 * @throws InvalidArgumentException
1617
+	 * @throws InvalidDataTypeException
1618
+	 * @throws InvalidInterfaceException
1619
+	 * @throws ReflectionException
1620
+	 */
1621
+	protected function _register_event_editor_meta_boxes()
1622
+	{
1623
+		$this->verify_cpt_object();
1624
+		$use_advanced_editor = $this->admin_config->useAdvancedEditor();
1625
+		/** @var FeatureFlags $flags */
1626
+		$flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1627
+		// check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1628
+		if (! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1629
+			add_meta_box(
1630
+				'espresso_event_editor_event_options',
1631
+				esc_html__('Event Registration Options', 'event_espresso'),
1632
+				[$this, 'registration_options_meta_box'],
1633
+				$this->page_slug,
1634
+				'side'
1635
+			);
1636
+		}
1637
+		if (! $use_advanced_editor) {
1638
+			add_meta_box(
1639
+				'espresso_event_editor_tickets',
1640
+				esc_html__('Event Datetime & Ticket', 'event_espresso'),
1641
+				[$this, 'ticket_metabox'],
1642
+				$this->page_slug,
1643
+				'normal',
1644
+				'high'
1645
+			);
1646
+		} else {
1647
+			if ($flags->featureAllowed('use_reg_options_meta_box')) {
1648
+				add_action(
1649
+					'add_meta_boxes_espresso_events',
1650
+					function () {
1651
+						global $current_screen;
1652
+						remove_meta_box('authordiv', $current_screen, 'normal');
1653
+					},
1654
+					99
1655
+				);
1656
+			}
1657
+		}
1658
+		// NOTE: if you're looking for other metaboxes in here,
1659
+		// where a metabox has a related management page in the admin
1660
+		// you will find it setup in the related management page's "_Hooks" file.
1661
+		// i.e. messages metabox is found in "espresso_events_Messages_Hooks.class.php".
1662
+	}
1663
+
1664
+
1665
+	/**
1666
+	 * @throws DomainException
1667
+	 * @throws EE_Error
1668
+	 * @throws InvalidArgumentException
1669
+	 * @throws InvalidDataTypeException
1670
+	 * @throws InvalidInterfaceException
1671
+	 * @throws ReflectionException
1672
+	 */
1673
+	public function ticket_metabox()
1674
+	{
1675
+		$existing_datetime_ids = $existing_ticket_ids = [];
1676
+		// defaults for template args
1677
+		$template_args = [
1678
+			'existing_datetime_ids'    => '',
1679
+			'event_datetime_help_link' => '',
1680
+			'ticket_options_help_link' => '',
1681
+			'time'                     => null,
1682
+			'ticket_rows'              => '',
1683
+			'existing_ticket_ids'      => '',
1684
+			'total_ticket_rows'        => 1,
1685
+			'ticket_js_structure'      => '',
1686
+			'trash_icon'               => 'ee-lock-icon',
1687
+			'disabled'                 => '',
1688
+		];
1689
+		$event_id = $this->_cpt_model_obj instanceof EE_Event ? $this->_cpt_model_obj->ID() : 0;
1690
+		$event_timezone_string = $this->_cpt_model_obj instanceof EE_Event
1691
+			? $this->_cpt_model_obj->timezone_string()
1692
+			: '';
1693
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
1694
+		/**
1695
+		 * 1. Start with retrieving Datetimes
1696
+		 * 2. Fore each datetime get related tickets
1697
+		 * 3. For each ticket get related prices
1698
+		 */
1699
+		$times = $this->datetimeModel($event_timezone_string)->get_all_event_dates($event_id);
1700
+		/** @type EE_Datetime $first_datetime */
1701
+		$first_datetime = reset($times);
1702
+		// do we get related tickets?
1703
+		if (
1704
+			$first_datetime instanceof EE_Datetime
1705
+			&& $first_datetime->ID() !== 0
1706
+		) {
1707
+			$existing_datetime_ids[] = $first_datetime->get('DTT_ID');
1708
+			$template_args['time'] = $first_datetime;
1709
+			$related_tickets = $first_datetime->tickets(
1710
+				[
1711
+					['OR' => ['TKT_deleted' => 1, 'TKT_deleted*' => 0]],
1712
+					'default_where_conditions' => 'none',
1713
+				]
1714
+			);
1715
+			if (! empty($related_tickets)) {
1716
+				$template_args['total_ticket_rows'] = count($related_tickets);
1717
+				$row = 0;
1718
+				foreach ($related_tickets as $ticket) {
1719
+					$existing_ticket_ids[] = $ticket->get('TKT_ID');
1720
+					$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket, false, $row);
1721
+					$row++;
1722
+				}
1723
+			} else {
1724
+				$template_args['total_ticket_rows'] = 1;
1725
+				/** @type EE_Ticket $ticket */
1726
+				$ticket = $this->ticketModel($event_timezone_string)->create_default_object();
1727
+				$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket);
1728
+			}
1729
+		} else {
1730
+			$template_args['time'] = $times[0];
1731
+			/** @type EE_Ticket $ticket */
1732
+			$ticket = $this->ticketModel($event_timezone_string)->get_all_default_tickets();
1733
+			$template_args['ticket_rows'] .= $this->_get_ticket_row($ticket[1]);
1734
+			// NOTE: we're just sending the first default row
1735
+			// (decaf can't manage default tickets so this should be sufficient);
1736
+		}
1737
+		$template_args['event_datetime_help_link'] = $this->_get_help_tab_link(
1738
+			'event_editor_event_datetimes_help_tab'
1739
+		);
1740
+		$template_args['ticket_options_help_link'] = $this->_get_help_tab_link('ticket_options_info');
1741
+		$template_args['existing_datetime_ids'] = implode(',', $existing_datetime_ids);
1742
+		$template_args['existing_ticket_ids'] = implode(',', $existing_ticket_ids);
1743
+		$template_args['ticket_js_structure'] = $this->_get_ticket_row(
1744
+			$this->ticketModel($event_timezone_string)->create_default_object(),
1745
+			true
1746
+		);
1747
+		$template = apply_filters(
1748
+			'FHEE__Events_Admin_Page__ticket_metabox__template',
1749
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1750
+		);
1751
+		EEH_Template::display_template($template, $template_args);
1752
+	}
1753
+
1754
+
1755
+	/**
1756
+	 * Setup an individual ticket form for the decaf event editor page
1757
+	 *
1758
+	 * @access private
1759
+	 * @param EE_Ticket $ticket   the ticket object
1760
+	 * @param boolean   $skeleton whether we're generating a skeleton for js manipulation
1761
+	 * @param int       $row
1762
+	 * @return string generated html for the ticket row.
1763
+	 * @throws DomainException
1764
+	 * @throws EE_Error
1765
+	 * @throws InvalidArgumentException
1766
+	 * @throws InvalidDataTypeException
1767
+	 * @throws InvalidInterfaceException
1768
+	 * @throws ReflectionException
1769
+	 */
1770
+	private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1771
+	{
1772
+		$template_args = [
1773
+			'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1774
+			'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1775
+				: '',
1776
+			'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
1777
+			'TKT_ID'              => $ticket->get('TKT_ID'),
1778
+			'TKT_name'            => $ticket->get('TKT_name'),
1779
+			'TKT_start_date'      => $skeleton ? '' : $ticket->get_date('TKT_start_date', 'Y-m-d h:i a'),
1780
+			'TKT_end_date'        => $skeleton ? '' : $ticket->get_date('TKT_end_date', 'Y-m-d h:i a'),
1781
+			'TKT_is_default'      => $ticket->get('TKT_is_default'),
1782
+			'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1783
+			'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1784
+			'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1785
+			'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1786
+									 && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1787
+				? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1788
+			'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1789
+				: ' disabled=disabled',
1790
+		];
1791
+		$price = $ticket->ID() !== 0
1792
+			? $ticket->get_first_related('Price', ['default_where_conditions' => 'none'])
1793
+			: EEM_Price::instance()->create_default_object();
1794
+		$price_args = [
1795
+			'price_currency_symbol' => EE_Registry::instance()->CFG->currency->sign,
1796
+			'PRC_amount'            => $price->get('PRC_amount'),
1797
+			'PRT_ID'                => $price->get('PRT_ID'),
1798
+			'PRC_ID'                => $price->get('PRC_ID'),
1799
+			'PRC_is_default'        => $price->get('PRC_is_default'),
1800
+		];
1801
+		// make sure we have default start and end dates if skeleton
1802
+		// handle rows that should NOT be empty
1803
+		if (empty($template_args['TKT_start_date'])) {
1804
+			// if empty then the start date will be now.
1805
+			$template_args['TKT_start_date'] = date('Y-m-d h:i a', current_time('timestamp'));
1806
+		}
1807
+		if (empty($template_args['TKT_end_date'])) {
1808
+			// get the earliest datetime (if present);
1809
+			$earliest_dtt = $this->_cpt_model_obj->ID() > 0
1810
+				? $this->_cpt_model_obj->get_first_related(
1811
+					'Datetime',
1812
+					['order_by' => ['DTT_EVT_start' => 'ASC']]
1813
+				)
1814
+				: null;
1815
+			if (! empty($earliest_dtt)) {
1816
+				$template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1817
+			} else {
1818
+				$template_args['TKT_end_date'] = date(
1819
+					'Y-m-d h:i a',
1820
+					mktime(0, 0, 0, date('m'), date('d') + 7, date('Y'))
1821
+				);
1822
+			}
1823
+		}
1824
+		$template_args = array_merge($template_args, $price_args);
1825
+		$template = apply_filters(
1826
+			'FHEE__Events_Admin_Page__get_ticket_row__template',
1827
+			EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1828
+			$ticket
1829
+		);
1830
+		return EEH_Template::display_template($template, $template_args, true);
1831
+	}
1832
+
1833
+
1834
+	/**
1835
+	 * @throws DomainException
1836
+	 * @throws EE_Error
1837
+	 */
1838
+	public function registration_options_meta_box()
1839
+	{
1840
+		$yes_no_values = [
1841
+			['id' => true, 'text' => esc_html__('Yes', 'event_espresso')],
1842
+			['id' => false, 'text' => esc_html__('No', 'event_espresso')],
1843
+		];
1844
+		$default_reg_status_values = EEM_Registration::reg_status_array(
1845
+			[
1846
+				EEM_Registration::status_id_cancelled,
1847
+				EEM_Registration::status_id_declined,
1848
+				EEM_Registration::status_id_incomplete,
1849
+			],
1850
+			true
1851
+		);
1852
+		// $template_args['is_active_select'] = EEH_Form_Fields::select_input('is_active', $yes_no_values, $this->_cpt_model_obj->is_active());
1853
+		$template_args['_event'] = $this->_cpt_model_obj;
1854
+		$template_args['active_status'] = $this->_cpt_model_obj->pretty_active_status(false);
1855
+		$template_args['additional_limit'] = $this->_cpt_model_obj->additional_limit();
1856
+		$template_args['default_registration_status'] = EEH_Form_Fields::select_input(
1857
+			'default_reg_status',
1858
+			$default_reg_status_values,
1859
+			$this->_cpt_model_obj->default_registration_status()
1860
+		);
1861
+		$template_args['display_description'] = EEH_Form_Fields::select_input(
1862
+			'display_desc',
1863
+			$yes_no_values,
1864
+			$this->_cpt_model_obj->display_description()
1865
+		);
1866
+		$template_args['display_ticket_selector'] = EEH_Form_Fields::select_input(
1867
+			'display_ticket_selector',
1868
+			$yes_no_values,
1869
+			$this->_cpt_model_obj->display_ticket_selector(),
1870
+			'',
1871
+			'',
1872
+			false
1873
+		);
1874
+		$template_args['additional_registration_options'] = apply_filters(
1875
+			'FHEE__Events_Admin_Page__registration_options_meta_box__additional_registration_options',
1876
+			'',
1877
+			$template_args,
1878
+			$yes_no_values,
1879
+			$default_reg_status_values
1880
+		);
1881
+		EEH_Template::display_template(
1882
+			EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1883
+			$template_args
1884
+		);
1885
+	}
1886
+
1887
+
1888
+	/**
1889
+	 * _get_events()
1890
+	 * This method simply returns all the events (for the given _view and paging)
1891
+	 *
1892
+	 * @access public
1893
+	 * @param int  $per_page     count of items per page (20 default);
1894
+	 * @param int  $current_page what is the current page being viewed.
1895
+	 * @param bool $count        if TRUE then we just return a count of ALL events matching the given _view.
1896
+	 *                           If FALSE then we return an array of event objects
1897
+	 *                           that match the given _view and paging parameters.
1898
+	 * @return array an array of event objects.
1899
+	 * @throws EE_Error
1900
+	 * @throws InvalidArgumentException
1901
+	 * @throws InvalidDataTypeException
1902
+	 * @throws InvalidInterfaceException
1903
+	 * @throws ReflectionException
1904
+	 * @throws Exception
1905
+	 * @throws Exception
1906
+	 * @throws Exception
1907
+	 */
1908
+	public function get_events($per_page = 10, $current_page = 1, $count = false)
1909
+	{
1910
+		$EEME = $this->eventModel();
1911
+		$offset = ($current_page - 1) * $per_page;
1912
+		$limit = $count ? null : $offset . ',' . $per_page;
1913
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1914
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1915
+		if (isset($this->_req_data['month_range'])) {
1916
+			$pieces = explode(' ', $this->_req_data['month_range'], 3);
1917
+			// simulate the FIRST day of the month, that fixes issues for months like February
1918
+			// where PHP doesn't know what to assume for date.
1919
+			// @see https://events.codebasehq.com/projects/event-espresso/tickets/10437
1920
+			$month_r = ! empty($pieces[0]) ? date('m', EEH_DTT_Helper::first_of_month_timestamp($pieces[0])) : '';
1921
+			$year_r = ! empty($pieces[1]) ? $pieces[1] : '';
1922
+		}
1923
+		$where = [];
1924
+		$status = isset($this->_req_data['status']) ? $this->_req_data['status'] : null;
1925
+		// determine what post_status our condition will have for the query.
1926
+		switch ($status) {
1927
+			case 'month':
1928
+			case 'today':
1929
+			case null:
1930
+			case 'all':
1931
+				break;
1932
+			case 'draft':
1933
+				$where['status'] = ['IN', ['draft', 'auto-draft']];
1934
+				break;
1935
+			default:
1936
+				$where['status'] = $status;
1937
+		}
1938
+		// categories?
1939
+		$category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1940
+			? $this->_req_data['EVT_CAT'] : null;
1941
+		if (! empty($category)) {
1942
+			$where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1943
+			$where['Term_Taxonomy.term_id'] = $category;
1944
+		}
1945
+		// date where conditions
1946
+		$start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1947
+		if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1948
+			$DateTime = new DateTime(
1949
+				$year_r . '-' . $month_r . '-01 00:00:00',
1950
+				new DateTimeZone('UTC')
1951
+			);
1952
+			$start = $DateTime->getTimestamp();
1953
+			// set the datetime to be the end of the month
1954
+			$DateTime->setDate(
1955
+				$year_r,
1956
+				$month_r,
1957
+				$DateTime->format('t')
1958
+			)->setTime(23, 59, 59);
1959
+			$end = $DateTime->getTimestamp();
1960
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1961
+		} elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'today') {
1962
+			$DateTime = new DateTime('now', new DateTimeZone(EEM_Event::instance()->get_timezone()));
1963
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1964
+			$end = $DateTime->setTime(23, 59, 59)->format(implode(' ', $start_formats));
1965
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1966
+		} elseif (isset($this->_req_data['status']) && $this->_req_data['status'] === 'month') {
1967
+			$now = date('Y-m-01');
1968
+			$DateTime = new DateTime($now, new DateTimeZone(EEM_Event::instance()->get_timezone()));
1969
+			$start = $DateTime->setTime(0, 0, 0)->format(implode(' ', $start_formats));
1970
+			$end = $DateTime->setDate(date('Y'), date('m'), $DateTime->format('t'))
1971
+							->setTime(23, 59, 59)
1972
+							->format(implode(' ', $start_formats));
1973
+			$where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1974
+		}
1975
+		if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1976
+			$where['EVT_wp_user'] = get_current_user_id();
1977
+		} elseif (
1978
+			! isset($where['status'])
1979
+				  && ! EE_Registry::instance()->CAP->current_user_can('ee_read_private_events', 'get_events')
1980
+		) {
1981
+			$where['OR'] = [
1982
+				'status*restrict_private' => ['!=', 'private'],
1983
+				'AND'                     => [
1984
+					'status*inclusive' => ['=', 'private'],
1985
+					'EVT_wp_user'      => get_current_user_id(),
1986
+				],
1987
+			];
1988
+		}
1989
+
1990
+		if (
1991
+			isset($this->_req_data['EVT_wp_user'])
1992
+			&& (int) $this->_req_data['EVT_wp_user'] !== (int) get_current_user_id()
1993
+			&& EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')
1994
+		) {
1995
+			$where['EVT_wp_user'] = $this->_req_data['EVT_wp_user'];
1996
+		}
1997
+		// search query handling
1998
+		if (isset($this->_req_data['s'])) {
1999
+			$search_string = '%' . $this->_req_data['s'] . '%';
2000
+			$where['OR'] = [
2001
+				'EVT_name'       => ['LIKE', $search_string],
2002
+				'EVT_desc'       => ['LIKE', $search_string],
2003
+				'EVT_short_desc' => ['LIKE', $search_string],
2004
+			];
2005
+		}
2006
+		// filter events by venue.
2007
+		if (isset($this->_req_data['venue']) && ! empty($this->_req_data['venue'])) {
2008
+			$where['Venue.VNU_ID'] = absint($this->_req_data['venue']);
2009
+		}
2010
+		$where = apply_filters('FHEE__Events_Admin_Page__get_events__where', $where, $this->_req_data);
2011
+		$query_params = apply_filters(
2012
+			'FHEE__Events_Admin_Page__get_events__query_params',
2013
+			[
2014
+				$where,
2015
+				'limit'    => $limit,
2016
+				'order_by' => $orderby,
2017
+				'order'    => $order,
2018
+				'group_by' => 'EVT_ID',
2019
+			],
2020
+			$this->_req_data
2021
+		);
2022
+
2023
+		// let's first check if we have special requests coming in.
2024
+		if (isset($this->_req_data['active_status'])) {
2025
+			switch ($this->_req_data['active_status']) {
2026
+				case 'upcoming':
2027
+					return $EEME->get_upcoming_events($query_params, $count);
2028
+					break;
2029
+				case 'expired':
2030
+					return $EEME->get_expired_events($query_params, $count);
2031
+					break;
2032
+				case 'active':
2033
+					return $EEME->get_active_events($query_params, $count);
2034
+					break;
2035
+				case 'inactive':
2036
+					return $EEME->get_inactive_events($query_params, $count);
2037
+					break;
2038
+			}
2039
+		}
2040
+
2041
+		$events = $count ? $EEME->count([$where], 'EVT_ID', true) : $EEME->get_all($query_params);
2042
+		return $events;
2043
+	}
2044
+
2045
+
2046
+	/**
2047
+	 * handling for WordPress CPT actions (trash, restore, delete)
2048
+	 *
2049
+	 * @param string $post_id
2050
+	 * @throws EE_Error
2051
+	 * @throws InvalidArgumentException
2052
+	 * @throws InvalidDataTypeException
2053
+	 * @throws InvalidInterfaceException
2054
+	 * @throws ReflectionException
2055
+	 */
2056
+	public function trash_cpt_item($post_id)
2057
+	{
2058
+		$this->_req_data['EVT_ID'] = $post_id;
2059
+		$this->_trash_or_restore_event('trash', false);
2060
+	}
2061
+
2062
+
2063
+	/**
2064
+	 * @param string $post_id
2065
+	 * @throws EE_Error
2066
+	 * @throws InvalidArgumentException
2067
+	 * @throws InvalidDataTypeException
2068
+	 * @throws InvalidInterfaceException
2069
+	 * @throws ReflectionException
2070
+	 */
2071
+	public function restore_cpt_item($post_id)
2072
+	{
2073
+		$this->_req_data['EVT_ID'] = $post_id;
2074
+		$this->_trash_or_restore_event('draft', false);
2075
+	}
2076
+
2077
+
2078
+	/**
2079
+	 * @param string $post_id
2080
+	 * @throws EE_Error
2081
+	 * @throws InvalidArgumentException
2082
+	 * @throws InvalidDataTypeException
2083
+	 * @throws InvalidInterfaceException
2084
+	 * @throws ReflectionException
2085
+	 */
2086
+	public function delete_cpt_item($post_id)
2087
+	{
2088
+		$this->_req_data['EVT_ID'] = $post_id;
2089
+		$this->_delete_event(false);
2090
+	}
2091
+
2092
+
2093
+	/**
2094
+	 * _trash_or_restore_event
2095
+	 *
2096
+	 * @access protected
2097
+	 * @param string $event_status
2098
+	 * @param bool   $redirect_after
2099
+	 * @throws EE_Error
2100
+	 * @throws InvalidArgumentException
2101
+	 * @throws InvalidDataTypeException
2102
+	 * @throws InvalidInterfaceException
2103
+	 * @throws ReflectionException
2104
+	 */
2105
+	protected function _trash_or_restore_event($event_status = 'trash', $redirect_after = true)
2106
+	{
2107
+		// determine the event id and set to array.
2108
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : false;
2109
+		// loop thru events
2110
+		if ($EVT_ID) {
2111
+			// clean status
2112
+			$event_status = sanitize_key($event_status);
2113
+			// grab status
2114
+			if (! empty($event_status)) {
2115
+				$success = $this->_change_event_status($EVT_ID, $event_status);
2116
+			} else {
2117
+				$success = false;
2118
+				$msg = esc_html__(
2119
+					'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2120
+					'event_espresso'
2121
+				);
2122
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2123
+			}
2124
+		} else {
2125
+			$success = false;
2126
+			$msg = esc_html__(
2127
+				'An error occurred. The event could not be moved to the trash because a valid event ID was not not supplied.',
2128
+				'event_espresso'
2129
+			);
2130
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2131
+		}
2132
+		$action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2133
+		if ($redirect_after) {
2134
+			$this->_redirect_after_action($success, 'Event', $action, ['action' => 'default']);
2135
+		}
2136
+	}
2137
+
2138
+
2139
+	/**
2140
+	 * _trash_or_restore_events
2141
+	 *
2142
+	 * @access protected
2143
+	 * @param string $event_status
2144
+	 * @return void
2145
+	 * @throws EE_Error
2146
+	 * @throws InvalidArgumentException
2147
+	 * @throws InvalidDataTypeException
2148
+	 * @throws InvalidInterfaceException
2149
+	 * @throws ReflectionException
2150
+	 */
2151
+	protected function _trash_or_restore_events($event_status = 'trash')
2152
+	{
2153
+		// clean status
2154
+		$event_status = sanitize_key($event_status);
2155
+		// grab status
2156
+		if (! empty($event_status)) {
2157
+			$success = true;
2158
+			// determine the event id and set to array.
2159
+			$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2160
+			// loop thru events
2161
+			foreach ($EVT_IDs as $EVT_ID) {
2162
+				if ($EVT_ID = absint($EVT_ID)) {
2163
+					$results = $this->_change_event_status($EVT_ID, $event_status);
2164
+					$success = $results !== false ? $success : false;
2165
+				} else {
2166
+					$msg = sprintf(
2167
+						esc_html__(
2168
+							'An error occurred. Event #%d could not be moved to the trash because a valid event ID was not not supplied.',
2169
+							'event_espresso'
2170
+						),
2171
+						$EVT_ID
2172
+					);
2173
+					EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2174
+					$success = false;
2175
+				}
2176
+			}
2177
+		} else {
2178
+			$success = false;
2179
+			$msg = esc_html__(
2180
+				'An error occurred. The event could not be moved to the trash because a valid event status was not not supplied.',
2181
+				'event_espresso'
2182
+			);
2183
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2184
+		}
2185
+		// in order to force a pluralized result message we need to send back a success status greater than 1
2186
+		$success = $success ? 2 : false;
2187
+		$action = $event_status === 'trash' ? 'moved to the trash' : 'restored from the trash';
2188
+		$this->_redirect_after_action($success, 'Events', $action, ['action' => 'default']);
2189
+	}
2190
+
2191
+
2192
+	/**
2193
+	 * _trash_or_restore_events
2194
+	 *
2195
+	 * @access  private
2196
+	 * @param int    $EVT_ID
2197
+	 * @param string $event_status
2198
+	 * @return bool
2199
+	 * @throws EE_Error
2200
+	 * @throws InvalidArgumentException
2201
+	 * @throws InvalidDataTypeException
2202
+	 * @throws InvalidInterfaceException
2203
+	 * @throws ReflectionException
2204
+	 */
2205
+	private function _change_event_status($EVT_ID = 0, $event_status = '')
2206
+	{
2207
+		// grab event id
2208
+		if (! $EVT_ID) {
2209
+			$msg = esc_html__(
2210
+				'An error occurred. No Event ID or an invalid Event ID was received.',
2211
+				'event_espresso'
2212
+			);
2213
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2214
+			return false;
2215
+		}
2216
+		$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2217
+		// clean status
2218
+		$event_status = sanitize_key($event_status);
2219
+		// grab status
2220
+		if (empty($event_status)) {
2221
+			$msg = esc_html__(
2222
+				'An error occurred. No Event Status or an invalid Event Status was received.',
2223
+				'event_espresso'
2224
+			);
2225
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2226
+			return false;
2227
+		}
2228
+		// was event trashed or restored ?
2229
+		switch ($event_status) {
2230
+			case 'draft':
2231
+				$action = 'restored from the trash';
2232
+				$hook = 'AHEE_event_restored_from_trash';
2233
+				break;
2234
+			case 'trash':
2235
+				$action = 'moved to the trash';
2236
+				$hook = 'AHEE_event_moved_to_trash';
2237
+				break;
2238
+			default:
2239
+				$action = 'updated';
2240
+				$hook = false;
2241
+		}
2242
+		// use class to change status
2243
+		$this->_cpt_model_obj->set_status($event_status);
2244
+		$success = $this->_cpt_model_obj->save();
2245
+		if ($success === false) {
2246
+			$msg = sprintf(esc_html__('An error occurred. The event could not be %s.', 'event_espresso'), $action);
2247
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2248
+			return false;
2249
+		}
2250
+		if ($hook) {
2251
+			do_action($hook);
2252
+		}
2253
+		return true;
2254
+	}
2255
+
2256
+
2257
+	/**
2258
+	 * _delete_event
2259
+	 *
2260
+	 * @access protected
2261
+	 * @param bool $redirect_after
2262
+	 * @throws EE_Error
2263
+	 * @throws InvalidArgumentException
2264
+	 * @throws InvalidDataTypeException
2265
+	 * @throws InvalidInterfaceException
2266
+	 * @throws ReflectionException
2267
+	 */
2268
+	protected function _delete_event($redirect_after = true)
2269
+	{
2270
+		// determine the event id and set to array.
2271
+		$EVT_ID = isset($this->_req_data['EVT_ID']) ? absint($this->_req_data['EVT_ID']) : null;
2272
+		$EVT_ID = isset($this->_req_data['post']) ? absint($this->_req_data['post']) : $EVT_ID;
2273
+		// loop thru events
2274
+		if ($EVT_ID) {
2275
+			$success = $this->_permanently_delete_event($EVT_ID);
2276
+			// get list of events with no prices
2277
+			$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2278
+			// remove this event from the list of events with no prices
2279
+			if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2280
+				unset($espresso_no_ticket_prices[ $EVT_ID ]);
2281
+			}
2282
+			update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2283
+		} else {
2284
+			$success = false;
2285
+			$msg = esc_html__(
2286
+				'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2287
+				'event_espresso'
2288
+			);
2289
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2290
+		}
2291
+		if ($redirect_after) {
2292
+			$this->_redirect_after_action(
2293
+				$success,
2294
+				'Event',
2295
+				'deleted',
2296
+				['action' => 'default', 'status' => 'trash']
2297
+			);
2298
+		}
2299
+	}
2300
+
2301
+
2302
+	/**
2303
+	 * _delete_events
2304
+	 *
2305
+	 * @access protected
2306
+	 * @return void
2307
+	 * @throws EE_Error
2308
+	 * @throws InvalidArgumentException
2309
+	 * @throws InvalidDataTypeException
2310
+	 * @throws InvalidInterfaceException
2311
+	 * @throws ReflectionException
2312
+	 */
2313
+	protected function _delete_events()
2314
+	{
2315
+		$success = true;
2316
+		// get list of events with no prices
2317
+		$espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2318
+		// determine the event id and set to array.
2319
+		$EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
2320
+		// loop thru events
2321
+		foreach ($EVT_IDs as $EVT_ID) {
2322
+			$EVT_ID = absint($EVT_ID);
2323
+			if ($EVT_ID) {
2324
+				$results = $this->_permanently_delete_event($EVT_ID);
2325
+				$success = $results !== false ? $success : false;
2326
+				// remove this event from the list of events with no prices
2327
+				unset($espresso_no_ticket_prices[ $EVT_ID ]);
2328
+			} else {
2329
+				$success = false;
2330
+				$msg = esc_html__(
2331
+					'An error occurred. An event could not be deleted because a valid event ID was not not supplied.',
2332
+					'event_espresso'
2333
+				);
2334
+				EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2335
+			}
2336
+		}
2337
+		update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2338
+		// in order to force a pluralized result message we need to send back a success status greater than 1
2339
+		$success = $success ? 2 : false;
2340
+		$this->_redirect_after_action($success, 'Events', 'deleted', ['action' => 'default']);
2341
+	}
2342
+
2343
+
2344
+	/**
2345
+	 * _permanently_delete_event
2346
+	 *
2347
+	 * @access  private
2348
+	 * @param int $EVT_ID
2349
+	 * @return bool
2350
+	 * @throws EE_Error
2351
+	 * @throws InvalidArgumentException
2352
+	 * @throws InvalidDataTypeException
2353
+	 * @throws InvalidInterfaceException
2354
+	 * @throws ReflectionException
2355
+	 */
2356
+	private function _permanently_delete_event($EVT_ID = 0)
2357
+	{
2358
+		// grab event id
2359
+		if (! $EVT_ID) {
2360
+			$msg = esc_html__(
2361
+				'An error occurred. No Event ID or an invalid Event ID was received.',
2362
+				'event_espresso'
2363
+			);
2364
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2365
+			return false;
2366
+		}
2367
+		if (
2368
+			! $this->_cpt_model_obj instanceof EE_Event
2369
+			|| $this->_cpt_model_obj->ID() !== $EVT_ID
2370
+		) {
2371
+			$this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2372
+		}
2373
+		if (! $this->_cpt_model_obj instanceof EE_Event) {
2374
+			return false;
2375
+		}
2376
+		// need to delete related tickets and prices first.
2377
+		$datetimes = $this->_cpt_model_obj->get_many_related('Datetime');
2378
+		foreach ($datetimes as $datetime) {
2379
+			$this->_cpt_model_obj->_remove_relation_to($datetime, 'Datetime');
2380
+			$tickets = $datetime->get_many_related('Ticket');
2381
+			foreach ($tickets as $ticket) {
2382
+				$ticket->_remove_relation_to($datetime, 'Datetime');
2383
+				$ticket->delete_related_permanently('Price');
2384
+				$ticket->delete_permanently();
2385
+			}
2386
+			$datetime->delete();
2387
+		}
2388
+		// what about related venues or terms?
2389
+		$venues = $this->_cpt_model_obj->get_many_related('Venue');
2390
+		foreach ($venues as $venue) {
2391
+			$this->_cpt_model_obj->_remove_relation_to($venue, 'Venue');
2392
+		}
2393
+		// any attached question groups?
2394
+		$question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2395
+		if (! empty($question_groups)) {
2396
+			foreach ($question_groups as $question_group) {
2397
+				$this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2398
+			}
2399
+		}
2400
+		// Message Template Groups
2401
+		$this->_cpt_model_obj->_remove_relations('Message_Template_Group');
2402
+		/** @type EE_Term_Taxonomy[] $term_taxonomies */
2403
+		$term_taxonomies = $this->_cpt_model_obj->term_taxonomies();
2404
+		foreach ($term_taxonomies as $term_taxonomy) {
2405
+			$this->_cpt_model_obj->remove_relation_to_term_taxonomy($term_taxonomy);
2406
+		}
2407
+		$success = $this->_cpt_model_obj->delete_permanently();
2408
+		// did it all go as planned ?
2409
+		if ($success) {
2410
+			$msg = sprintf(esc_html__('Event ID # %d has been deleted.', 'event_espresso'), $EVT_ID);
2411
+			EE_Error::add_success($msg);
2412
+		} else {
2413
+			$msg = sprintf(
2414
+				esc_html__('An error occurred. Event ID # %d could not be deleted.', 'event_espresso'),
2415
+				$EVT_ID
2416
+			);
2417
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2418
+			return false;
2419
+		}
2420
+		do_action('AHEE__Events_Admin_Page___permanently_delete_event__after_event_deleted', $EVT_ID);
2421
+		return true;
2422
+	}
2423
+
2424
+
2425
+	/**
2426
+	 * get total number of events
2427
+	 *
2428
+	 * @access public
2429
+	 * @return int
2430
+	 * @throws EE_Error
2431
+	 * @throws InvalidArgumentException
2432
+	 * @throws InvalidDataTypeException
2433
+	 * @throws InvalidInterfaceException
2434
+	 */
2435
+	public function total_events()
2436
+	{
2437
+		$count = EEM_Event::instance()->count(['caps' => 'read_admin'], 'EVT_ID', true);
2438
+		return $count;
2439
+	}
2440
+
2441
+
2442
+	/**
2443
+	 * get total number of draft events
2444
+	 *
2445
+	 * @access public
2446
+	 * @return int
2447
+	 * @throws EE_Error
2448
+	 * @throws InvalidArgumentException
2449
+	 * @throws InvalidDataTypeException
2450
+	 * @throws InvalidInterfaceException
2451
+	 */
2452
+	public function total_events_draft()
2453
+	{
2454
+		$where = [
2455
+			'status' => ['IN', ['draft', 'auto-draft']],
2456
+		];
2457
+		$count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2458
+		return $count;
2459
+	}
2460
+
2461
+
2462
+	/**
2463
+	 * get total number of trashed events
2464
+	 *
2465
+	 * @access public
2466
+	 * @return int
2467
+	 * @throws EE_Error
2468
+	 * @throws InvalidArgumentException
2469
+	 * @throws InvalidDataTypeException
2470
+	 * @throws InvalidInterfaceException
2471
+	 */
2472
+	public function total_trashed_events()
2473
+	{
2474
+		$where = [
2475
+			'status' => 'trash',
2476
+		];
2477
+		$count = EEM_Event::instance()->count([$where, 'caps' => 'read_admin'], 'EVT_ID', true);
2478
+		return $count;
2479
+	}
2480
+
2481
+
2482
+	/**
2483
+	 *    _default_event_settings
2484
+	 *    This generates the Default Settings Tab
2485
+	 *
2486
+	 * @return void
2487
+	 * @throws DomainException
2488
+	 * @throws EE_Error
2489
+	 * @throws InvalidArgumentException
2490
+	 * @throws InvalidDataTypeException
2491
+	 * @throws InvalidInterfaceException
2492
+	 */
2493
+	protected function _default_event_settings()
2494
+	{
2495
+		$this->_set_add_edit_form_tags('update_default_event_settings');
2496
+		$this->_set_publish_post_box_vars(null, false, false, null, false);
2497
+		$this->_template_args['admin_page_content'] = $this->_default_event_settings_form()->get_html();
2498
+		$this->display_admin_page_with_sidebar();
2499
+	}
2500
+
2501
+
2502
+	/**
2503
+	 * Return the form for event settings.
2504
+	 *
2505
+	 * @return EE_Form_Section_Proper
2506
+	 * @throws EE_Error
2507
+	 */
2508
+	protected function _default_event_settings_form()
2509
+	{
2510
+		$registration_config = EE_Registry::instance()->CFG->registration;
2511
+		$registration_stati_for_selection = EEM_Registration::reg_status_array(
2512
+		// exclude
2513
+			[
2514
+				EEM_Registration::status_id_cancelled,
2515
+				EEM_Registration::status_id_declined,
2516
+				EEM_Registration::status_id_incomplete,
2517
+				EEM_Registration::status_id_wait_list,
2518
+			],
2519
+			true
2520
+		);
2521
+		return new EE_Form_Section_Proper(
2522
+			[
2523
+				'name'            => 'update_default_event_settings',
2524
+				'html_id'         => 'update_default_event_settings',
2525
+				'html_class'      => 'form-table',
2526
+				'layout_strategy' => new EE_Admin_Two_Column_Layout(),
2527
+				'subsections'     => apply_filters(
2528
+					'FHEE__Events_Admin_Page___default_event_settings_form__form_subsections',
2529
+					[
2530
+						'default_reg_status'  => new EE_Select_Input(
2531
+							$registration_stati_for_selection,
2532
+							[
2533
+								'default'         => isset($registration_config->default_STS_ID)
2534
+													 && array_key_exists(
2535
+														 $registration_config->default_STS_ID,
2536
+														 $registration_stati_for_selection
2537
+													 )
2538
+									? sanitize_text_field($registration_config->default_STS_ID)
2539
+									: EEM_Registration::status_id_pending_payment,
2540
+								'html_label_text' => esc_html__('Default Registration Status', 'event_espresso')
2541
+													 . EEH_Template::get_help_tab_link(
2542
+														 'default_settings_status_help_tab'
2543
+													 ),
2544
+								'html_help_text'  => esc_html__(
2545
+									'This setting allows you to preselect what the default registration status setting is when creating an event.  Note that changing this setting does NOT retroactively apply it to existing events.',
2546
+									'event_espresso'
2547
+								),
2548
+							]
2549
+						),
2550
+						'default_max_tickets' => new EE_Integer_Input(
2551
+							[
2552
+								'default'         => isset($registration_config->default_maximum_number_of_tickets)
2553
+									? $registration_config->default_maximum_number_of_tickets
2554
+									: EEM_Event::get_default_additional_limit(),
2555
+								'html_label_text' => esc_html__(
2556
+									'Default Maximum Tickets Allowed Per Order:',
2557
+									'event_espresso'
2558
+								)
2559
+													 . EEH_Template::get_help_tab_link(
2560
+														 'default_maximum_tickets_help_tab"'
2561
+													 ),
2562
+								'html_help_text'  => esc_html__(
2563
+									'This setting allows you to indicate what will be the default for the maximum number of tickets per order when creating new events.',
2564
+									'event_espresso'
2565
+								),
2566
+							]
2567
+						),
2568
+					]
2569
+				),
2570
+			]
2571
+		);
2572
+	}
2573
+
2574
+
2575
+	/**
2576
+	 * @return void
2577
+	 * @throws EE_Error
2578
+	 * @throws InvalidArgumentException
2579
+	 * @throws InvalidDataTypeException
2580
+	 * @throws InvalidInterfaceException
2581
+	 */
2582
+	protected function _update_default_event_settings()
2583
+	{
2584
+		$form = $this->_default_event_settings_form();
2585
+		if ($form->was_submitted()) {
2586
+			$form->receive_form_submission();
2587
+			if ($form->is_valid()) {
2588
+				$registration_config = EE_Registry::instance()->CFG->registration;
2589
+				$valid_data = $form->valid_data();
2590
+				if (isset($valid_data['default_reg_status'])) {
2591
+					$registration_config->default_STS_ID = $valid_data['default_reg_status'];
2592
+				}
2593
+				if (isset($valid_data['default_max_tickets'])) {
2594
+					$registration_config->default_maximum_number_of_tickets = $valid_data['default_max_tickets'];
2595
+				}
2596
+				do_action(
2597
+					'AHEE__Events_Admin_Page___update_default_event_settings',
2598
+					$valid_data,
2599
+					EE_Registry::instance()->CFG,
2600
+					$this
2601
+				);
2602
+				// update because data was valid!
2603
+				EE_Registry::instance()->CFG->update_espresso_config();
2604
+				EE_Error::overwrite_success();
2605
+				EE_Error::add_success(
2606
+					__('Default Event Settings were updated', 'event_espresso')
2607
+				);
2608
+			}
2609
+		}
2610
+		$this->_redirect_after_action(0, '', '', ['action' => 'default_event_settings'], true);
2611
+	}
2612
+
2613
+
2614
+	/*************        Templates        *************/
2615
+	protected function _template_settings()
2616
+	{
2617
+		$this->_admin_page_title = esc_html__('Template Settings (Preview)', 'event_espresso');
2618
+		$this->_template_args['preview_img'] = '<img src="'
2619
+											   . EVENTS_ASSETS_URL
2620
+											   . '/images/'
2621
+											   . 'caffeinated_template_features.jpg" alt="'
2622
+											   . esc_attr__('Template Settings Preview screenshot', 'event_espresso')
2623
+											   . '" />';
2624
+		$this->_template_args['preview_text'] = '<strong>'
2625
+												. esc_html__(
2626
+													'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2627
+													'event_espresso'
2628
+												) . '</strong>';
2629
+		$this->display_admin_caf_preview_page('template_settings_tab');
2630
+	}
2631
+
2632
+
2633
+	/** Event Category Stuff **/
2634
+	/**
2635
+	 * set the _category property with the category object for the loaded page.
2636
+	 *
2637
+	 * @access private
2638
+	 * @return void
2639
+	 */
2640
+	private function _set_category_object()
2641
+	{
2642
+		if (isset($this->_category->id) && ! empty($this->_category->id)) {
2643
+			return;
2644
+		} //already have the category object so get out.
2645
+		// set default category object
2646
+		$this->_set_empty_category_object();
2647
+		// only set if we've got an id
2648
+		if (! isset($this->_req_data['EVT_CAT_ID'])) {
2649
+			return;
2650
+		}
2651
+		$category_id = absint($this->_req_data['EVT_CAT_ID']);
2652
+		$term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2653
+		if (! empty($term)) {
2654
+			$this->_category->category_name = $term->name;
2655
+			$this->_category->category_identifier = $term->slug;
2656
+			$this->_category->category_desc = $term->description;
2657
+			$this->_category->id = $term->term_id;
2658
+			$this->_category->parent = $term->parent;
2659
+		}
2660
+	}
2661
+
2662
+
2663
+	/**
2664
+	 * Clears out category properties.
2665
+	 */
2666
+	private function _set_empty_category_object()
2667
+	{
2668
+		$this->_category = new stdClass();
2669
+		$this->_category->category_name = $this->_category->category_identifier = $this->_category->category_desc = '';
2670
+		$this->_category->id = $this->_category->parent = 0;
2671
+	}
2672
+
2673
+
2674
+	/**
2675
+	 * @throws DomainException
2676
+	 * @throws EE_Error
2677
+	 * @throws InvalidArgumentException
2678
+	 * @throws InvalidDataTypeException
2679
+	 * @throws InvalidInterfaceException
2680
+	 */
2681
+	protected function _category_list_table()
2682
+	{
2683
+		do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2684
+		$this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2685
+		$this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2686
+			'add_category',
2687
+			'add_category',
2688
+			[],
2689
+			'add-new-h2'
2690
+		);
2691
+		$this->display_admin_list_table_page_with_sidebar();
2692
+	}
2693
+
2694
+
2695
+	/**
2696
+	 * Output category details view.
2697
+	 *
2698
+	 * @param string $view
2699
+	 * @throws DomainException
2700
+	 * @throws EE_Error
2701
+	 * @throws InvalidArgumentException
2702
+	 * @throws InvalidDataTypeException
2703
+	 * @throws InvalidInterfaceException
2704
+	 */
2705
+	protected function _category_details($view)
2706
+	{
2707
+		// load formatter helper
2708
+		// load field generator helper
2709
+		$route = $view === 'edit' ? 'update_category' : 'insert_category';
2710
+		$this->_set_add_edit_form_tags($route);
2711
+		$this->_set_category_object();
2712
+		$id = ! empty($this->_category->id) ? $this->_category->id : '';
2713
+		$delete_action = 'delete_category';
2714
+		// custom redirect
2715
+		$redirect = EE_Admin_Page::add_query_args_and_nonce(
2716
+			['action' => 'category_list'],
2717
+			$this->_admin_base_url
2718
+		);
2719
+		$this->_set_publish_post_box_vars('EVT_CAT_ID', $id, $delete_action, $redirect);
2720
+		// take care of contents
2721
+		$this->_template_args['admin_page_content'] = $this->_category_details_content();
2722
+		$this->display_admin_page_with_sidebar();
2723
+	}
2724
+
2725
+
2726
+	/**
2727
+	 * Output category details content.
2728
+	 *
2729
+	 * @throws DomainException
2730
+	 */
2731
+	protected function _category_details_content()
2732
+	{
2733
+		$editor_args['category_desc'] = [
2734
+			'type'          => 'wp_editor',
2735
+			'value'         => EEH_Formatter::admin_format_content($this->_category->category_desc),
2736
+			'class'         => 'my_editor_custom',
2737
+			'wpeditor_args' => ['media_buttons' => false],
2738
+		];
2739
+		$_wp_editor = $this->_generate_admin_form_fields($editor_args, 'array');
2740
+		$all_terms = get_terms(
2741
+			[EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY],
2742
+			['hide_empty' => 0, 'exclude' => [$this->_category->id]]
2743
+		);
2744
+		// setup category select for term parents.
2745
+		$category_select_values[] = [
2746
+			'text' => esc_html__('No Parent', 'event_espresso'),
2747
+			'id'   => 0,
2748
+		];
2749
+		foreach ($all_terms as $term) {
2750
+			$category_select_values[] = [
2751
+				'text' => $term->name,
2752
+				'id'   => $term->term_id,
2753
+			];
2754
+		}
2755
+		$category_select = EEH_Form_Fields::select_input(
2756
+			'category_parent',
2757
+			$category_select_values,
2758
+			$this->_category->parent
2759
+		);
2760
+		$template_args = [
2761
+			'category'                 => $this->_category,
2762
+			'category_select'          => $category_select,
2763
+			'unique_id_info_help_link' => $this->_get_help_tab_link('unique_id_info'),
2764
+			'category_desc_editor'     => $_wp_editor['category_desc']['field'],
2765
+			'disable'                  => '',
2766
+			'disabled_message'         => false,
2767
+		];
2768
+		$template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2769
+		return EEH_Template::display_template($template, $template_args, true);
2770
+	}
2771
+
2772
+
2773
+	/**
2774
+	 * Handles deleting categories.
2775
+	 */
2776
+	protected function _delete_categories()
2777
+	{
2778
+		$cat_ids = isset($this->_req_data['EVT_CAT_ID']) ? (array) $this->_req_data['EVT_CAT_ID']
2779
+			: (array) $this->_req_data['category_id'];
2780
+		foreach ($cat_ids as $cat_id) {
2781
+			$this->_delete_category($cat_id);
2782
+		}
2783
+		// doesn't matter what page we're coming from... we're going to the same place after delete.
2784
+		$query_args = [
2785
+			'action' => 'category_list',
2786
+		];
2787
+		$this->_redirect_after_action(0, '', '', $query_args);
2788
+	}
2789
+
2790
+
2791
+	/**
2792
+	 * Handles deleting specific category.
2793
+	 *
2794
+	 * @param int $cat_id
2795
+	 */
2796
+	protected function _delete_category($cat_id)
2797
+	{
2798
+		$cat_id = absint($cat_id);
2799
+		wp_delete_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2800
+	}
2801
+
2802
+
2803
+	/**
2804
+	 * Handles triggering the update or insertion of a new category.
2805
+	 *
2806
+	 * @param bool $new_category true means we're triggering the insert of a new category.
2807
+	 * @throws EE_Error
2808
+	 * @throws InvalidArgumentException
2809
+	 * @throws InvalidDataTypeException
2810
+	 * @throws InvalidInterfaceException
2811
+	 */
2812
+	protected function _insert_or_update_category($new_category)
2813
+	{
2814
+		$cat_id = $new_category ? $this->_insert_category() : $this->_insert_category(true);
2815
+		$success = 0; // we already have a success message so lets not send another.
2816
+		if ($cat_id) {
2817
+			$query_args = [
2818
+				'action'     => 'edit_category',
2819
+				'EVT_CAT_ID' => $cat_id,
2820
+			];
2821
+		} else {
2822
+			$query_args = ['action' => 'add_category'];
2823
+		}
2824
+		$this->_redirect_after_action($success, '', '', $query_args, true);
2825
+	}
2826
+
2827
+
2828
+	/**
2829
+	 * Inserts or updates category
2830
+	 *
2831
+	 * @param bool $update (true indicates we're updating a category).
2832
+	 * @return bool|mixed|string
2833
+	 */
2834
+	private function _insert_category($update = false)
2835
+	{
2836
+		$cat_id = $update ? $this->_req_data['EVT_CAT_ID'] : '';
2837
+		$category_name = isset($this->_req_data['category_name']) ? $this->_req_data['category_name'] : '';
2838
+		$category_desc = isset($this->_req_data['category_desc']) ? $this->_req_data['category_desc'] : '';
2839
+		$category_parent = isset($this->_req_data['category_parent']) ? $this->_req_data['category_parent'] : 0;
2840
+		if (empty($category_name)) {
2841
+			$msg = esc_html__('You must add a name for the category.', 'event_espresso');
2842
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2843
+			return false;
2844
+		}
2845
+		$term_args = [
2846
+			'name'        => $category_name,
2847
+			'description' => $category_desc,
2848
+			'parent'      => $category_parent,
2849
+		];
2850
+		// was the category_identifier input disabled?
2851
+		if (isset($this->_req_data['category_identifier'])) {
2852
+			$term_args['slug'] = $this->_req_data['category_identifier'];
2853
+		}
2854
+		$insert_ids = $update
2855
+			? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2856
+			: wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2857
+		if (! is_array($insert_ids)) {
2858
+			$msg = esc_html__(
2859
+				'An error occurred and the category has not been saved to the database.',
2860
+				'event_espresso'
2861
+			);
2862
+			EE_Error::add_error($msg, __FILE__, __FUNCTION__, __LINE__);
2863
+		} else {
2864
+			$cat_id = $insert_ids['term_id'];
2865
+			$msg = sprintf(esc_html__('The category %s was successfully saved', 'event_espresso'), $category_name);
2866
+			EE_Error::add_success($msg);
2867
+		}
2868
+		return $cat_id;
2869
+	}
2870
+
2871
+
2872
+	/**
2873
+	 * Gets categories or count of categories matching the arguments in the request.
2874
+	 *
2875
+	 * @param int  $per_page
2876
+	 * @param int  $current_page
2877
+	 * @param bool $count
2878
+	 * @return EE_Base_Class[]|EE_Term_Taxonomy[]|int
2879
+	 * @throws EE_Error
2880
+	 * @throws InvalidArgumentException
2881
+	 * @throws InvalidDataTypeException
2882
+	 * @throws InvalidInterfaceException
2883
+	 */
2884
+	public function get_categories($per_page = 10, $current_page = 1, $count = false)
2885
+	{
2886
+		// testing term stuff
2887
+		$orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'Term.term_id';
2888
+		$order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
2889
+		$limit = ($current_page - 1) * $per_page;
2890
+		$where = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2891
+		if (isset($this->_req_data['s'])) {
2892
+			$sstr = '%' . $this->_req_data['s'] . '%';
2893
+			$where['OR'] = [
2894
+				'Term.name'   => ['LIKE', $sstr],
2895
+				'description' => ['LIKE', $sstr],
2896
+			];
2897
+		}
2898
+		$query_params = [
2899
+			$where,
2900
+			'order_by'   => [$orderby => $order],
2901
+			'limit'      => $limit . ',' . $per_page,
2902
+			'force_join' => ['Term'],
2903
+		];
2904
+		$categories = $count
2905
+			? EEM_Term_Taxonomy::instance()->count($query_params, 'term_id')
2906
+			: EEM_Term_Taxonomy::instance()->get_all($query_params);
2907
+		return $categories;
2908
+	}
2909
+
2910
+	/* end category stuff */
2911
+	/**************/
2912
+
2913
+
2914
+	/**
2915
+	 * Callback for the `ee_save_timezone_setting` ajax action.
2916
+	 *
2917
+	 * @throws EE_Error
2918
+	 * @throws InvalidArgumentException
2919
+	 * @throws InvalidDataTypeException
2920
+	 * @throws InvalidInterfaceException
2921
+	 */
2922
+	public function save_timezonestring_setting()
2923
+	{
2924
+		$timezone_string = isset($this->_req_data['timezone_selected'])
2925
+			? $this->_req_data['timezone_selected']
2926
+			: '';
2927
+		if (empty($timezone_string) || ! EEH_DTT_Helper::validate_timezone($timezone_string, false)) {
2928
+			EE_Error::add_error(
2929
+				esc_html__('An invalid timezone string submitted.', 'event_espresso'),
2930
+				__FILE__,
2931
+				__FUNCTION__,
2932
+				__LINE__
2933
+			);
2934
+			$this->_template_args['error'] = true;
2935
+			$this->_return_json();
2936
+		}
2937
+
2938
+		update_option('timezone_string', $timezone_string);
2939
+		EE_Error::add_success(
2940
+			esc_html__('Your timezone string was updated.', 'event_espresso')
2941
+		);
2942
+		$this->_template_args['success'] = true;
2943
+		$this->_return_json(true, ['action' => 'create_new']);
2944
+	}
2945 2945
 }
Please login to merge, or discard this patch.
Spacing   +71 added lines, -71 removed lines patch added patch discarded remove patch
@@ -511,7 +511,7 @@  discard block
 block discarded – undo
511 511
         ];
512 512
         // only load EE_Event_Editor_Decaf_Tips if domain is not caffeinated
513 513
         $domain = $this->loader->getShared('EventEspresso\core\domain\Domain');
514
-        if (! $domain->isCaffeinated()) {
514
+        if ( ! $domain->isCaffeinated()) {
515 515
             $this->_page_config['create_new']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
516 516
             $this->_page_config['edit']['qtips'] = ['EE_Event_Editor_Decaf_Tips'];
517 517
         }
@@ -570,13 +570,13 @@  discard block
 block discarded – undo
570 570
     {
571 571
         wp_register_style(
572 572
             'events-admin-css',
573
-            EVENTS_ASSETS_URL . 'events-admin-page.css',
573
+            EVENTS_ASSETS_URL.'events-admin-page.css',
574 574
             [],
575 575
             EVENT_ESPRESSO_VERSION
576 576
         );
577 577
         wp_register_style(
578 578
             'ee-cat-admin',
579
-            EVENTS_ASSETS_URL . 'ee-cat-admin.css',
579
+            EVENTS_ASSETS_URL.'ee-cat-admin.css',
580 580
             [],
581 581
             EVENT_ESPRESSO_VERSION
582 582
         );
@@ -585,7 +585,7 @@  discard block
 block discarded – undo
585 585
         // scripts
586 586
         wp_register_script(
587 587
             'event_editor_js',
588
-            EVENTS_ASSETS_URL . 'event_editor.js',
588
+            EVENTS_ASSETS_URL.'event_editor.js',
589 589
             ['ee_admin_js', 'jquery-ui-slider', 'jquery-ui-timepicker-addon'],
590 590
             EVENT_ESPRESSO_VERSION,
591 591
             true
@@ -611,16 +611,16 @@  discard block
 block discarded – undo
611 611
         wp_enqueue_style('espresso-ui-theme');
612 612
         wp_register_style(
613 613
             'event-editor-css',
614
-            EVENTS_ASSETS_URL . 'event-editor.css',
614
+            EVENTS_ASSETS_URL.'event-editor.css',
615 615
             ['ee-admin-css'],
616 616
             EVENT_ESPRESSO_VERSION
617 617
         );
618 618
         wp_enqueue_style('event-editor-css');
619 619
         // scripts
620
-        if (! $this->admin_config->useAdvancedEditor()) {
620
+        if ( ! $this->admin_config->useAdvancedEditor()) {
621 621
             wp_register_script(
622 622
                 'event-datetime-metabox',
623
-                EVENTS_ASSETS_URL . 'event-datetime-metabox.js',
623
+                EVENTS_ASSETS_URL.'event-datetime-metabox.js',
624 624
                 ['event_editor_js', 'ee-datepicker'],
625 625
                 EVENT_ESPRESSO_VERSION
626 626
             );
@@ -690,15 +690,15 @@  discard block
 block discarded – undo
690 690
     public function verify_event_edit($event = null, $req_type = '')
691 691
     {
692 692
         // don't need to do this when processing
693
-        if (! empty($req_type)) {
693
+        if ( ! empty($req_type)) {
694 694
             return;
695 695
         }
696 696
         // no event?
697
-        if (! $event instanceof EE_Event) {
697
+        if ( ! $event instanceof EE_Event) {
698 698
             $event = $this->_cpt_model_obj;
699 699
         }
700 700
         // STILL no event?
701
-        if (! $event instanceof EE_Event) {
701
+        if ( ! $event instanceof EE_Event) {
702 702
             return;
703 703
         }
704 704
         $orig_status = $event->status();
@@ -738,7 +738,7 @@  discard block
 block discarded – undo
738 738
             );
739 739
         }
740 740
         // now we need to determine if the event has any tickets on sale.  If not then we dont' show the error
741
-        if (! $event->tickets_on_sale()) {
741
+        if ( ! $event->tickets_on_sale()) {
742 742
             return;
743 743
         }
744 744
         // made it here so show warning
@@ -784,7 +784,7 @@  discard block
 block discarded – undo
784 784
     {
785 785
         $has_timezone_string = get_option('timezone_string');
786 786
         // only nag them about setting their timezone if it's their first event, and they haven't already done it
787
-        if (! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
787
+        if ( ! $has_timezone_string && ! EEM_Event::instance()->exists([])) {
788 788
             EE_Error::add_attention(
789 789
                 sprintf(
790 790
                     __(
@@ -868,31 +868,31 @@  discard block
 block discarded – undo
868 868
         $items = apply_filters('FHEE__Events_Admin_Page___event_legend_items__items', $items);
869 869
         $statuses = [
870 870
             'sold_out_status'  => [
871
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::sold_out,
871
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::sold_out,
872 872
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::sold_out, false, 'sentence'),
873 873
             ],
874 874
             'active_status'    => [
875
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::active,
875
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::active,
876 876
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::active, false, 'sentence'),
877 877
             ],
878 878
             'upcoming_status'  => [
879
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::upcoming,
879
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::upcoming,
880 880
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::upcoming, false, 'sentence'),
881 881
             ],
882 882
             'postponed_status' => [
883
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::postponed,
883
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::postponed,
884 884
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::postponed, false, 'sentence'),
885 885
             ],
886 886
             'cancelled_status' => [
887
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::cancelled,
887
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::cancelled,
888 888
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::cancelled, false, 'sentence'),
889 889
             ],
890 890
             'expired_status'   => [
891
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::expired,
891
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::expired,
892 892
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::expired, false, 'sentence'),
893 893
             ],
894 894
             'inactive_status'  => [
895
-                'class' => 'ee-status-legend ee-status-legend-' . EE_Datetime::inactive,
895
+                'class' => 'ee-status-legend ee-status-legend-'.EE_Datetime::inactive,
896 896
                 'desc'  => EEH_Template::pretty_status(EE_Datetime::inactive, false, 'sentence'),
897 897
             ],
898 898
         ];
@@ -907,7 +907,7 @@  discard block
 block discarded – undo
907 907
      */
908 908
     private function eventModel()
909 909
     {
910
-        if (! $this->_event_model instanceof EEM_Event) {
910
+        if ( ! $this->_event_model instanceof EEM_Event) {
911 911
             $this->_event_model = EEM_Event::instance();
912 912
         }
913 913
         return $this->_event_model;
@@ -921,7 +921,7 @@  discard block
 block discarded – undo
921 921
      */
922 922
     private function datetimeModel($event_timezone_string = '')
923 923
     {
924
-        if (! $this->datetime_model instanceof EEM_Datetime) {
924
+        if ( ! $this->datetime_model instanceof EEM_Datetime) {
925 925
             $this->datetime_model = EEM_Datetime::instance($event_timezone_string);
926 926
         }
927 927
         return $this->datetime_model;
@@ -935,7 +935,7 @@  discard block
 block discarded – undo
935 935
      */
936 936
     private function ticketModel($event_timezone_string = '')
937 937
     {
938
-        if (! $this->ticket_model instanceof EEM_Ticket) {
938
+        if ( ! $this->ticket_model instanceof EEM_Ticket) {
939 939
             $this->ticket_model = EEM_Ticket::instance($event_timezone_string);
940 940
         }
941 941
         return $this->ticket_model;
@@ -955,7 +955,7 @@  discard block
 block discarded – undo
955 955
     public function extra_permalink_field_buttons($return, $id, $new_title, $new_slug)
956 956
     {
957 957
         // make sure this is only when editing
958
-        if (! empty($id)) {
958
+        if ( ! empty($id)) {
959 959
             $post = get_post($id);
960 960
             $return .= '<a class="button button-small" onclick="prompt(\'Shortcode:\', jQuery(\'#shortcode\').val()); return false;" href="#"  tabindex="-1">'
961 961
                        . esc_html__('Shortcode', 'event_espresso')
@@ -993,7 +993,7 @@  discard block
 block discarded – undo
993 993
                                                                                   'button'
994 994
                                                                               );
995 995
         $this->_template_args['after_list_table']['legend'] = $this->_display_legend($this->_event_legend_items());
996
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
996
+        $this->_admin_page_title .= ' '.$this->get_action_link_or_button(
997 997
             'create_new',
998 998
             'add',
999 999
             [],
@@ -1056,7 +1056,7 @@  discard block
 block discarded – undo
1056 1056
         /** @var FeatureFlags $flags */
1057 1057
         $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1058 1058
         // check if the new EDTR reg options meta box is being used, and if so, don't run updates for legacy version
1059
-        if (! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1059
+        if ( ! $this->admin_config->useAdvancedEditor() || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1060 1060
             $event_values['EVT_display_ticket_selector'] =
1061 1061
                 ! empty($this->_req_data['display_ticket_selector'])
1062 1062
                     ? 1
@@ -1169,7 +1169,7 @@  discard block
 block discarded – undo
1169 1169
      */
1170 1170
     protected function _default_venue_update(EE_Event $evtobj, $data)
1171 1171
     {
1172
-        require_once(EE_MODELS . 'EEM_Venue.model.php');
1172
+        require_once(EE_MODELS.'EEM_Venue.model.php');
1173 1173
         $venue_model = EEM_Venue::instance();
1174 1174
         $rows_affected = null;
1175 1175
         $venue_id = ! empty($data['venue_id']) ? $data['venue_id'] : null;
@@ -1200,7 +1200,7 @@  discard block
 block discarded – undo
1200 1200
             'status'              => 'publish',
1201 1201
         ];
1202 1202
         // if we've got the venue_id then we're just updating the existing venue so let's do that and then get out.
1203
-        if (! empty($venue_id)) {
1203
+        if ( ! empty($venue_id)) {
1204 1204
             $update_where = [$venue_model->primary_key_name() => $venue_id];
1205 1205
             $rows_affected = $venue_model->update($venue_array, [$update_where]);
1206 1206
             // we've gotta make sure that the venue is always attached to a revision.. add_relation_to should take care of making sure that the relation is already present.
@@ -1254,7 +1254,7 @@  discard block
 block discarded – undo
1254 1254
                 'DTT_order'     => $row,
1255 1255
             ];
1256 1256
             // if we have an id then let's get existing object first and then set the new values.  Otherwise we instantiate a new object for save.
1257
-            if (! empty($dtt['DTT_ID'])) {
1257
+            if ( ! empty($dtt['DTT_ID'])) {
1258 1258
                 $DTM = $this->datetimeModel($event_timezone_string)->get_one_by_ID($dtt['DTT_ID']);
1259 1259
                 $DTM->set_date_format($incoming_date_formats[0]);
1260 1260
                 $DTM->set_time_format($incoming_date_formats[1]);
@@ -1262,7 +1262,7 @@  discard block
 block discarded – undo
1262 1262
                     $DTM->set($field, $value);
1263 1263
                 }
1264 1264
                 // make sure the $dtt_id here is saved just in case after the add_relation_to() the autosave replaces it.  We need to do this so we dont' TRASH the parent DTT.
1265
-                $saved_dtts[ $DTM->ID() ] = $DTM;
1265
+                $saved_dtts[$DTM->ID()] = $DTM;
1266 1266
             } else {
1267 1267
                 $DTM = EE_Registry::instance()->load_class(
1268 1268
                     'Datetime',
@@ -1295,12 +1295,12 @@  discard block
 block discarded – undo
1295 1295
         foreach ($data['edit_tickets'] as $row => $tkt) {
1296 1296
             $incoming_date_formats = ['Y-m-d', 'h:i a'];
1297 1297
             $update_prices = false;
1298
-            $ticket_price = isset($data['edit_prices'][ $row ][1]['PRC_amount'])
1299
-                ? $data['edit_prices'][ $row ][1]['PRC_amount'] : 0;
1298
+            $ticket_price = isset($data['edit_prices'][$row][1]['PRC_amount'])
1299
+                ? $data['edit_prices'][$row][1]['PRC_amount'] : 0;
1300 1300
             // trim inputs to ensure any excess whitespace is removed.
1301 1301
             $tkt = array_map('trim', $tkt);
1302 1302
             if (empty($tkt['TKT_start_date'])) {
1303
-                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0] . ' ' . $incoming_date_formats[1]);
1303
+                $tkt['TKT_start_date'] = $now->format($incoming_date_formats[0].' '.$incoming_date_formats[1]);
1304 1304
             }
1305 1305
             if (empty($tkt['TKT_end_date'])) {
1306 1306
                 // use the start date of the first datetime
@@ -1335,7 +1335,7 @@  discard block
 block discarded – undo
1335 1335
             // if we have a TKT_ID then we need to get that existing TKT_obj and update it
1336 1336
             // we actually do our saves a head of doing any add_relations to because its entirely possible that this ticket didn't removed or added to any datetime in the session but DID have it's items modified.
1337 1337
             // keep in mind that if the TKT has been sold (and we have changed pricing information), then we won't be updating the tkt but instead a new tkt will be created and the old one archived.
1338
-            if (! empty($tkt['TKT_ID'])) {
1338
+            if ( ! empty($tkt['TKT_ID'])) {
1339 1339
                 $TKT = $this->ticketModel($event_timezone_string)->get_one_by_ID($tkt['TKT_ID']);
1340 1340
                 if ($TKT instanceof EE_Ticket) {
1341 1341
                     $ticket_sold = $TKT->count_related(
@@ -1374,7 +1374,7 @@  discard block
 block discarded – undo
1374 1374
                         $TKT->set('TKT_deleted', 1);
1375 1375
                         $TKT->save();
1376 1376
                         // make sure this ticket is still recorded in our saved_tkts so we don't run it through the regular trash routine.
1377
-                        $saved_tickets[ $TKT->ID() ] = $TKT;
1377
+                        $saved_tickets[$TKT->ID()] = $TKT;
1378 1378
                         // create new ticket that's a copy of the existing except a new id of course (and not archived) AND has the new TKT_price associated with it.
1379 1379
                         $TKT = clone $TKT;
1380 1380
                         $TKT->set('TKT_ID', 0);
@@ -1419,9 +1419,9 @@  discard block
 block discarded – undo
1419 1419
             }
1420 1420
             // initially let's add the ticket to the dtt
1421 1421
             $saved_dtt->_add_relation_to($TKT, 'Ticket');
1422
-            $saved_tickets[ $TKT->ID() ] = $TKT;
1422
+            $saved_tickets[$TKT->ID()] = $TKT;
1423 1423
             // add prices to ticket
1424
-            $this->_add_prices_to_ticket($data['edit_prices'][ $row ], $TKT, $update_prices);
1424
+            $this->_add_prices_to_ticket($data['edit_prices'][$row], $TKT, $update_prices);
1425 1425
         }
1426 1426
         // however now we need to handle permanently deleting tickets via the ui.  Keep in mind that the ui does not allow deleting/archiving tickets that have ticket sold.  However, it does allow for deleting tickets that have no tickets sold, in which case we want to get rid of permanently because there is no need to save in db.
1427 1427
         $old_tickets = isset($old_tickets[0]) && $old_tickets[0] === '' ? [] : $old_tickets;
@@ -1589,7 +1589,7 @@  discard block
 block discarded – undo
1589 1589
         $publish_box_extra_args['event_editor_overview_add'] = ob_get_clean();
1590 1590
         // load template
1591 1591
         EEH_Template::display_template(
1592
-            EVENTS_TEMPLATE_PATH . 'event_publish_box_extras.template.php',
1592
+            EVENTS_TEMPLATE_PATH.'event_publish_box_extras.template.php',
1593 1593
             $publish_box_extra_args
1594 1594
         );
1595 1595
     }
@@ -1625,7 +1625,7 @@  discard block
 block discarded – undo
1625 1625
         /** @var FeatureFlags $flags */
1626 1626
         $flags = $this->loader->getShared('EventEspresso\core\domain\services\capabilities\FeatureFlags');
1627 1627
         // check if the new EDTR reg options meta box is being used, and if so, don't load the legacy version
1628
-        if (! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1628
+        if ( ! $use_advanced_editor || ! $flags->featureAllowed('use_reg_options_meta_box')) {
1629 1629
             add_meta_box(
1630 1630
                 'espresso_event_editor_event_options',
1631 1631
                 esc_html__('Event Registration Options', 'event_espresso'),
@@ -1634,7 +1634,7 @@  discard block
 block discarded – undo
1634 1634
                 'side'
1635 1635
             );
1636 1636
         }
1637
-        if (! $use_advanced_editor) {
1637
+        if ( ! $use_advanced_editor) {
1638 1638
             add_meta_box(
1639 1639
                 'espresso_event_editor_tickets',
1640 1640
                 esc_html__('Event Datetime & Ticket', 'event_espresso'),
@@ -1647,7 +1647,7 @@  discard block
 block discarded – undo
1647 1647
             if ($flags->featureAllowed('use_reg_options_meta_box')) {
1648 1648
                 add_action(
1649 1649
                     'add_meta_boxes_espresso_events',
1650
-                    function () {
1650
+                    function() {
1651 1651
                         global $current_screen;
1652 1652
                         remove_meta_box('authordiv', $current_screen, 'normal');
1653 1653
                     },
@@ -1712,7 +1712,7 @@  discard block
 block discarded – undo
1712 1712
                     'default_where_conditions' => 'none',
1713 1713
                 ]
1714 1714
             );
1715
-            if (! empty($related_tickets)) {
1715
+            if ( ! empty($related_tickets)) {
1716 1716
                 $template_args['total_ticket_rows'] = count($related_tickets);
1717 1717
                 $row = 0;
1718 1718
                 foreach ($related_tickets as $ticket) {
@@ -1746,7 +1746,7 @@  discard block
 block discarded – undo
1746 1746
         );
1747 1747
         $template = apply_filters(
1748 1748
             'FHEE__Events_Admin_Page__ticket_metabox__template',
1749
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_main.template.php'
1749
+            EVENTS_TEMPLATE_PATH.'event_tickets_metabox_main.template.php'
1750 1750
         );
1751 1751
         EEH_Template::display_template($template, $template_args);
1752 1752
     }
@@ -1770,7 +1770,7 @@  discard block
 block discarded – undo
1770 1770
     private function _get_ticket_row($ticket, $skeleton = false, $row = 0)
1771 1771
     {
1772 1772
         $template_args = [
1773
-            'tkt_status_class'    => ' tkt-status-' . $ticket->ticket_status(),
1773
+            'tkt_status_class'    => ' tkt-status-'.$ticket->ticket_status(),
1774 1774
             'tkt_archive_class'   => $ticket->ticket_status() === EE_Ticket::archived && ! $skeleton ? ' tkt-archived'
1775 1775
                 : '',
1776 1776
             'ticketrow'           => $skeleton ? 'TICKETNUM' : $row,
@@ -1782,10 +1782,10 @@  discard block
 block discarded – undo
1782 1782
             'TKT_qty'             => $ticket->get_pretty('TKT_qty', 'input'),
1783 1783
             'edit_ticketrow_name' => $skeleton ? 'TICKETNAMEATTR' : 'edit_tickets',
1784 1784
             'TKT_sold'            => $skeleton ? 0 : $ticket->get('TKT_sold'),
1785
-            'trash_icon'          => ($skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')))
1786
-                                     && (! empty($ticket) && $ticket->get('TKT_sold') === 0)
1785
+            'trash_icon'          => ($skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')))
1786
+                                     && ( ! empty($ticket) && $ticket->get('TKT_sold') === 0)
1787 1787
                 ? 'trash-icon dashicons dashicons-post-trash clickable' : 'ee-lock-icon',
1788
-            'disabled'            => $skeleton || (! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1788
+            'disabled'            => $skeleton || ( ! empty($ticket) && ! $ticket->get('TKT_deleted')) ? ''
1789 1789
                 : ' disabled=disabled',
1790 1790
         ];
1791 1791
         $price = $ticket->ID() !== 0
@@ -1812,7 +1812,7 @@  discard block
 block discarded – undo
1812 1812
                     ['order_by' => ['DTT_EVT_start' => 'ASC']]
1813 1813
                 )
1814 1814
                 : null;
1815
-            if (! empty($earliest_dtt)) {
1815
+            if ( ! empty($earliest_dtt)) {
1816 1816
                 $template_args['TKT_end_date'] = $earliest_dtt->get_datetime('DTT_EVT_start', 'Y-m-d', 'h:i a');
1817 1817
             } else {
1818 1818
                 $template_args['TKT_end_date'] = date(
@@ -1824,7 +1824,7 @@  discard block
 block discarded – undo
1824 1824
         $template_args = array_merge($template_args, $price_args);
1825 1825
         $template = apply_filters(
1826 1826
             'FHEE__Events_Admin_Page__get_ticket_row__template',
1827
-            EVENTS_TEMPLATE_PATH . 'event_tickets_metabox_ticket_row.template.php',
1827
+            EVENTS_TEMPLATE_PATH.'event_tickets_metabox_ticket_row.template.php',
1828 1828
             $ticket
1829 1829
         );
1830 1830
         return EEH_Template::display_template($template, $template_args, true);
@@ -1879,7 +1879,7 @@  discard block
 block discarded – undo
1879 1879
             $default_reg_status_values
1880 1880
         );
1881 1881
         EEH_Template::display_template(
1882
-            EVENTS_TEMPLATE_PATH . 'event_registration_options.template.php',
1882
+            EVENTS_TEMPLATE_PATH.'event_registration_options.template.php',
1883 1883
             $template_args
1884 1884
         );
1885 1885
     }
@@ -1909,7 +1909,7 @@  discard block
 block discarded – undo
1909 1909
     {
1910 1910
         $EEME = $this->eventModel();
1911 1911
         $offset = ($current_page - 1) * $per_page;
1912
-        $limit = $count ? null : $offset . ',' . $per_page;
1912
+        $limit = $count ? null : $offset.','.$per_page;
1913 1913
         $orderby = isset($this->_req_data['orderby']) ? $this->_req_data['orderby'] : 'EVT_ID';
1914 1914
         $order = isset($this->_req_data['order']) ? $this->_req_data['order'] : 'DESC';
1915 1915
         if (isset($this->_req_data['month_range'])) {
@@ -1938,7 +1938,7 @@  discard block
 block discarded – undo
1938 1938
         // categories?
1939 1939
         $category = isset($this->_req_data['EVT_CAT']) && $this->_req_data['EVT_CAT'] > 0
1940 1940
             ? $this->_req_data['EVT_CAT'] : null;
1941
-        if (! empty($category)) {
1941
+        if ( ! empty($category)) {
1942 1942
             $where['Term_Taxonomy.taxonomy'] = EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY;
1943 1943
             $where['Term_Taxonomy.term_id'] = $category;
1944 1944
         }
@@ -1946,7 +1946,7 @@  discard block
 block discarded – undo
1946 1946
         $start_formats = EEM_Datetime::instance()->get_formats_for('DTT_EVT_start');
1947 1947
         if (isset($this->_req_data['month_range']) && $this->_req_data['month_range'] !== '') {
1948 1948
             $DateTime = new DateTime(
1949
-                $year_r . '-' . $month_r . '-01 00:00:00',
1949
+                $year_r.'-'.$month_r.'-01 00:00:00',
1950 1950
                 new DateTimeZone('UTC')
1951 1951
             );
1952 1952
             $start = $DateTime->getTimestamp();
@@ -1972,7 +1972,7 @@  discard block
 block discarded – undo
1972 1972
                             ->format(implode(' ', $start_formats));
1973 1973
             $where['Datetime.DTT_EVT_start'] = ['BETWEEN', [$start, $end]];
1974 1974
         }
1975
-        if (! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1975
+        if ( ! EE_Registry::instance()->CAP->current_user_can('ee_read_others_events', 'get_events')) {
1976 1976
             $where['EVT_wp_user'] = get_current_user_id();
1977 1977
         } elseif (
1978 1978
             ! isset($where['status'])
@@ -1996,7 +1996,7 @@  discard block
 block discarded – undo
1996 1996
         }
1997 1997
         // search query handling
1998 1998
         if (isset($this->_req_data['s'])) {
1999
-            $search_string = '%' . $this->_req_data['s'] . '%';
1999
+            $search_string = '%'.$this->_req_data['s'].'%';
2000 2000
             $where['OR'] = [
2001 2001
                 'EVT_name'       => ['LIKE', $search_string],
2002 2002
                 'EVT_desc'       => ['LIKE', $search_string],
@@ -2111,7 +2111,7 @@  discard block
 block discarded – undo
2111 2111
             // clean status
2112 2112
             $event_status = sanitize_key($event_status);
2113 2113
             // grab status
2114
-            if (! empty($event_status)) {
2114
+            if ( ! empty($event_status)) {
2115 2115
                 $success = $this->_change_event_status($EVT_ID, $event_status);
2116 2116
             } else {
2117 2117
                 $success = false;
@@ -2153,7 +2153,7 @@  discard block
 block discarded – undo
2153 2153
         // clean status
2154 2154
         $event_status = sanitize_key($event_status);
2155 2155
         // grab status
2156
-        if (! empty($event_status)) {
2156
+        if ( ! empty($event_status)) {
2157 2157
             $success = true;
2158 2158
             // determine the event id and set to array.
2159 2159
             $EVT_IDs = isset($this->_req_data['EVT_IDs']) ? (array) $this->_req_data['EVT_IDs'] : [];
@@ -2205,7 +2205,7 @@  discard block
 block discarded – undo
2205 2205
     private function _change_event_status($EVT_ID = 0, $event_status = '')
2206 2206
     {
2207 2207
         // grab event id
2208
-        if (! $EVT_ID) {
2208
+        if ( ! $EVT_ID) {
2209 2209
             $msg = esc_html__(
2210 2210
                 'An error occurred. No Event ID or an invalid Event ID was received.',
2211 2211
                 'event_espresso'
@@ -2276,8 +2276,8 @@  discard block
 block discarded – undo
2276 2276
             // get list of events with no prices
2277 2277
             $espresso_no_ticket_prices = get_option('ee_no_ticket_prices', []);
2278 2278
             // remove this event from the list of events with no prices
2279
-            if (isset($espresso_no_ticket_prices[ $EVT_ID ])) {
2280
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2279
+            if (isset($espresso_no_ticket_prices[$EVT_ID])) {
2280
+                unset($espresso_no_ticket_prices[$EVT_ID]);
2281 2281
             }
2282 2282
             update_option('ee_no_ticket_prices', $espresso_no_ticket_prices);
2283 2283
         } else {
@@ -2324,7 +2324,7 @@  discard block
 block discarded – undo
2324 2324
                 $results = $this->_permanently_delete_event($EVT_ID);
2325 2325
                 $success = $results !== false ? $success : false;
2326 2326
                 // remove this event from the list of events with no prices
2327
-                unset($espresso_no_ticket_prices[ $EVT_ID ]);
2327
+                unset($espresso_no_ticket_prices[$EVT_ID]);
2328 2328
             } else {
2329 2329
                 $success = false;
2330 2330
                 $msg = esc_html__(
@@ -2356,7 +2356,7 @@  discard block
 block discarded – undo
2356 2356
     private function _permanently_delete_event($EVT_ID = 0)
2357 2357
     {
2358 2358
         // grab event id
2359
-        if (! $EVT_ID) {
2359
+        if ( ! $EVT_ID) {
2360 2360
             $msg = esc_html__(
2361 2361
                 'An error occurred. No Event ID or an invalid Event ID was received.',
2362 2362
                 'event_espresso'
@@ -2370,7 +2370,7 @@  discard block
 block discarded – undo
2370 2370
         ) {
2371 2371
             $this->_cpt_model_obj = EEM_Event::instance()->get_one_by_ID($EVT_ID);
2372 2372
         }
2373
-        if (! $this->_cpt_model_obj instanceof EE_Event) {
2373
+        if ( ! $this->_cpt_model_obj instanceof EE_Event) {
2374 2374
             return false;
2375 2375
         }
2376 2376
         // need to delete related tickets and prices first.
@@ -2392,7 +2392,7 @@  discard block
 block discarded – undo
2392 2392
         }
2393 2393
         // any attached question groups?
2394 2394
         $question_groups = $this->_cpt_model_obj->get_many_related('Question_Group');
2395
-        if (! empty($question_groups)) {
2395
+        if ( ! empty($question_groups)) {
2396 2396
             foreach ($question_groups as $question_group) {
2397 2397
                 $this->_cpt_model_obj->_remove_relation_to($question_group, 'Question_Group');
2398 2398
             }
@@ -2625,7 +2625,7 @@  discard block
 block discarded – undo
2625 2625
                                                 . esc_html__(
2626 2626
                                                     'Template Settings is a feature that is only available in the premium version of Event Espresso 4 which is available with a support license purchase on EventEspresso.com. Template Settings allow you to configure some of the appearance options for both the Event List and Event Details pages.',
2627 2627
                                                     'event_espresso'
2628
-                                                ) . '</strong>';
2628
+                                                ).'</strong>';
2629 2629
         $this->display_admin_caf_preview_page('template_settings_tab');
2630 2630
     }
2631 2631
 
@@ -2645,12 +2645,12 @@  discard block
 block discarded – undo
2645 2645
         // set default category object
2646 2646
         $this->_set_empty_category_object();
2647 2647
         // only set if we've got an id
2648
-        if (! isset($this->_req_data['EVT_CAT_ID'])) {
2648
+        if ( ! isset($this->_req_data['EVT_CAT_ID'])) {
2649 2649
             return;
2650 2650
         }
2651 2651
         $category_id = absint($this->_req_data['EVT_CAT_ID']);
2652 2652
         $term = get_term($category_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY);
2653
-        if (! empty($term)) {
2653
+        if ( ! empty($term)) {
2654 2654
             $this->_category->category_name = $term->name;
2655 2655
             $this->_category->category_identifier = $term->slug;
2656 2656
             $this->_category->category_desc = $term->description;
@@ -2682,7 +2682,7 @@  discard block
 block discarded – undo
2682 2682
     {
2683 2683
         do_action('AHEE_log', __FILE__, __FUNCTION__, '');
2684 2684
         $this->_search_btn_label = esc_html__('Categories', 'event_espresso');
2685
-        $this->_admin_page_title .= ' ' . $this->get_action_link_or_button(
2685
+        $this->_admin_page_title .= ' '.$this->get_action_link_or_button(
2686 2686
             'add_category',
2687 2687
             'add_category',
2688 2688
             [],
@@ -2765,7 +2765,7 @@  discard block
 block discarded – undo
2765 2765
             'disable'                  => '',
2766 2766
             'disabled_message'         => false,
2767 2767
         ];
2768
-        $template = EVENTS_TEMPLATE_PATH . 'event_category_details.template.php';
2768
+        $template = EVENTS_TEMPLATE_PATH.'event_category_details.template.php';
2769 2769
         return EEH_Template::display_template($template, $template_args, true);
2770 2770
     }
2771 2771
 
@@ -2854,7 +2854,7 @@  discard block
 block discarded – undo
2854 2854
         $insert_ids = $update
2855 2855
             ? wp_update_term($cat_id, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args)
2856 2856
             : wp_insert_term($category_name, EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY, $term_args);
2857
-        if (! is_array($insert_ids)) {
2857
+        if ( ! is_array($insert_ids)) {
2858 2858
             $msg = esc_html__(
2859 2859
                 'An error occurred and the category has not been saved to the database.',
2860 2860
                 'event_espresso'
@@ -2889,7 +2889,7 @@  discard block
 block discarded – undo
2889 2889
         $limit = ($current_page - 1) * $per_page;
2890 2890
         $where = ['taxonomy' => EEM_CPT_Base::EVENT_CATEGORY_TAXONOMY];
2891 2891
         if (isset($this->_req_data['s'])) {
2892
-            $sstr = '%' . $this->_req_data['s'] . '%';
2892
+            $sstr = '%'.$this->_req_data['s'].'%';
2893 2893
             $where['OR'] = [
2894 2894
                 'Term.name'   => ['LIKE', $sstr],
2895 2895
                 'description' => ['LIKE', $sstr],
@@ -2898,7 +2898,7 @@  discard block
 block discarded – undo
2898 2898
         $query_params = [
2899 2899
             $where,
2900 2900
             'order_by'   => [$orderby => $order],
2901
-            'limit'      => $limit . ',' . $per_page,
2901
+            'limit'      => $limit.','.$per_page,
2902 2902
             'force_join' => ['Term'],
2903 2903
         ];
2904 2904
         $categories = $count
Please login to merge, or discard this patch.
languages/event_espresso-translations-js.php 1 patch
Spacing   +497 added lines, -497 removed lines patch added patch discarded remove patch
@@ -2,226 +2,226 @@  discard block
 block discarded – undo
2 2
 /* THIS IS A GENERATED FILE. DO NOT EDIT DIRECTLY. */
3 3
 $generated_i18n_strings = array(
4 4
 	// Reference: packages/ui-components/src/Pagination/constants.ts:6
5
-	__( '2', 'event_espresso' ),
5
+	__('2', 'event_espresso'),
6 6
 
7 7
 	// Reference: packages/ui-components/src/Pagination/constants.ts:7
8
-	__( '6', 'event_espresso' ),
8
+	__('6', 'event_espresso'),
9 9
 
10 10
 	// Reference: packages/ui-components/src/Pagination/constants.ts:8
11
-	__( '12', 'event_espresso' ),
11
+	__('12', 'event_espresso'),
12 12
 
13 13
 	// Reference: packages/ui-components/src/Pagination/constants.ts:9
14
-	__( '24', 'event_espresso' ),
14
+	__('24', 'event_espresso'),
15 15
 
16 16
 	// Reference: packages/ui-components/src/Pagination/constants.ts:10
17
-	__( '48', 'event_espresso' ),
17
+	__('48', 'event_espresso'),
18 18
 
19 19
 	// Reference: domains/blocks/src/components/AvatarImage.tsx:27
20
-	__( 'contact avatar', 'event_espresso' ),
20
+	__('contact avatar', 'event_espresso'),
21 21
 
22 22
 	// Reference: domains/blocks/src/components/OrderByControl.tsx:12
23
-	__( 'Order by', 'event_espresso' ),
23
+	__('Order by', 'event_espresso'),
24 24
 
25 25
 	// Reference: domains/blocks/src/components/RegStatusControl.tsx:17
26 26
 	// Reference: domains/blocks/src/event-attendees/controls/SelectStatus.tsx:13
27
-	__( 'Select Registration Status', 'event_espresso' ),
27
+	__('Select Registration Status', 'event_espresso'),
28 28
 
29 29
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:14
30
-	__( 'Ascending', 'event_espresso' ),
30
+	__('Ascending', 'event_espresso'),
31 31
 
32 32
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:18
33
-	__( 'Descending', 'event_espresso' ),
33
+	__('Descending', 'event_espresso'),
34 34
 
35 35
 	// Reference: domains/blocks/src/components/SortOrderControl.tsx:24
36
-	__( 'Sort order:', 'event_espresso' ),
36
+	__('Sort order:', 'event_espresso'),
37 37
 
38 38
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:41
39
-	__( 'There was some error fetching attendees list', 'event_espresso' ),
39
+	__('There was some error fetching attendees list', 'event_espresso'),
40 40
 
41 41
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:47
42
-	__( 'To get started, select what event you want to show attendees from in the block settings.', 'event_espresso' ),
42
+	__('To get started, select what event you want to show attendees from in the block settings.', 'event_espresso'),
43 43
 
44 44
 	// Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:53
45
-	__( 'There are no attendees for selected options.', 'event_espresso' ),
45
+	__('There are no attendees for selected options.', 'event_espresso'),
46 46
 
47 47
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:12
48
-	__( 'Display on Archives', 'event_espresso' ),
48
+	__('Display on Archives', 'event_espresso'),
49 49
 
50 50
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17
51
-	__( 'Attendees are shown whenever this post is listed in an archive view.', 'event_espresso' ),
51
+	__('Attendees are shown whenever this post is listed in an archive view.', 'event_espresso'),
52 52
 
53 53
 	// Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:18
54
-	__( 'Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso' ),
54
+	__('Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso'),
55 55
 
56 56
 	// Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:29
57
-	__( 'Number of Attendees to Display:', 'event_espresso' ),
57
+	__('Number of Attendees to Display:', 'event_espresso'),
58 58
 
59 59
 	// Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:34
60 60
 	/* translators: %d attendees count */
61
-	_n_noop( 'Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso' ),
61
+	_n_noop('Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso'),
62 62
 
63 63
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:27
64
-	__( 'Display Gravatar', 'event_espresso' ),
64
+	__('Display Gravatar', 'event_espresso'),
65 65
 
66 66
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:32
67
-	__( 'Gravatar images are shown for each attendee.', 'event_espresso' ),
67
+	__('Gravatar images are shown for each attendee.', 'event_espresso'),
68 68
 
69 69
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:33
70
-	__( 'No gravatar images are shown for each attendee.', 'event_espresso' ),
70
+	__('No gravatar images are shown for each attendee.', 'event_espresso'),
71 71
 
72 72
 	// Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:38
73
-	__( 'Size of Gravatar', 'event_espresso' ),
73
+	__('Size of Gravatar', 'event_espresso'),
74 74
 
75 75
 	// Reference: domains/blocks/src/event-attendees/controls/SelectDatetime.tsx:22
76
-	__( 'Select Datetime', 'event_espresso' ),
76
+	__('Select Datetime', 'event_espresso'),
77 77
 
78 78
 	// Reference: domains/blocks/src/event-attendees/controls/SelectEvent.tsx:22
79
-	__( 'Select Event', 'event_espresso' ),
79
+	__('Select Event', 'event_espresso'),
80 80
 
81 81
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:11
82
-	__( 'Attendee id', 'event_espresso' ),
82
+	__('Attendee id', 'event_espresso'),
83 83
 
84 84
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:15
85
-	__( 'Last name only', 'event_espresso' ),
85
+	__('Last name only', 'event_espresso'),
86 86
 
87 87
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:19
88
-	__( 'First name only', 'event_espresso' ),
88
+	__('First name only', 'event_espresso'),
89 89
 
90 90
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:23
91
-	__( 'First, then Last name', 'event_espresso' ),
91
+	__('First, then Last name', 'event_espresso'),
92 92
 
93 93
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:27
94
-	__( 'Last, then First name', 'event_espresso' ),
94
+	__('Last, then First name', 'event_espresso'),
95 95
 
96 96
 	// Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:41
97
-	__( 'Order Attendees by:', 'event_espresso' ),
97
+	__('Order Attendees by:', 'event_espresso'),
98 98
 
99 99
 	// Reference: domains/blocks/src/event-attendees/controls/SelectTicket.tsx:22
100
-	__( 'Select Ticket', 'event_espresso' ),
100
+	__('Select Ticket', 'event_espresso'),
101 101
 
102 102
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:21
103
-	__( 'Filter By Settings', 'event_espresso' ),
103
+	__('Filter By Settings', 'event_espresso'),
104 104
 
105 105
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:36
106
-	__( 'Gravatar Setttings', 'event_espresso' ),
106
+	__('Gravatar Setttings', 'event_espresso'),
107 107
 
108 108
 	// Reference: domains/blocks/src/event-attendees/controls/index.tsx:39
109
-	__( 'Archive Settings', 'event_espresso' ),
109
+	__('Archive Settings', 'event_espresso'),
110 110
 
111 111
 	// Reference: domains/blocks/src/event-attendees/index.tsx:10
112
-	__( 'Event Attendees', 'event_espresso' ),
112
+	__('Event Attendees', 'event_espresso'),
113 113
 
114 114
 	// Reference: domains/blocks/src/event-attendees/index.tsx:11
115
-	__( 'Displays a list of people that have registered for the specified event', 'event_espresso' ),
115
+	__('Displays a list of people that have registered for the specified event', 'event_espresso'),
116 116
 
117 117
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
118
-	__( 'event', 'event_espresso' ),
118
+	__('event', 'event_espresso'),
119 119
 
120 120
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
121
-	__( 'attendees', 'event_espresso' ),
121
+	__('attendees', 'event_espresso'),
122 122
 
123 123
 	// Reference: domains/blocks/src/event-attendees/index.tsx:14
124
-	__( 'list', 'event_espresso' ),
124
+	__('list', 'event_espresso'),
125 125
 
126 126
 	// Reference: domains/blocks/src/services/utils.ts:17
127
-	__( 'Error', 'event_espresso' ),
127
+	__('Error', 'event_espresso'),
128 128
 
129 129
 	// Reference: domains/blocks/src/services/utils.ts:24
130 130
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityTemplate.tsx:16
131
-	__( 'Select…', 'event_espresso' ),
131
+	__('Select…', 'event_espresso'),
132 132
 
133 133
 	// Reference: domains/blocks/src/services/utils.ts:9
134
-	__( 'Loading…', 'event_espresso' ),
134
+	__('Loading…', 'event_espresso'),
135 135
 
136 136
 	// Reference: domains/eventEditor/src/ui/EventDescription.tsx:32
137
-	__( 'Event Description', 'event_espresso' ),
137
+	__('Event Description', 'event_espresso'),
138 138
 
139 139
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:22
140
-	__( 'Active status', 'event_espresso' ),
140
+	__('Active status', 'event_espresso'),
141 141
 
142 142
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:14
143
-	__( 'Alternative Registration Page', 'event_espresso' ),
143
+	__('Alternative Registration Page', 'event_espresso'),
144 144
 
145 145
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:15
146
-	__( 'Default Registration Status', 'event_espresso' ),
146
+	__('Default Registration Status', 'event_espresso'),
147 147
 
148 148
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:9
149
-	__( 'Donations Enabled', 'event_espresso' ),
149
+	__('Donations Enabled', 'event_espresso'),
150 150
 
151 151
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:9
152
-	__( 'Donations Disabled', 'event_espresso' ),
152
+	__('Donations Disabled', 'event_espresso'),
153 153
 
154 154
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:16
155
-	__( 'Event Manager', 'event_espresso' ),
155
+	__('Event Manager', 'event_espresso'),
156 156
 
157 157
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:11
158
-	__( 'Event Phone Number', 'event_espresso' ),
158
+	__('Event Phone Number', 'event_espresso'),
159 159
 
160 160
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:12
161
-	__( 'Max Registrations per Transaction', 'event_espresso' ),
161
+	__('Max Registrations per Transaction', 'event_espresso'),
162 162
 
163 163
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:9
164
-	__( 'Ticket Selector Enabled', 'event_espresso' ),
164
+	__('Ticket Selector Enabled', 'event_espresso'),
165 165
 
166 166
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:9
167
-	__( 'Ticket Selector Disabled', 'event_espresso' ),
167
+	__('Ticket Selector Disabled', 'event_espresso'),
168 168
 
169 169
 	// Reference: domains/eventEditor/src/ui/EventRegistrationOptions/index.tsx:42
170
-	__( 'Registration Options', 'event_espresso' ),
170
+	__('Registration Options', 'event_espresso'),
171 171
 
172 172
 	// Reference: domains/eventEditor/src/ui/datetimes/DateRegistrationsLink.tsx:13
173
-	__( 'view ALL registrations for this date.', 'event_espresso' ),
173
+	__('view ALL registrations for this date.', 'event_espresso'),
174 174
 
175 175
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
176
-	__( 'primary information about the date', 'event_espresso' ),
176
+	__('primary information about the date', 'event_espresso'),
177 177
 
178 178
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10
179
-	__( 'Date Details', 'event_espresso' ),
179
+	__('Date Details', 'event_espresso'),
180 180
 
181 181
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
182 182
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
183 183
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
184
-	__( 'relations between tickets and dates', 'event_espresso' ),
184
+	__('relations between tickets and dates', 'event_espresso'),
185 185
 
186 186
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11
187
-	__( 'Assign Tickets', 'event_espresso' ),
187
+	__('Assign Tickets', 'event_espresso'),
188 188
 
189 189
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/FooterButtons.tsx:22
190
-	__( 'Save and assign tickets', 'event_espresso' ),
190
+	__('Save and assign tickets', 'event_espresso'),
191 191
 
192 192
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:27
193 193
 	/* translators: %s datetime id */
194
-	__( 'Edit datetime %s', 'event_espresso' ),
194
+	__('Edit datetime %s', 'event_espresso'),
195 195
 
196 196
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:30
197
-	__( 'New Datetime', 'event_espresso' ),
197
+	__('New Datetime', 'event_espresso'),
198 198
 
199 199
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:104
200 200
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:108
201 201
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:117
202 202
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:108
203
-	__( 'Details', 'event_espresso' ),
203
+	__('Details', 'event_espresso'),
204 204
 
205 205
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:108
206 206
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:112
207 207
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:81
208
-	__( 'Capacity', 'event_espresso' ),
208
+	__('Capacity', 'event_espresso'),
209 209
 
210 210
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:113
211
-	__( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ),
211
+	__('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'),
212 212
 
213 213
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:117
214
-	__( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ),
214
+	__('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'),
215 215
 
216 216
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:122
217 217
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:189
218
-	__( 'Trash', 'event_espresso' ),
218
+	__('Trash', 'event_espresso'),
219 219
 
220 220
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:67
221 221
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:45
222 222
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:80
223 223
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:45
224
-	__( 'Basics', 'event_espresso' ),
224
+	__('Basics', 'event_espresso'),
225 225
 
226 226
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:71
227 227
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:49
@@ -229,249 +229,249 @@  discard block
 block discarded – undo
229 229
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:84
230 230
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:49
231 231
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:40
232
-	__( 'Name', 'event_espresso' ),
232
+	__('Name', 'event_espresso'),
233 233
 
234 234
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:76
235 235
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:55
236 236
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:89
237 237
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:55
238 238
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47
239
-	__( 'Description', 'event_espresso' ),
239
+	__('Description', 'event_espresso'),
240 240
 
241 241
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:84
242 242
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:63
243 243
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:63
244
-	__( 'Dates', 'event_espresso' ),
244
+	__('Dates', 'event_espresso'),
245 245
 
246 246
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:88
247 247
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:51
248 248
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:101
249
-	__( 'Start Date', 'event_espresso' ),
249
+	__('Start Date', 'event_espresso'),
250 250
 
251 251
 	// Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:94
252 252
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:65
253 253
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:107
254
-	__( 'End Date', 'event_espresso' ),
254
+	__('End Date', 'event_espresso'),
255 255
 
256 256
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:34
257 257
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:33
258
-	__( 'Event Dates', 'event_espresso' ),
258
+	__('Event Dates', 'event_espresso'),
259 259
 
260 260
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:37
261
-	__( 'loading event dates…', 'event_espresso' ),
261
+	__('loading event dates…', 'event_espresso'),
262 262
 
263 263
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:20
264
-	__( 'Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso' ),
264
+	__('Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso'),
265 265
 
266 266
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:30
267
-	__( 'Ticket Assignments', 'event_espresso' ),
267
+	__('Ticket Assignments', 'event_espresso'),
268 268
 
269 269
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:25
270
-	__( 'Number of related tickets', 'event_espresso' ),
270
+	__('Number of related tickets', 'event_espresso'),
271 271
 
272 272
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:26
273
-	__( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ),
273
+	__('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'),
274 274
 
275 275
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:34
276
-	__( 'assign tickets', 'event_espresso' ),
276
+	__('assign tickets', 'event_espresso'),
277 277
 
278 278
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:24
279
-	__( 'Permanently delete Datetime?', 'event_espresso' ),
279
+	__('Permanently delete Datetime?', 'event_espresso'),
280 280
 
281 281
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:24
282
-	__( 'Move Datetime to Trash?', 'event_espresso' ),
282
+	__('Move Datetime to Trash?', 'event_espresso'),
283 283
 
284 284
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:26
285
-	__( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ),
285
+	__('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'),
286 286
 
287 287
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:29
288
-	__( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ),
288
+	__('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'),
289 289
 
290 290
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:38
291 291
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:44
292
-	__( 'delete permanently', 'event_espresso' ),
292
+	__('delete permanently', 'event_espresso'),
293 293
 
294 294
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:38
295
-	__( 'trash datetime', 'event_espresso' ),
295
+	__('trash datetime', 'event_espresso'),
296 296
 
297 297
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:44
298
-	__( 'event date main menu', 'event_espresso' ),
298
+	__('event date main menu', 'event_espresso'),
299 299
 
300 300
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:58
301
-	__( 'edit datetime', 'event_espresso' ),
301
+	__('edit datetime', 'event_espresso'),
302 302
 
303 303
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:59
304
-	__( 'copy datetime', 'event_espresso' ),
304
+	__('copy datetime', 'event_espresso'),
305 305
 
306 306
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:36
307 307
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:39
308 308
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:43
309
-	__( 'bulk actions', 'event_espresso' ),
309
+	__('bulk actions', 'event_espresso'),
310 310
 
311 311
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:40
312
-	__( 'edit datetime details', 'event_espresso' ),
312
+	__('edit datetime details', 'event_espresso'),
313 313
 
314 314
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44
315
-	__( 'delete datetimes', 'event_espresso' ),
315
+	__('delete datetimes', 'event_espresso'),
316 316
 
317 317
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44
318
-	__( 'trash datetimes', 'event_espresso' ),
318
+	__('trash datetimes', 'event_espresso'),
319 319
 
320 320
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14
321
-	__( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ),
321
+	__('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'),
322 322
 
323 323
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15
324
-	__( 'Are you sure you want to trash these datetimes?', 'event_espresso' ),
324
+	__('Are you sure you want to trash these datetimes?', 'event_espresso'),
325 325
 
326 326
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
327
-	__( 'Delete datetimes permanently', 'event_espresso' ),
327
+	__('Delete datetimes permanently', 'event_espresso'),
328 328
 
329 329
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16
330
-	__( 'Trash datetimes', 'event_espresso' ),
330
+	__('Trash datetimes', 'event_espresso'),
331 331
 
332 332
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:21
333
-	__( 'Bulk edit date details', 'event_espresso' ),
333
+	__('Bulk edit date details', 'event_espresso'),
334 334
 
335 335
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22
336
-	__( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ),
336
+	__('any changes will be applied to ALL of the selected dates.', 'event_espresso'),
337 337
 
338 338
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12
339 339
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12
340
-	__( 'Name must be at least three characters', 'event_espresso' ),
340
+	__('Name must be at least three characters', 'event_espresso'),
341 341
 
342 342
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:67
343 343
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:67
344
-	__( 'Shift dates', 'event_espresso' ),
344
+	__('Shift dates', 'event_espresso'),
345 345
 
346 346
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:92
347 347
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:92
348
-	__( 'earlier', 'event_espresso' ),
348
+	__('earlier', 'event_espresso'),
349 349
 
350 350
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:96
351 351
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:96
352
-	__( 'later', 'event_espresso' ),
352
+	__('later', 'event_espresso'),
353 353
 
354 354
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:36
355
-	__( 'edit capacity (registration limit)…', 'event_espresso' ),
355
+	__('edit capacity (registration limit)…', 'event_espresso'),
356 356
 
357 357
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:38
358
-	__( 'Edit Event Date', 'event_espresso' ),
358
+	__('Edit Event Date', 'event_espresso'),
359 359
 
360 360
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:42
361
-	__( 'edit start and end dates', 'event_espresso' ),
361
+	__('edit start and end dates', 'event_espresso'),
362 362
 
363 363
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:15
364 364
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:15
365
-	__( 'sold', 'event_espresso' ),
365
+	__('sold', 'event_espresso'),
366 366
 
367 367
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:28
368
-	__( 'capacity', 'event_espresso' ),
368
+	__('capacity', 'event_espresso'),
369 369
 
370 370
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:34
371 371
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:33
372
-	__( 'reg list', 'event_espresso' ),
372
+	__('reg list', 'event_espresso'),
373 373
 
374 374
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:46
375 375
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:45
376
-	__( 'Edit description', 'event_espresso' ),
376
+	__('Edit description', 'event_espresso'),
377 377
 
378 378
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:47
379 379
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:46
380
-	__( 'edit description…', 'event_espresso' ),
380
+	__('edit description…', 'event_espresso'),
381 381
 
382 382
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:10
383
-	__( 'Move Date to Trash', 'event_espresso' ),
383
+	__('Move Date to Trash', 'event_espresso'),
384 384
 
385 385
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:13
386 386
 	// Reference: packages/constants/src/datetime.ts:6
387
-	__( 'Active', 'event_espresso' ),
387
+	__('Active', 'event_espresso'),
388 388
 
389 389
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:14
390 390
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:13
391
-	__( 'Trashed', 'event_espresso' ),
391
+	__('Trashed', 'event_espresso'),
392 392
 
393 393
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:15
394 394
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:14
395 395
 	// Reference: packages/constants/src/datetime.ts:8
396
-	__( 'Expired', 'event_espresso' ),
396
+	__('Expired', 'event_espresso'),
397 397
 
398 398
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:16
399 399
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:16
400
-	__( 'Sold Out', 'event_espresso' ),
400
+	__('Sold Out', 'event_espresso'),
401 401
 
402 402
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:17
403 403
 	// Reference: packages/constants/src/datetime.ts:12
404
-	__( 'Upcoming', 'event_espresso' ),
404
+	__('Upcoming', 'event_espresso'),
405 405
 
406 406
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:7
407
-	__( 'Edit Event Date Details', 'event_espresso' ),
407
+	__('Edit Event Date Details', 'event_espresso'),
408 408
 
409 409
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:8
410
-	__( 'View Registrations for this Date', 'event_espresso' ),
410
+	__('View Registrations for this Date', 'event_espresso'),
411 411
 
412 412
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:9
413
-	__( 'Manage Ticket Assignments', 'event_espresso' ),
413
+	__('Manage Ticket Assignments', 'event_espresso'),
414 414
 
415 415
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:23
416 416
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:34
417
-	__( 'edit title…', 'event_espresso' ),
417
+	__('edit title…', 'event_espresso'),
418 418
 
419 419
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:25
420 420
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:25
421
-	__( 'ON', 'event_espresso' ),
421
+	__('ON', 'event_espresso'),
422 422
 
423 423
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10
424
-	__( 'end dates only', 'event_espresso' ),
424
+	__('end dates only', 'event_espresso'),
425 425
 
426 426
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11
427
-	__( 'start and end dates', 'event_espresso' ),
427
+	__('start and end dates', 'event_espresso'),
428 428
 
429 429
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16
430
-	__( 'dates above 90% capacity', 'event_espresso' ),
430
+	__('dates above 90% capacity', 'event_espresso'),
431 431
 
432 432
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17
433
-	__( 'dates above 75% capacity', 'event_espresso' ),
433
+	__('dates above 75% capacity', 'event_espresso'),
434 434
 
435 435
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18
436
-	__( 'dates above 50% capacity', 'event_espresso' ),
436
+	__('dates above 50% capacity', 'event_espresso'),
437 437
 
438 438
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19
439
-	__( 'dates below 50% capacity', 'event_espresso' ),
439
+	__('dates below 50% capacity', 'event_espresso'),
440 440
 
441 441
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23
442
-	__( 'all dates', 'event_espresso' ),
442
+	__('all dates', 'event_espresso'),
443 443
 
444 444
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24
445
-	__( 'all active and upcoming', 'event_espresso' ),
445
+	__('all active and upcoming', 'event_espresso'),
446 446
 
447 447
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25
448
-	__( 'active dates only', 'event_espresso' ),
448
+	__('active dates only', 'event_espresso'),
449 449
 
450 450
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26
451
-	__( 'upcoming dates only', 'event_espresso' ),
451
+	__('upcoming dates only', 'event_espresso'),
452 452
 
453 453
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27
454
-	__( 'next active or upcoming only', 'event_espresso' ),
454
+	__('next active or upcoming only', 'event_espresso'),
455 455
 
456 456
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28
457
-	__( 'sold out dates only', 'event_espresso' ),
457
+	__('sold out dates only', 'event_espresso'),
458 458
 
459 459
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29
460
-	__( 'recently expired dates', 'event_espresso' ),
460
+	__('recently expired dates', 'event_espresso'),
461 461
 
462 462
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30
463
-	__( 'all expired dates', 'event_espresso' ),
463
+	__('all expired dates', 'event_espresso'),
464 464
 
465 465
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31
466
-	__( 'trashed dates only', 'event_espresso' ),
466
+	__('trashed dates only', 'event_espresso'),
467 467
 
468 468
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35
469 469
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:9
470 470
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:61
471
-	__( 'start date', 'event_espresso' ),
471
+	__('start date', 'event_espresso'),
472 472
 
473 473
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36
474
-	__( 'name', 'event_espresso' ),
474
+	__('name', 'event_espresso'),
475 475
 
476 476
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37
477 477
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:31
@@ -479,138 +479,138 @@  discard block
 block discarded – undo
479 479
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:27
480 480
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:31
481 481
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23
482
-	__( 'ID', 'event_espresso' ),
482
+	__('ID', 'event_espresso'),
483 483
 
484 484
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38
485 485
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47
486
-	__( 'custom order', 'event_espresso' ),
486
+	__('custom order', 'event_espresso'),
487 487
 
488 488
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42
489 489
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:51
490
-	__( 'display', 'event_espresso' ),
490
+	__('display', 'event_espresso'),
491 491
 
492 492
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43
493
-	__( 'recurrence', 'event_espresso' ),
493
+	__('recurrence', 'event_espresso'),
494 494
 
495 495
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44
496 496
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53
497
-	__( 'sales', 'event_espresso' ),
497
+	__('sales', 'event_espresso'),
498 498
 
499 499
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45
500 500
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55
501
-	__( 'sort by', 'event_espresso' ),
501
+	__('sort by', 'event_espresso'),
502 502
 
503 503
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46
504 504
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54
505 505
 	// Reference: packages/ee-components/src/EntityList/EntityListFilterBar.tsx:53
506
-	__( 'search', 'event_espresso' ),
506
+	__('search', 'event_espresso'),
507 507
 
508 508
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47
509 509
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56
510
-	__( 'status', 'event_espresso' ),
510
+	__('status', 'event_espresso'),
511 511
 
512 512
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9
513
-	__( 'start dates only', 'event_espresso' ),
513
+	__('start dates only', 'event_espresso'),
514 514
 
515 515
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
516 516
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/NewDateModal.tsx:12
517 517
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsModalButton.tsx:16
518
-	__( 'Add New Date', 'event_espresso' ),
518
+	__('Add New Date', 'event_espresso'),
519 519
 
520 520
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26
521
-	__( 'Add Single Date', 'event_espresso' ),
521
+	__('Add Single Date', 'event_espresso'),
522 522
 
523 523
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:43
524
-	__( 'Add a single date that only occurs once', 'event_espresso' ),
524
+	__('Add a single date that only occurs once', 'event_espresso'),
525 525
 
526 526
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:45
527
-	__( 'Single Date', 'event_espresso' ),
527
+	__('Single Date', 'event_espresso'),
528 528
 
529 529
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:106
530
-	__( 'Reg list', 'event_espresso' ),
530
+	__('Reg list', 'event_espresso'),
531 531
 
532 532
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:107
533 533
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:111
534
-	__( 'Regs', 'event_espresso' ),
534
+	__('Regs', 'event_espresso'),
535 535
 
536 536
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:122
537 537
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:126
538 538
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:59
539
-	__( 'Actions', 'event_espresso' ),
539
+	__('Actions', 'event_espresso'),
540 540
 
541 541
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52
542
-	__( 'Start', 'event_espresso' ),
542
+	__('Start', 'event_espresso'),
543 543
 
544 544
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:66
545
-	__( 'End', 'event_espresso' ),
545
+	__('End', 'event_espresso'),
546 546
 
547 547
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:82
548
-	__( 'Cap', 'event_espresso' ),
548
+	__('Cap', 'event_espresso'),
549 549
 
550 550
 	// Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:94
551 551
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:98
552
-	__( 'Sold', 'event_espresso' ),
552
+	__('Sold', 'event_espresso'),
553 553
 
554 554
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18
555
-	__( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
556
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
555
+	__('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. 
556
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
557 557
 
558 558
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22
559
-	__( 'Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
560
-Please correct the assignments for the highlighted cells.', 'event_espresso' ),
559
+	__('Event Dates must always have at least one Ticket assigned to them but one or more of the Event Dates below does not have any. 
560
+Please correct the assignments for the highlighted cells.', 'event_espresso'),
561 561
 
562 562
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32
563
-	__( 'Please Update Assignments', 'event_espresso' ),
563
+	__('Please Update Assignments', 'event_espresso'),
564 564
 
565 565
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:26
566
-	__( 'There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso' ),
566
+	__('There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso'),
567 567
 
568 568
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:29
569 569
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:74
570 570
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:21
571
-	__( 'Alert!', 'event_espresso' ),
571
+	__('Alert!', 'event_espresso'),
572 572
 
573 573
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:42
574 574
 	/* translators: 1 entity id, 2 entity name */
575
-	__( 'Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso' ),
575
+	__('Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso'),
576 576
 
577 577
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:49
578 578
 	/* translators: 1 entity id, 2 entity name */
579
-	__( 'Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso' ),
579
+	__('Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso'),
580 580
 
581 581
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal.tsx:28
582 582
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:13
583
-	__( 'Ticket Assignment Manager', 'event_espresso' ),
583
+	__('Ticket Assignment Manager', 'event_espresso'),
584 584
 
585 585
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:10
586
-	__( 'existing relation', 'event_espresso' ),
586
+	__('existing relation', 'event_espresso'),
587 587
 
588 588
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:15
589
-	__( 'remove existing relation', 'event_espresso' ),
589
+	__('remove existing relation', 'event_espresso'),
590 590
 
591 591
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:20
592
-	__( 'add new relation', 'event_espresso' ),
592
+	__('add new relation', 'event_espresso'),
593 593
 
594 594
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:25
595
-	__( 'invalid relation', 'event_espresso' ),
595
+	__('invalid relation', 'event_espresso'),
596 596
 
597 597
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:29
598
-	__( 'no relation', 'event_espresso' ),
598
+	__('no relation', 'event_espresso'),
599 599
 
600 600
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/BodyCell.tsx:24
601
-	__( 'assign ticket', 'event_espresso' ),
601
+	__('assign ticket', 'event_espresso'),
602 602
 
603 603
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:15
604
-	__( 'Assignments', 'event_espresso' ),
604
+	__('Assignments', 'event_espresso'),
605 605
 
606 606
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:16
607
-	__( 'Event Dates are listed below', 'event_espresso' ),
607
+	__('Event Dates are listed below', 'event_espresso'),
608 608
 
609 609
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:17
610
-	__( 'Tickets are listed along the top', 'event_espresso' ),
610
+	__('Tickets are listed along the top', 'event_espresso'),
611 611
 
612 612
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:18
613
-	__( 'Click the cell buttons to toggle assigments', 'event_espresso' ),
613
+	__('Click the cell buttons to toggle assigments', 'event_espresso'),
614 614
 
615 615
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/useSubmitButtonProps.ts:29
616 616
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16
@@ -619,1006 +619,1006 @@  discard block
 block discarded – undo
619 619
 	// Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:29
620 620
 	// Reference: packages/ui-components/src/Modal/useSubmitButtonProps.tsx:13
621 621
 	// Reference: packages/ui-components/src/Stepper/buttons/Submit.tsx:7
622
-	__( 'Submit', 'event_espresso' ),
622
+	__('Submit', 'event_espresso'),
623 623
 
624 624
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:19
625
-	__( 'All Dates', 'event_espresso' ),
625
+	__('All Dates', 'event_espresso'),
626 626
 
627 627
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:26
628
-	__( 'dates by month', 'event_espresso' ),
628
+	__('dates by month', 'event_espresso'),
629 629
 
630 630
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:15
631
-	__( 'show expired tickets', 'event_espresso' ),
631
+	__('show expired tickets', 'event_espresso'),
632 632
 
633 633
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:9
634
-	__( 'show trashed dates', 'event_espresso' ),
634
+	__('show trashed dates', 'event_espresso'),
635 635
 
636 636
 	// Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:15
637
-	__( 'show trashed tickets', 'event_espresso' ),
637
+	__('show trashed tickets', 'event_espresso'),
638 638
 
639 639
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:13
640
-	__( 'total registrations.', 'event_espresso' ),
640
+	__('total registrations.', 'event_espresso'),
641 641
 
642 642
 	// Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:14
643
-	__( 'view ALL registrations for this ticket.', 'event_espresso' ),
643
+	__('view ALL registrations for this ticket.', 'event_espresso'),
644 644
 
645 645
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/Container.tsx:38
646 646
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actions/Actions.tsx:21
647
-	__( 'Default tickets', 'event_espresso' ),
647
+	__('Default tickets', 'event_espresso'),
648 648
 
649 649
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:26
650 650
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:33
651
-	__( 'Set ticket prices', 'event_espresso' ),
651
+	__('Set ticket prices', 'event_espresso'),
652 652
 
653 653
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:31
654
-	__( 'Skip prices - Save', 'event_espresso' ),
654
+	__('Skip prices - Save', 'event_espresso'),
655 655
 
656 656
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:37
657 657
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:57
658
-	__( 'Ticket details', 'event_espresso' ),
658
+	__('Ticket details', 'event_espresso'),
659 659
 
660 660
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:38
661
-	__( 'Save', 'event_espresso' ),
661
+	__('Save', 'event_espresso'),
662 662
 
663 663
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:22
664 664
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:26
665 665
 	/* translators: %s ticket id */
666
-	__( 'Edit ticket %s', 'event_espresso' ),
666
+	__('Edit ticket %s', 'event_espresso'),
667 667
 
668 668
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:25
669 669
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:29
670
-	__( 'New Ticket Details', 'event_espresso' ),
670
+	__('New Ticket Details', 'event_espresso'),
671 671
 
672 672
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
673 673
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
674
-	__( 'primary information about the ticket', 'event_espresso' ),
674
+	__('primary information about the ticket', 'event_espresso'),
675 675
 
676 676
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10
677 677
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10
678
-	__( 'Ticket Details', 'event_espresso' ),
678
+	__('Ticket Details', 'event_espresso'),
679 679
 
680 680
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:12
681 681
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:12
682
-	__( 'apply ticket price modifiers and taxes', 'event_espresso' ),
682
+	__('apply ticket price modifiers and taxes', 'event_espresso'),
683 683
 
684 684
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:14
685 685
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:14
686
-	__( 'Price Calculator', 'event_espresso' ),
686
+	__('Price Calculator', 'event_espresso'),
687 687
 
688 688
 	// Reference: domains/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16
689 689
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16
690
-	__( 'Assign Dates', 'event_espresso' ),
690
+	__('Assign Dates', 'event_espresso'),
691 691
 
692 692
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:39
693
-	__( 'Skip prices - assign dates', 'event_espresso' ),
693
+	__('Skip prices - assign dates', 'event_espresso'),
694 694
 
695 695
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:50
696
-	__( 'Save and assign dates', 'event_espresso' ),
696
+	__('Save and assign dates', 'event_espresso'),
697 697
 
698 698
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:121
699 699
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:112
700
-	__( 'Quantity For Sale', 'event_espresso' ),
700
+	__('Quantity For Sale', 'event_espresso'),
701 701
 
702 702
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:127
703
-	__( 'The maximum number of this ticket available for sale.', 'event_espresso' ),
703
+	__('The maximum number of this ticket available for sale.', 'event_espresso'),
704 704
 
705 705
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:129
706
-	__( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ),
706
+	__('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'),
707 707
 
708 708
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:134
709 709
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:121
710
-	__( 'Number of Uses', 'event_espresso' ),
710
+	__('Number of Uses', 'event_espresso'),
711 711
 
712 712
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:140
713
-	__( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ),
713
+	__('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'),
714 714
 
715 715
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:144
716
-	__( 'Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso' ),
716
+	__('Example: A ticket might have access to 4 different dates, but setting this field to 2 would mean that the ticket could only be used twice. Leave blank for no limit.', 'event_espresso'),
717 717
 
718 718
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:151
719 719
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:129
720
-	__( 'Minimum Quantity', 'event_espresso' ),
720
+	__('Minimum Quantity', 'event_espresso'),
721 721
 
722 722
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:156
723
-	__( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
723
+	__('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
724 724
 
725 725
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:160
726
-	__( 'Leave blank for no minimum.', 'event_espresso' ),
726
+	__('Leave blank for no minimum.', 'event_espresso'),
727 727
 
728 728
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:165
729 729
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:137
730
-	__( 'Maximum Quantity', 'event_espresso' ),
730
+	__('Maximum Quantity', 'event_espresso'),
731 731
 
732 732
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:171
733
-	__( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ),
733
+	__('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'),
734 734
 
735 735
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:175
736
-	__( 'Leave blank for no maximum.', 'event_espresso' ),
736
+	__('Leave blank for no maximum.', 'event_espresso'),
737 737
 
738 738
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:180
739 739
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:146
740
-	__( 'Required Ticket', 'event_espresso' ),
740
+	__('Required Ticket', 'event_espresso'),
741 741
 
742 742
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:182
743
-	__( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ),
743
+	__('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'),
744 744
 
745 745
 	// Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:97
746
-	__( 'Ticket Sales', 'event_espresso' ),
746
+	__('Ticket Sales', 'event_espresso'),
747 747
 
748 748
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:35
749
-	__( 'Available Tickets', 'event_espresso' ),
749
+	__('Available Tickets', 'event_espresso'),
750 750
 
751 751
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:38
752
-	__( 'loading tickets…', 'event_espresso' ),
752
+	__('loading tickets…', 'event_espresso'),
753 753
 
754 754
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:26
755
-	__( 'Number of related dates', 'event_espresso' ),
755
+	__('Number of related dates', 'event_espresso'),
756 756
 
757 757
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27
758
-	__( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ),
758
+	__('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'),
759 759
 
760 760
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:37
761
-	__( 'assign dates', 'event_espresso' ),
761
+	__('assign dates', 'event_espresso'),
762 762
 
763 763
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:18
764
-	__( 'Permanently delete Ticket?', 'event_espresso' ),
764
+	__('Permanently delete Ticket?', 'event_espresso'),
765 765
 
766 766
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:18
767
-	__( 'Move Ticket to Trash?', 'event_espresso' ),
767
+	__('Move Ticket to Trash?', 'event_espresso'),
768 768
 
769 769
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:21
770
-	__( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ),
770
+	__('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'),
771 771
 
772 772
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:22
773
-	__( 'Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso' ),
773
+	__('Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso'),
774 774
 
775 775
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:44
776 776
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Trash.tsx:6
777
-	__( 'trash ticket', 'event_espresso' ),
777
+	__('trash ticket', 'event_espresso'),
778 778
 
779 779
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:13
780
-	__( 'ticket main menu', 'event_espresso' ),
780
+	__('ticket main menu', 'event_espresso'),
781 781
 
782 782
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:31
783 783
 	// Reference: packages/ee-components/src/SimpleTicketCard/actions/Edit.tsx:15
784
-	__( 'edit ticket', 'event_espresso' ),
784
+	__('edit ticket', 'event_espresso'),
785 785
 
786 786
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:32
787
-	__( 'copy ticket', 'event_espresso' ),
787
+	__('copy ticket', 'event_espresso'),
788 788
 
789 789
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:43
790
-	__( 'edit ticket details', 'event_espresso' ),
790
+	__('edit ticket details', 'event_espresso'),
791 791
 
792 792
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
793
-	__( 'delete tickets', 'event_espresso' ),
793
+	__('delete tickets', 'event_espresso'),
794 794
 
795 795
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:47
796
-	__( 'trash tickets', 'event_espresso' ),
796
+	__('trash tickets', 'event_espresso'),
797 797
 
798 798
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:51
799
-	__( 'edit ticket prices', 'event_espresso' ),
799
+	__('edit ticket prices', 'event_espresso'),
800 800
 
801 801
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14
802
-	__( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ),
802
+	__('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'),
803 803
 
804 804
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15
805
-	__( 'Are you sure you want to trash these tickets?', 'event_espresso' ),
805
+	__('Are you sure you want to trash these tickets?', 'event_espresso'),
806 806
 
807 807
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
808
-	__( 'Delete tickets permanently', 'event_espresso' ),
808
+	__('Delete tickets permanently', 'event_espresso'),
809 809
 
810 810
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16
811
-	__( 'Trash tickets', 'event_espresso' ),
811
+	__('Trash tickets', 'event_espresso'),
812 812
 
813 813
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:21
814
-	__( 'Bulk edit ticket details', 'event_espresso' ),
814
+	__('Bulk edit ticket details', 'event_espresso'),
815 815
 
816 816
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22
817
-	__( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ),
817
+	__('any changes will be applied to ALL of the selected tickets.', 'event_espresso'),
818 818
 
819 819
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:19
820
-	__( 'Bulk edit ticket prices', 'event_espresso' ),
820
+	__('Bulk edit ticket prices', 'event_espresso'),
821 821
 
822 822
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20
823
-	__( 'Edit all prices together', 'event_espresso' ),
823
+	__('Edit all prices together', 'event_espresso'),
824 824
 
825 825
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:21
826
-	__( 'Edit all the selected ticket prices dynamically', 'event_espresso' ),
826
+	__('Edit all the selected ticket prices dynamically', 'event_espresso'),
827 827
 
828 828
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25
829
-	__( 'Edit prices individually', 'event_espresso' ),
829
+	__('Edit prices individually', 'event_espresso'),
830 830
 
831 831
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:26
832
-	__( 'Edit prices for each ticket individually', 'event_espresso' ),
832
+	__('Edit prices for each ticket individually', 'event_espresso'),
833 833
 
834 834
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:14
835 835
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:34
836 836
 	// Reference: packages/form/src/ResetButton.tsx:18
837 837
 	// Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12
838
-	__( 'Reset', 'event_espresso' ),
838
+	__('Reset', 'event_espresso'),
839 839
 
840 840
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15
841 841
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:76
842 842
 	// Reference: packages/ui-components/src/Modal/useCancelButtonProps.tsx:10
843
-	__( 'Cancel', 'event_espresso' ),
843
+	__('Cancel', 'event_espresso'),
844 844
 
845 845
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:26
846 846
 	/* translators: %s ticket name */
847
-	__( 'Edit prices for Ticket: %s', 'event_espresso' ),
847
+	__('Edit prices for Ticket: %s', 'event_espresso'),
848 848
 
849 849
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:37
850
-	__( 'Edit Ticket Sale Dates', 'event_espresso' ),
850
+	__('Edit Ticket Sale Dates', 'event_espresso'),
851 851
 
852 852
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:41
853
-	__( 'edit ticket sales start and end dates', 'event_espresso' ),
853
+	__('edit ticket sales start and end dates', 'event_espresso'),
854 854
 
855 855
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:28
856
-	__( 'quantity', 'event_espresso' ),
856
+	__('quantity', 'event_espresso'),
857 857
 
858 858
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:27
859
-	__( 'edit quantity of tickets available…', 'event_espresso' ),
859
+	__('edit quantity of tickets available…', 'event_espresso'),
860 860
 
861 861
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:10
862
-	__( 'Move Ticket to Trash', 'event_espresso' ),
862
+	__('Move Ticket to Trash', 'event_espresso'),
863 863
 
864 864
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:15
865 865
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:52
866
-	__( 'On Sale', 'event_espresso' ),
866
+	__('On Sale', 'event_espresso'),
867 867
 
868 868
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:17
869
-	__( 'Pending', 'event_espresso' ),
869
+	__('Pending', 'event_espresso'),
870 870
 
871 871
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:7
872
-	__( 'Edit Ticket Details', 'event_espresso' ),
872
+	__('Edit Ticket Details', 'event_espresso'),
873 873
 
874 874
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:8
875
-	__( 'Manage Date Assignments', 'event_espresso' ),
875
+	__('Manage Date Assignments', 'event_espresso'),
876 876
 
877 877
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:9
878 878
 	// Reference: packages/tpc/src/components/table/Table.tsx:44
879
-	__( 'Ticket Price Calculator', 'event_espresso' ),
879
+	__('Ticket Price Calculator', 'event_espresso'),
880 880
 
881 881
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:37
882
-	__( 'edit ticket total…', 'event_espresso' ),
882
+	__('edit ticket total…', 'event_espresso'),
883 883
 
884 884
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:51
885
-	__( 'set price…', 'event_espresso' ),
885
+	__('set price…', 'event_espresso'),
886 886
 
887 887
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:23
888
-	__( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ),
888
+	__('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'),
889 889
 
890 890
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24
891
-	__( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ),
891
+	__('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'),
892 892
 
893 893
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10
894
-	__( 'ticket sales start and end dates', 'event_espresso' ),
894
+	__('ticket sales start and end dates', 'event_espresso'),
895 895
 
896 896
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15
897
-	__( 'tickets with 90% or more sold', 'event_espresso' ),
897
+	__('tickets with 90% or more sold', 'event_espresso'),
898 898
 
899 899
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16
900
-	__( 'tickets with 75% or more sold', 'event_espresso' ),
900
+	__('tickets with 75% or more sold', 'event_espresso'),
901 901
 
902 902
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17
903
-	__( 'tickets with 50% or more sold', 'event_espresso' ),
903
+	__('tickets with 50% or more sold', 'event_espresso'),
904 904
 
905 905
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19
906
-	__( 'tickets with less than 50% sold', 'event_espresso' ),
906
+	__('tickets with less than 50% sold', 'event_espresso'),
907 907
 
908 908
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28
909
-	__( 'all tickets for all dates', 'event_espresso' ),
909
+	__('all tickets for all dates', 'event_espresso'),
910 910
 
911 911
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29
912
-	__( 'all on sale and sale pending', 'event_espresso' ),
912
+	__('all on sale and sale pending', 'event_espresso'),
913 913
 
914 914
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30
915
-	__( 'on sale tickets only', 'event_espresso' ),
915
+	__('on sale tickets only', 'event_espresso'),
916 916
 
917 917
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31
918
-	__( 'sale pending tickets only', 'event_espresso' ),
918
+	__('sale pending tickets only', 'event_espresso'),
919 919
 
920 920
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32
921
-	__( 'next on sale or sale pending only', 'event_espresso' ),
921
+	__('next on sale or sale pending only', 'event_espresso'),
922 922
 
923 923
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33
924
-	__( 'sold out tickets only', 'event_espresso' ),
924
+	__('sold out tickets only', 'event_espresso'),
925 925
 
926 926
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34
927
-	__( 'expired tickets only', 'event_espresso' ),
927
+	__('expired tickets only', 'event_espresso'),
928 928
 
929 929
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35
930
-	__( 'trashed tickets only', 'event_espresso' ),
930
+	__('trashed tickets only', 'event_espresso'),
931 931
 
932 932
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40
933
-	__( 'all tickets for above dates', 'event_espresso' ),
933
+	__('all tickets for above dates', 'event_espresso'),
934 934
 
935 935
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44
936
-	__( 'ticket sale date', 'event_espresso' ),
936
+	__('ticket sale date', 'event_espresso'),
937 937
 
938 938
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45
939
-	__( 'ticket name', 'event_espresso' ),
939
+	__('ticket name', 'event_espresso'),
940 940
 
941 941
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46
942
-	__( 'ticket ID', 'event_espresso' ),
942
+	__('ticket ID', 'event_espresso'),
943 943
 
944 944
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52
945
-	__( 'link', 'event_espresso' ),
945
+	__('link', 'event_espresso'),
946 946
 
947 947
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8
948
-	__( 'ticket sales start date only', 'event_espresso' ),
948
+	__('ticket sales start date only', 'event_espresso'),
949 949
 
950 950
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9
951
-	__( 'ticket sales end date only', 'event_espresso' ),
951
+	__('ticket sales end date only', 'event_espresso'),
952 952
 
953 953
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:18
954
-	__( 'Add New Ticket', 'event_espresso' ),
954
+	__('Add New Ticket', 'event_espresso'),
955 955
 
956 956
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:32
957
-	__( 'Add a single ticket and assign the dates to it', 'event_espresso' ),
957
+	__('Add a single ticket and assign the dates to it', 'event_espresso'),
958 958
 
959 959
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:34
960
-	__( 'Single Ticket', 'event_espresso' ),
960
+	__('Single Ticket', 'event_espresso'),
961 961
 
962 962
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:39
963
-	__( 'Tickets', 'event_espresso' ),
963
+	__('Tickets', 'event_espresso'),
964 964
 
965 965
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:110
966
-	__( 'Registrations', 'event_espresso' ),
966
+	__('Registrations', 'event_espresso'),
967 967
 
968 968
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51
969
-	__( 'Goes on Sale', 'event_espresso' ),
969
+	__('Goes on Sale', 'event_espresso'),
970 970
 
971 971
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:65
972
-	__( 'Sale Ends', 'event_espresso' ),
972
+	__('Sale Ends', 'event_espresso'),
973 973
 
974 974
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:66
975
-	__( 'Ends', 'event_espresso' ),
975
+	__('Ends', 'event_espresso'),
976 976
 
977 977
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78
978
-	__( 'Price', 'event_espresso' ),
978
+	__('Price', 'event_espresso'),
979 979
 
980 980
 	// Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:88
981
-	__( 'Quantity', 'event_espresso' ),
981
+	__('Quantity', 'event_espresso'),
982 982
 
983 983
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:29
984
-	__( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ),
984
+	__('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'),
985 985
 
986 986
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:40
987
-	__( 'Skip', 'event_espresso' ),
987
+	__('Skip', 'event_espresso'),
988 988
 
989 989
 	// Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:42
990
-	__( 'Sure I\'ll help', 'event_espresso' ),
990
+	__('Sure I\'ll help', 'event_espresso'),
991 991
 
992 992
 	// Reference: packages/adapters/src/Pagination/Pagination.tsx:23
993
-	__( 'pagination', 'event_espresso' ),
993
+	__('pagination', 'event_espresso'),
994 994
 
995 995
 	// Reference: packages/adapters/src/TagSelector/TagSelector.tsx:117
996
-	__( 'toggle menu', 'event_espresso' ),
996
+	__('toggle menu', 'event_espresso'),
997 997
 
998 998
 	// Reference: packages/constants/src/datetime.ts:10
999
-	__( 'Postponed', 'event_espresso' ),
999
+	__('Postponed', 'event_espresso'),
1000 1000
 
1001 1001
 	// Reference: packages/constants/src/datetime.ts:11
1002
-	__( 'SoldOut', 'event_espresso' ),
1002
+	__('SoldOut', 'event_espresso'),
1003 1003
 
1004 1004
 	// Reference: packages/constants/src/datetime.ts:7
1005 1005
 	// Reference: packages/predicates/src/registration/statusOptions.ts:10
1006
-	__( 'Cancelled', 'event_espresso' ),
1006
+	__('Cancelled', 'event_espresso'),
1007 1007
 
1008 1008
 	// Reference: packages/constants/src/datetime.ts:9
1009
-	__( 'Inactive', 'event_espresso' ),
1009
+	__('Inactive', 'event_espresso'),
1010 1010
 
1011 1011
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:13
1012
-	__( 'day in range', 'event_espresso' ),
1012
+	__('day in range', 'event_espresso'),
1013 1013
 
1014 1014
 	// Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:17
1015 1015
 	// Reference: packages/dates/src/components/DateRangePicker/index.tsx:79
1016
-	__( 'end date', 'event_espresso' ),
1016
+	__('end date', 'event_espresso'),
1017 1017
 
1018 1018
 	// Reference: packages/dates/src/components/DateTimePicker.tsx:13
1019 1019
 	// Reference: packages/dates/src/components/TimePicker.tsx:13
1020
-	__( 'time', 'event_espresso' ),
1020
+	__('time', 'event_espresso'),
1021 1021
 
1022 1022
 	// Reference: packages/dates/src/constants.ts:5
1023
-	__( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ),
1023
+	__('End Date & Time must be set later than the Start Date & Time', 'event_espresso'),
1024 1024
 
1025 1025
 	// Reference: packages/dates/src/constants.ts:7
1026
-	__( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ),
1026
+	__('Start Date & Time must be set before the End Date & Time', 'event_espresso'),
1027 1027
 
1028 1028
 	// Reference: packages/dates/src/utils/misc.ts:15
1029
-	__( 'month(s)', 'event_espresso' ),
1029
+	__('month(s)', 'event_espresso'),
1030 1030
 
1031 1031
 	// Reference: packages/dates/src/utils/misc.ts:16
1032
-	__( 'week(s)', 'event_espresso' ),
1032
+	__('week(s)', 'event_espresso'),
1033 1033
 
1034 1034
 	// Reference: packages/dates/src/utils/misc.ts:17
1035
-	__( 'day(s)', 'event_espresso' ),
1035
+	__('day(s)', 'event_espresso'),
1036 1036
 
1037 1037
 	// Reference: packages/dates/src/utils/misc.ts:18
1038
-	__( 'hour(s)', 'event_espresso' ),
1038
+	__('hour(s)', 'event_espresso'),
1039 1039
 
1040 1040
 	// Reference: packages/dates/src/utils/misc.ts:19
1041
-	__( 'minute(s)', 'event_espresso' ),
1041
+	__('minute(s)', 'event_espresso'),
1042 1042
 
1043 1043
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:105
1044
-	__( 'datetimes initialized', 'event_espresso' ),
1044
+	__('datetimes initialized', 'event_espresso'),
1045 1045
 
1046 1046
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:115
1047
-	__( 'tickets initialized', 'event_espresso' ),
1047
+	__('tickets initialized', 'event_espresso'),
1048 1048
 
1049 1049
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:125
1050
-	__( 'prices initialized', 'event_espresso' ),
1050
+	__('prices initialized', 'event_espresso'),
1051 1051
 
1052 1052
 	// Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:95
1053
-	__( 'price types initialized', 'event_espresso' ),
1053
+	__('price types initialized', 'event_espresso'),
1054 1054
 
1055 1055
 	// Reference: packages/edtr-services/src/apollo/mutations/useReorderEntities.ts:72
1056
-	__( 'reordering has been applied', 'event_espresso' ),
1056
+	__('reordering has been applied', 'event_espresso'),
1057 1057
 
1058 1058
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:38
1059 1059
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:39
1060
-	__( 'End date has been adjusted', 'event_espresso' ),
1060
+	__('End date has been adjusted', 'event_espresso'),
1061 1061
 
1062 1062
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:59
1063
-	__( 'Required', 'event_espresso' ),
1063
+	__('Required', 'event_espresso'),
1064 1064
 
1065 1065
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:64
1066
-	__( 'Start Date is required', 'event_espresso' ),
1066
+	__('Start Date is required', 'event_espresso'),
1067 1067
 
1068 1068
 	// Reference: packages/edtr-services/src/utils/dateAndTime.ts:68
1069
-	__( 'End Date is required', 'event_espresso' ),
1069
+	__('End Date is required', 'event_espresso'),
1070 1070
 
1071 1071
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:31
1072
-	__( 'no results found', 'event_espresso' ),
1072
+	__('no results found', 'event_espresso'),
1073 1073
 
1074 1074
 	// Reference: packages/ee-components/src/EntityList/EntityList.tsx:32
1075
-	__( 'try changing filter settings', 'event_espresso' ),
1075
+	__('try changing filter settings', 'event_espresso'),
1076 1076
 
1077 1077
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:27
1078 1078
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:34
1079
-	__( 'starts', 'event_espresso' ),
1079
+	__('starts', 'event_espresso'),
1080 1080
 
1081 1081
 	// Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:34
1082 1082
 	// Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:47
1083
-	__( 'ends', 'event_espresso' ),
1083
+	__('ends', 'event_espresso'),
1084 1084
 
1085 1085
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:38
1086 1086
 	/* translators: %d entity id */
1087
-	__( 'select entity with id %d', 'event_espresso' ),
1087
+	__('select entity with id %d', 'event_espresso'),
1088 1088
 
1089 1089
 	// Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:41
1090
-	__( 'select all entities', 'event_espresso' ),
1090
+	__('select all entities', 'event_espresso'),
1091 1091
 
1092 1092
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20
1093
-	__( 'Note: ', 'event_espresso' ),
1093
+	__('Note: ', 'event_espresso'),
1094 1094
 
1095 1095
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20
1096
-	__( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ),
1096
+	__('any changes will be applied to ALL of the selected entities.', 'event_espresso'),
1097 1097
 
1098 1098
 	// Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:26
1099
-	__( 'Bulk edit details', 'event_espresso' ),
1099
+	__('Bulk edit details', 'event_espresso'),
1100 1100
 
1101 1101
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:17
1102
-	__( 'Are you sure you want to bulk update the details?', 'event_espresso' ),
1102
+	__('Are you sure you want to bulk update the details?', 'event_espresso'),
1103 1103
 
1104 1104
 	// Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:18
1105
-	__( 'Bulk update details', 'event_espresso' ),
1105
+	__('Bulk update details', 'event_espresso'),
1106 1106
 
1107 1107
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:26
1108
-	__( 'reorder dates', 'event_espresso' ),
1108
+	__('reorder dates', 'event_espresso'),
1109 1109
 
1110 1110
 	// Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:26
1111
-	__( 'reorder tickets', 'event_espresso' ),
1111
+	__('reorder tickets', 'event_espresso'),
1112 1112
 
1113 1113
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:12
1114
-	__( 'Select Image', 'event_espresso' ),
1114
+	__('Select Image', 'event_espresso'),
1115 1115
 
1116 1116
 	// Reference: packages/form/src/adapters/WPMediaImage.tsx:44
1117 1117
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:10
1118 1118
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:12
1119
-	__( 'Select', 'event_espresso' ),
1119
+	__('Select', 'event_espresso'),
1120 1120
 
1121 1121
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:36
1122 1122
 	/* translators: %d the entry number */
1123
-	__( 'Entry %d', 'event_espresso' ),
1123
+	__('Entry %d', 'event_espresso'),
1124 1124
 
1125 1125
 	// Reference: packages/form/src/renderers/RepeatableRenderer.tsx:52
1126 1126
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityTemplate.tsx:27
1127
-	__( 'Add', 'event_espresso' ),
1127
+	__('Add', 'event_espresso'),
1128 1128
 
1129 1129
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11
1130 1130
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17
1131
-	__( 'sold out', 'event_espresso' ),
1131
+	__('sold out', 'event_espresso'),
1132 1132
 
1133 1133
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14
1134 1134
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14
1135
-	__( 'expired', 'event_espresso' ),
1135
+	__('expired', 'event_espresso'),
1136 1136
 
1137 1137
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17
1138
-	__( 'upcoming', 'event_espresso' ),
1138
+	__('upcoming', 'event_espresso'),
1139 1139
 
1140 1140
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20
1141
-	__( 'active', 'event_espresso' ),
1141
+	__('active', 'event_espresso'),
1142 1142
 
1143 1143
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23
1144 1144
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11
1145
-	__( 'trashed', 'event_espresso' ),
1145
+	__('trashed', 'event_espresso'),
1146 1146
 
1147 1147
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26
1148
-	__( 'cancelled', 'event_espresso' ),
1148
+	__('cancelled', 'event_espresso'),
1149 1149
 
1150 1150
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29
1151
-	__( 'postponed', 'event_espresso' ),
1151
+	__('postponed', 'event_espresso'),
1152 1152
 
1153 1153
 	// Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33
1154
-	__( 'inactive', 'event_espresso' ),
1154
+	__('inactive', 'event_espresso'),
1155 1155
 
1156 1156
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20
1157
-	__( 'pending', 'event_espresso' ),
1157
+	__('pending', 'event_espresso'),
1158 1158
 
1159 1159
 	// Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23
1160
-	__( 'on sale', 'event_espresso' ),
1160
+	__('on sale', 'event_espresso'),
1161 1161
 
1162 1162
 	// Reference: packages/predicates/src/registration/statusOptions.ts:14
1163
-	__( 'Declined', 'event_espresso' ),
1163
+	__('Declined', 'event_espresso'),
1164 1164
 
1165 1165
 	// Reference: packages/predicates/src/registration/statusOptions.ts:18
1166
-	__( 'Incomplete', 'event_espresso' ),
1166
+	__('Incomplete', 'event_espresso'),
1167 1167
 
1168 1168
 	// Reference: packages/predicates/src/registration/statusOptions.ts:22
1169
-	__( 'Not Approved', 'event_espresso' ),
1169
+	__('Not Approved', 'event_espresso'),
1170 1170
 
1171 1171
 	// Reference: packages/predicates/src/registration/statusOptions.ts:26
1172
-	__( 'Pending Payment', 'event_espresso' ),
1172
+	__('Pending Payment', 'event_espresso'),
1173 1173
 
1174 1174
 	// Reference: packages/predicates/src/registration/statusOptions.ts:30
1175
-	__( 'Wait List', 'event_espresso' ),
1175
+	__('Wait List', 'event_espresso'),
1176 1176
 
1177 1177
 	// Reference: packages/predicates/src/registration/statusOptions.ts:6
1178
-	__( 'Approved', 'event_espresso' ),
1178
+	__('Approved', 'event_espresso'),
1179 1179
 
1180 1180
 	// Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:8
1181 1181
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:10
1182
-	__( 'Select media', 'event_espresso' ),
1182
+	__('Select media', 'event_espresso'),
1183 1183
 
1184 1184
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/RichTextEditor.tsx:84
1185
-	__( 'Write something…', 'event_espresso' ),
1185
+	__('Write something…', 'event_espresso'),
1186 1186
 
1187 1187
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/Toolbar.tsx:20
1188
-	__( 'RTE Toolbar', 'event_espresso' ),
1188
+	__('RTE Toolbar', 'event_espresso'),
1189 1189
 
1190 1190
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:11
1191
-	__( 'Normal', 'event_espresso' ),
1191
+	__('Normal', 'event_espresso'),
1192 1192
 
1193 1193
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:12
1194
-	__( 'H1', 'event_espresso' ),
1194
+	__('H1', 'event_espresso'),
1195 1195
 
1196 1196
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:13
1197
-	__( 'H2', 'event_espresso' ),
1197
+	__('H2', 'event_espresso'),
1198 1198
 
1199 1199
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:14
1200
-	__( 'H3', 'event_espresso' ),
1200
+	__('H3', 'event_espresso'),
1201 1201
 
1202 1202
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:15
1203
-	__( 'H4', 'event_espresso' ),
1203
+	__('H4', 'event_espresso'),
1204 1204
 
1205 1205
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:16
1206
-	__( 'H5', 'event_espresso' ),
1206
+	__('H5', 'event_espresso'),
1207 1207
 
1208 1208
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:17
1209
-	__( 'H6', 'event_espresso' ),
1209
+	__('H6', 'event_espresso'),
1210 1210
 
1211 1211
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:18
1212
-	__( 'Block quote', 'event_espresso' ),
1212
+	__('Block quote', 'event_espresso'),
1213 1213
 
1214 1214
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:19
1215
-	__( 'Code', 'event_espresso' ),
1215
+	__('Code', 'event_espresso'),
1216 1216
 
1217 1217
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:34
1218
-	__( 'Set color', 'event_espresso' ),
1218
+	__('Set color', 'event_espresso'),
1219 1219
 
1220 1220
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:40
1221
-	__( 'Text color', 'event_espresso' ),
1221
+	__('Text color', 'event_espresso'),
1222 1222
 
1223 1223
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:42
1224
-	__( 'Background color', 'event_espresso' ),
1224
+	__('Background color', 'event_espresso'),
1225 1225
 
1226 1226
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:33
1227
-	__( 'Add image', 'event_espresso' ),
1227
+	__('Add image', 'event_espresso'),
1228 1228
 
1229 1229
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:42
1230
-	__( 'Image URL', 'event_espresso' ),
1230
+	__('Image URL', 'event_espresso'),
1231 1231
 
1232 1232
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:46
1233
-	__( 'Alt text', 'event_espresso' ),
1233
+	__('Alt text', 'event_espresso'),
1234 1234
 
1235 1235
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:47
1236
-	__( 'Width', 'event_espresso' ),
1236
+	__('Width', 'event_espresso'),
1237 1237
 
1238 1238
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:51
1239
-	__( 'Height', 'event_espresso' ),
1239
+	__('Height', 'event_espresso'),
1240 1240
 
1241 1241
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:48
1242
-	__( 'Edit link', 'event_espresso' ),
1242
+	__('Edit link', 'event_espresso'),
1243 1243
 
1244 1244
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:54
1245
-	__( 'URL title', 'event_espresso' ),
1245
+	__('URL title', 'event_espresso'),
1246 1246
 
1247 1247
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:11
1248
-	__( 'Unordered list', 'event_espresso' ),
1248
+	__('Unordered list', 'event_espresso'),
1249 1249
 
1250 1250
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:12
1251
-	__( 'Ordered list', 'event_espresso' ),
1251
+	__('Ordered list', 'event_espresso'),
1252 1252
 
1253 1253
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:13
1254 1254
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:13
1255
-	__( 'Indent', 'event_espresso' ),
1255
+	__('Indent', 'event_espresso'),
1256 1256
 
1257 1257
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:14
1258 1258
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:14
1259
-	__( 'Outdent', 'event_espresso' ),
1259
+	__('Outdent', 'event_espresso'),
1260 1260
 
1261 1261
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:11
1262
-	__( 'Unordered textalign', 'event_espresso' ),
1262
+	__('Unordered textalign', 'event_espresso'),
1263 1263
 
1264 1264
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:12
1265
-	__( 'Ordered textalign', 'event_espresso' ),
1265
+	__('Ordered textalign', 'event_espresso'),
1266 1266
 
1267 1267
 	// Reference: packages/rich-text-editor/src/components/RichTextEditor/render/Image/Toolbar.tsx:30
1268
-	__( 'Image toolbar', 'event_espresso' ),
1268
+	__('Image toolbar', 'event_espresso'),
1269 1269
 
1270 1270
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:60
1271 1271
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:33
1272
-	__( 'Visual editor', 'event_espresso' ),
1272
+	__('Visual editor', 'event_espresso'),
1273 1273
 
1274 1274
 	// Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:61
1275 1275
 	// Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:34
1276
-	__( 'HTML editor', 'event_espresso' ),
1276
+	__('HTML editor', 'event_espresso'),
1277 1277
 
1278 1278
 	// Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:68
1279
-	__( 'Add Media', 'event_espresso' ),
1279
+	__('Add Media', 'event_espresso'),
1280 1280
 
1281 1281
 	// Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:14
1282
-	__( 'add new price modifier after this row', 'event_espresso' ),
1282
+	__('add new price modifier after this row', 'event_espresso'),
1283 1283
 
1284 1284
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:14
1285
-	__( 'Delete all prices', 'event_espresso' ),
1285
+	__('Delete all prices', 'event_espresso'),
1286 1286
 
1287 1287
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:27
1288
-	__( 'Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso' ),
1288
+	__('Are you sure you want to delete all of this ticket\'s prices and make it free? This action is permanent and can not be undone.', 'event_espresso'),
1289 1289
 
1290 1290
 	// Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:31
1291
-	__( 'Delete all prices?', 'event_espresso' ),
1291
+	__('Delete all prices?', 'event_espresso'),
1292 1292
 
1293 1293
 	// Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12
1294
-	__( 'delete price modifier', 'event_espresso' ),
1294
+	__('delete price modifier', 'event_espresso'),
1295 1295
 
1296 1296
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:14
1297
-	__( 'Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso' ),
1297
+	__('Ticket base price is being reverse calculated from bottom to top starting with the ticket total. Entering a new ticket total will reverse calculate the ticket base price after applying all price modifiers in reverse. Click to turn off reverse calculations', 'event_espresso'),
1298 1298
 
1299 1299
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:17
1300
-	__( 'Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso' ),
1300
+	__('Ticket total is being calculated normally from top to bottom starting from the base price. Entering a new ticket base price will recalculate the ticket total after applying all price modifiers. Click to turn on reverse calculations', 'event_espresso'),
1301 1301
 
1302 1302
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1303
-	__( 'Disable reverse calculate', 'event_espresso' ),
1303
+	__('Disable reverse calculate', 'event_espresso'),
1304 1304
 
1305 1305
 	// Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21
1306
-	__( 'Enable reverse calculate', 'event_espresso' ),
1306
+	__('Enable reverse calculate', 'event_espresso'),
1307 1307
 
1308 1308
 	// Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:28
1309
-	__( 'ticket price calculator', 'event_espresso' ),
1309
+	__('ticket price calculator', 'event_espresso'),
1310 1310
 
1311 1311
 	// Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:9
1312
-	__( 'Add default taxes', 'event_espresso' ),
1312
+	__('Add default taxes', 'event_espresso'),
1313 1313
 
1314 1314
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:10
1315
-	__( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ),
1315
+	__('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'),
1316 1316
 
1317 1317
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:14
1318
-	__( 'Remove all taxes?', 'event_espresso' ),
1318
+	__('Remove all taxes?', 'event_espresso'),
1319 1319
 
1320 1320
 	// Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:7
1321
-	__( 'Remove taxes', 'event_espresso' ),
1321
+	__('Remove taxes', 'event_espresso'),
1322 1322
 
1323 1323
 	// Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:29
1324
-	__( 'Modify default prices.', 'event_espresso' ),
1324
+	__('Modify default prices.', 'event_espresso'),
1325 1325
 
1326 1326
 	// Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:29
1327
-	__( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ),
1327
+	__('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'),
1328 1328
 
1329 1329
 	// Reference: packages/tpc/src/components/LockedTicketsBanner.tsx:12
1330
-	__( 'Editing of prices is disabled', 'event_espresso' ),
1330
+	__('Editing of prices is disabled', 'event_espresso'),
1331 1331
 
1332 1332
 	// Reference: packages/tpc/src/components/NoPricesBanner/AddDefaultPricesButton.tsx:9
1333
-	__( 'Add default prices', 'event_espresso' ),
1333
+	__('Add default prices', 'event_espresso'),
1334 1334
 
1335 1335
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:13
1336
-	__( 'This Ticket is Currently Free', 'event_espresso' ),
1336
+	__('This Ticket is Currently Free', 'event_espresso'),
1337 1337
 
1338 1338
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:21
1339 1339
 	/* translators: %s default prices */
1340
-	__( 'Click the button below to load your %s into the calculator.', 'event_espresso' ),
1340
+	__('Click the button below to load your %s into the calculator.', 'event_espresso'),
1341 1341
 
1342 1342
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:22
1343
-	__( 'default prices', 'event_espresso' ),
1343
+	__('default prices', 'event_espresso'),
1344 1344
 
1345 1345
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:29
1346
-	__( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ),
1346
+	__('Additional ticket price modifiers can be added or removed.', 'event_espresso'),
1347 1347
 
1348 1348
 	// Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:32
1349
-	__( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ),
1349
+	__('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'),
1350 1350
 
1351 1351
 	// Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:32
1352 1352
 	/* translators: %s ticket name */
1353
-	__( 'Price Calculator for Ticket: %s', 'event_espresso' ),
1353
+	__('Price Calculator for Ticket: %s', 'event_espresso'),
1354 1354
 
1355 1355
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:48
1356
-	__( 'Total', 'event_espresso' ),
1356
+	__('Total', 'event_espresso'),
1357 1357
 
1358 1358
 	// Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:57
1359
-	__( 'ticket total', 'event_espresso' ),
1359
+	__('ticket total', 'event_espresso'),
1360 1360
 
1361 1361
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29
1362
-	__( 'Order', 'event_espresso' ),
1362
+	__('Order', 'event_espresso'),
1363 1363
 
1364 1364
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35
1365
-	__( 'Price Type', 'event_espresso' ),
1365
+	__('Price Type', 'event_espresso'),
1366 1366
 
1367 1367
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41
1368
-	__( 'Label', 'event_espresso' ),
1368
+	__('Label', 'event_espresso'),
1369 1369
 
1370 1370
 	// Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53
1371
-	__( 'Amount', 'event_espresso' ),
1371
+	__('Amount', 'event_espresso'),
1372 1372
 
1373 1373
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:22
1374
-	__( 'Copy ticket', 'event_espresso' ),
1374
+	__('Copy ticket', 'event_espresso'),
1375 1375
 
1376 1376
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:26
1377
-	__( 'Copy and archive this ticket', 'event_espresso' ),
1377
+	__('Copy and archive this ticket', 'event_espresso'),
1378 1378
 
1379 1379
 	// Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:29
1380
-	__( 'OK', 'event_espresso' ),
1380
+	__('OK', 'event_espresso'),
1381 1381
 
1382 1382
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:30
1383
-	__( 'amount', 'event_espresso' ),
1383
+	__('amount', 'event_espresso'),
1384 1384
 
1385 1385
 	// Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:42
1386
-	__( 'amount…', 'event_espresso' ),
1386
+	__('amount…', 'event_espresso'),
1387 1387
 
1388 1388
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:14
1389
-	__( 'description…', 'event_espresso' ),
1389
+	__('description…', 'event_espresso'),
1390 1390
 
1391 1391
 	// Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:9
1392
-	__( 'price description', 'event_espresso' ),
1392
+	__('price description', 'event_espresso'),
1393 1393
 
1394 1394
 	// Reference: packages/tpc/src/inputs/PriceIdInput.tsx:5
1395
-	__( 'price id', 'event_espresso' ),
1395
+	__('price id', 'event_espresso'),
1396 1396
 
1397 1397
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:13
1398
-	__( 'label…', 'event_espresso' ),
1398
+	__('label…', 'event_espresso'),
1399 1399
 
1400 1400
 	// Reference: packages/tpc/src/inputs/PriceNameInput.tsx:8
1401
-	__( 'price name', 'event_espresso' ),
1401
+	__('price name', 'event_espresso'),
1402 1402
 
1403 1403
 	// Reference: packages/tpc/src/inputs/PriceOrderInput.tsx:14
1404
-	__( 'price order', 'event_espresso' ),
1404
+	__('price order', 'event_espresso'),
1405 1405
 
1406 1406
 	// Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:19
1407
-	__( 'price type', 'event_espresso' ),
1407
+	__('price type', 'event_espresso'),
1408 1408
 
1409 1409
 	// Reference: packages/tpc/src/utils/constants.ts:8
1410
-	__( 'Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso' ),
1410
+	__('Ticket price modifications are blocked for Tickets that have already been sold to registrants, because doing so would negatively affect internal accounting for the event. If you still need to modify ticket prices, then create a copy of those tickets, edit the prices for the new tickets, and then trash the old tickets.', 'event_espresso'),
1411 1411
 
1412 1412
 	// Reference: packages/ui-components/src/ActiveFilters/ActiveFilters.tsx:8
1413
-	__( 'active filters:', 'event_espresso' ),
1413
+	__('active filters:', 'event_espresso'),
1414 1414
 
1415 1415
 	// Reference: packages/ui-components/src/ActiveFilters/FilterTag/index.tsx:15
1416 1416
 	/* translators: %s filter name */
1417
-	__( 'remove filter - %s', 'event_espresso' ),
1417
+	__('remove filter - %s', 'event_espresso'),
1418 1418
 
1419 1419
 	// Reference: packages/ui-components/src/CalendarDateRange/CalendarDateRange.tsx:37
1420
-	__( 'to', 'event_espresso' ),
1420
+	__('to', 'event_espresso'),
1421 1421
 
1422 1422
 	// Reference: packages/ui-components/src/CalendarPageDate/CalendarPageDate.tsx:54
1423
-	__( 'TO', 'event_espresso' ),
1423
+	__('TO', 'event_espresso'),
1424 1424
 
1425 1425
 	// Reference: packages/ui-components/src/ColorPicker/ColorPicker.tsx:60
1426
-	__( 'Custom color', 'event_espresso' ),
1426
+	__('Custom color', 'event_espresso'),
1427 1427
 
1428 1428
 	// Reference: packages/ui-components/src/ColorPicker/Swatch.tsx:23
1429 1429
 	/* translators: color name */
1430
-	__( 'Color: %s', 'event_espresso' ),
1430
+	__('Color: %s', 'event_espresso'),
1431 1431
 
1432 1432
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:13
1433
-	__( 'Cyan bluish gray', 'event_espresso' ),
1433
+	__('Cyan bluish gray', 'event_espresso'),
1434 1434
 
1435 1435
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:17
1436
-	__( 'White', 'event_espresso' ),
1436
+	__('White', 'event_espresso'),
1437 1437
 
1438 1438
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:21
1439
-	__( 'Pale pink', 'event_espresso' ),
1439
+	__('Pale pink', 'event_espresso'),
1440 1440
 
1441 1441
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:25
1442
-	__( 'Vivid red', 'event_espresso' ),
1442
+	__('Vivid red', 'event_espresso'),
1443 1443
 
1444 1444
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:29
1445
-	__( 'Luminous vivid orange', 'event_espresso' ),
1445
+	__('Luminous vivid orange', 'event_espresso'),
1446 1446
 
1447 1447
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:33
1448
-	__( 'Luminous vivid amber', 'event_espresso' ),
1448
+	__('Luminous vivid amber', 'event_espresso'),
1449 1449
 
1450 1450
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:37
1451
-	__( 'Light green cyan', 'event_espresso' ),
1451
+	__('Light green cyan', 'event_espresso'),
1452 1452
 
1453 1453
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:41
1454
-	__( 'Vivid green cyan', 'event_espresso' ),
1454
+	__('Vivid green cyan', 'event_espresso'),
1455 1455
 
1456 1456
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:45
1457
-	__( 'Pale cyan blue', 'event_espresso' ),
1457
+	__('Pale cyan blue', 'event_espresso'),
1458 1458
 
1459 1459
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:49
1460
-	__( 'Vivid cyan blue', 'event_espresso' ),
1460
+	__('Vivid cyan blue', 'event_espresso'),
1461 1461
 
1462 1462
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:53
1463
-	__( 'Vivid purple', 'event_espresso' ),
1463
+	__('Vivid purple', 'event_espresso'),
1464 1464
 
1465 1465
 	// Reference: packages/ui-components/src/ColorPicker/constants.ts:9
1466
-	__( 'Black', 'event_espresso' ),
1466
+	__('Black', 'event_espresso'),
1467 1467
 
1468 1468
 	// Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:7
1469 1469
 	// Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:22
1470
-	__( 'Are you sure you want to close this?', 'event_espresso' ),
1470
+	__('Are you sure you want to close this?', 'event_espresso'),
1471 1471
 
1472 1472
 	// Reference: packages/ui-components/src/Confirm/ConfirmDelete.tsx:7
1473
-	__( 'Are you sure you want to delete this?', 'event_espresso' ),
1473
+	__('Are you sure you want to delete this?', 'event_espresso'),
1474 1474
 
1475 1475
 	// Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:10
1476
-	__( 'Please confirm this action.', 'event_espresso' ),
1476
+	__('Please confirm this action.', 'event_espresso'),
1477 1477
 
1478 1478
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:32
1479
-	__( 'No', 'event_espresso' ),
1479
+	__('No', 'event_espresso'),
1480 1480
 
1481 1481
 	// Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:33
1482
-	__( 'Yes', 'event_espresso' ),
1482
+	__('Yes', 'event_espresso'),
1483 1483
 
1484 1484
 	// Reference: packages/ui-components/src/CurrencyDisplay/CurrencyDisplay.tsx:34
1485
-	__( 'free', 'event_espresso' ),
1485
+	__('free', 'event_espresso'),
1486 1486
 
1487 1487
 	// Reference: packages/ui-components/src/DateTimeRangePicker/DateTimeRangePicker.tsx:117
1488 1488
 	// Reference: packages/ui-components/src/Popover/PopoverForm/PopoverForm.tsx:43
1489
-	__( 'save', 'event_espresso' ),
1489
+	__('save', 'event_espresso'),
1490 1490
 
1491 1491
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
1492
-	__( 'Hide Debug Info', 'event_espresso' ),
1492
+	__('Hide Debug Info', 'event_espresso'),
1493 1493
 
1494 1494
 	// Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36
1495
-	__( 'Show Debug Info', 'event_espresso' ),
1495
+	__('Show Debug Info', 'event_espresso'),
1496 1496
 
1497 1497
 	// Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:49
1498
-	__( 'Edit Start and End Dates and Times', 'event_espresso' ),
1498
+	__('Edit Start and End Dates and Times', 'event_espresso'),
1499 1499
 
1500 1500
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Copy.tsx:8
1501
-	__( 'copy', 'event_espresso' ),
1501
+	__('copy', 'event_espresso'),
1502 1502
 
1503 1503
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Edit.tsx:8
1504
-	__( 'edit', 'event_espresso' ),
1504
+	__('edit', 'event_espresso'),
1505 1505
 
1506 1506
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Trash.tsx:8
1507
-	__( 'trash', 'event_espresso' ),
1507
+	__('trash', 'event_espresso'),
1508 1508
 
1509 1509
 	// Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Untrash.tsx:8
1510
-	__( 'untrash', 'event_espresso' ),
1510
+	__('untrash', 'event_espresso'),
1511 1511
 
1512 1512
 	// Reference: packages/ui-components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:37
1513
-	__( 'view approved registrations for this date.', 'event_espresso' ),
1513
+	__('view approved registrations for this date.', 'event_espresso'),
1514 1514
 
1515 1515
 	// Reference: packages/ui-components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:38
1516
-	__( 'view approved registrations for this ticket.', 'event_espresso' ),
1516
+	__('view approved registrations for this ticket.', 'event_espresso'),
1517 1517
 
1518 1518
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:21
1519
-	__( 'card view', 'event_espresso' ),
1519
+	__('card view', 'event_espresso'),
1520 1520
 
1521 1521
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:20
1522
-	__( 'table view', 'event_espresso' ),
1522
+	__('table view', 'event_espresso'),
1523 1523
 
1524 1524
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
1525
-	__( 'hide bulk actions', 'event_espresso' ),
1525
+	__('hide bulk actions', 'event_espresso'),
1526 1526
 
1527 1527
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8
1528
-	__( 'show bulk actions', 'event_espresso' ),
1528
+	__('show bulk actions', 'event_espresso'),
1529 1529
 
1530 1530
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9
1531
-	__( 'hide filters', 'event_espresso' ),
1531
+	__('hide filters', 'event_espresso'),
1532 1532
 
1533 1533
 	// Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9
1534
-	__( 'show filters', 'event_espresso' ),
1534
+	__('show filters', 'event_espresso'),
1535 1535
 
1536 1536
 	// Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26
1537
-	__( 'hide legend', 'event_espresso' ),
1537
+	__('hide legend', 'event_espresso'),
1538 1538
 
1539 1539
 	// Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26
1540
-	__( 'show legend', 'event_espresso' ),
1540
+	__('show legend', 'event_espresso'),
1541 1541
 
1542 1542
 	// Reference: packages/ui-components/src/LoadingNotice/LoadingNotice.tsx:11
1543
-	__( 'loading…', 'event_espresso' ),
1543
+	__('loading…', 'event_espresso'),
1544 1544
 
1545 1545
 	// Reference: packages/ui-components/src/Modal/Modal.tsx:58
1546
-	__( 'close modal', 'event_espresso' ),
1546
+	__('close modal', 'event_espresso'),
1547 1547
 
1548 1548
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:10
1549
-	__( 'jump to previous', 'event_espresso' ),
1549
+	__('jump to previous', 'event_espresso'),
1550 1550
 
1551 1551
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:11
1552
-	__( 'jump to next', 'event_espresso' ),
1552
+	__('jump to next', 'event_espresso'),
1553 1553
 
1554 1554
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:12
1555
-	__( 'page', 'event_espresso' ),
1555
+	__('page', 'event_espresso'),
1556 1556
 
1557 1557
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:8
1558
-	__( 'previous', 'event_espresso' ),
1558
+	__('previous', 'event_espresso'),
1559 1559
 
1560 1560
 	// Reference: packages/ui-components/src/Pagination/ItemRender.tsx:9
1561
-	__( 'next', 'event_espresso' ),
1561
+	__('next', 'event_espresso'),
1562 1562
 
1563 1563
 	// Reference: packages/ui-components/src/Pagination/PerPage.tsx:37
1564
-	__( 'items per page', 'event_espresso' ),
1564
+	__('items per page', 'event_espresso'),
1565 1565
 
1566 1566
 	// Reference: packages/ui-components/src/Pagination/constants.ts:10
1567 1567
 	/* translators: %s is per page value */
1568
-	__( '%s / page', 'event_espresso' ),
1568
+	__('%s / page', 'event_espresso'),
1569 1569
 
1570 1570
 	// Reference: packages/ui-components/src/Pagination/constants.ts:13
1571
-	__( 'Next Page', 'event_espresso' ),
1571
+	__('Next Page', 'event_espresso'),
1572 1572
 
1573 1573
 	// Reference: packages/ui-components/src/Pagination/constants.ts:14
1574
-	__( 'Previous Page', 'event_espresso' ),
1574
+	__('Previous Page', 'event_espresso'),
1575 1575
 
1576 1576
 	// Reference: packages/ui-components/src/PercentSign/index.tsx:10
1577
-	__( '%', 'event_espresso' ),
1577
+	__('%', 'event_espresso'),
1578 1578
 
1579 1579
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:23
1580
-	__( 'Select an existing one to use as a template.', 'event_espresso' ),
1580
+	__('Select an existing one to use as a template.', 'event_espresso'),
1581 1581
 
1582 1582
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:27
1583
-	__( 'or', 'event_espresso' ),
1583
+	__('or', 'event_espresso'),
1584 1584
 
1585 1585
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:30
1586
-	__( 'Add new and insert details manually', 'event_espresso' ),
1586
+	__('Add new and insert details manually', 'event_espresso'),
1587 1587
 
1588 1588
 	// Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:34
1589
-	__( 'Add New', 'event_espresso' ),
1589
+	__('Add New', 'event_espresso'),
1590 1590
 
1591 1591
 	// Reference: packages/ui-components/src/Stepper/buttons/Next.tsx:8
1592
-	__( 'Next', 'event_espresso' ),
1592
+	__('Next', 'event_espresso'),
1593 1593
 
1594 1594
 	// Reference: packages/ui-components/src/Stepper/buttons/Previous.tsx:8
1595
-	__( 'Previous', 'event_espresso' ),
1595
+	__('Previous', 'event_espresso'),
1596 1596
 
1597 1597
 	// Reference: packages/ui-components/src/Steps/Steps.tsx:31
1598
-	__( 'Steps', 'event_espresso' ),
1598
+	__('Steps', 'event_espresso'),
1599 1599
 
1600 1600
 	// Reference: packages/ui-components/src/TabbableText/index.tsx:19
1601
-	__( 'Click to edit…', 'event_espresso' ),
1601
+	__('Click to edit…', 'event_espresso'),
1602 1602
 
1603 1603
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:14
1604
-	__( 'The Website\'s Time Zone', 'event_espresso' ),
1604
+	__('The Website\'s Time Zone', 'event_espresso'),
1605 1605
 
1606 1606
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:19
1607
-	__( 'UTC (Greenwich Mean Time)', 'event_espresso' ),
1607
+	__('UTC (Greenwich Mean Time)', 'event_espresso'),
1608 1608
 
1609 1609
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:9
1610
-	__( 'Your Local Time Zone', 'event_espresso' ),
1610
+	__('Your Local Time Zone', 'event_espresso'),
1611 1611
 
1612 1612
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:27
1613
-	__( 'click for timezone information', 'event_espresso' ),
1613
+	__('click for timezone information', 'event_espresso'),
1614 1614
 
1615 1615
 	// Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:32
1616
-	__( 'This Date Converted To:', 'event_espresso' ),
1616
+	__('This Date Converted To:', 'event_espresso'),
1617 1617
 
1618 1618
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:51
1619
-	__( 'select all', 'event_espresso' ),
1619
+	__('select all', 'event_espresso'),
1620 1620
 
1621 1621
 	// Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:54
1622
-	__( 'apply', 'event_espresso' )
1622
+	__('apply', 'event_espresso')
1623 1623
 );
1624 1624
 /* THIS IS THE END OF THE GENERATED FILE */
Please login to merge, or discard this patch.