@@ -2,137 +2,137 @@ discard block |
||
| 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/core/admin/blocks/src/components/AvatarImage.tsx:27 |
| 20 | - __( 'contact avatar', 'event_espresso' ), |
|
| 20 | + __('contact avatar', 'event_espresso'), |
|
| 21 | 21 | |
| 22 | 22 | // Reference: domains/core/admin/blocks/src/components/OrderByControl.tsx:12 |
| 23 | - __( 'Order by', 'event_espresso' ), |
|
| 23 | + __('Order by', 'event_espresso'), |
|
| 24 | 24 | |
| 25 | 25 | // Reference: domains/core/admin/blocks/src/components/RegStatusControl.tsx:17 |
| 26 | 26 | // Reference: domains/core/admin/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/core/admin/blocks/src/components/SortOrderControl.tsx:14 |
| 30 | - __( 'Ascending', 'event_espresso' ), |
|
| 30 | + __('Ascending', 'event_espresso'), |
|
| 31 | 31 | |
| 32 | 32 | // Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:18 |
| 33 | - __( 'Descending', 'event_espresso' ), |
|
| 33 | + __('Descending', 'event_espresso'), |
|
| 34 | 34 | |
| 35 | 35 | // Reference: domains/core/admin/blocks/src/components/SortOrderControl.tsx:24 |
| 36 | - __( 'Sort order:', 'event_espresso' ), |
|
| 36 | + __('Sort order:', 'event_espresso'), |
|
| 37 | 37 | |
| 38 | 38 | // Reference: domains/core/admin/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/core/admin/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/core/admin/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/core/admin/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/core/admin/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/core/admin/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/core/admin/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/core/admin/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/core/admin/blocks/src/event-attendees/controls/GravatarSettings.tsx:27 |
| 64 | - __( 'Display Gravatar', 'event_espresso' ), |
|
| 64 | + __('Display Gravatar', 'event_espresso'), |
|
| 65 | 65 | |
| 66 | 66 | // Reference: domains/core/admin/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/core/admin/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/core/admin/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/core/admin/blocks/src/event-attendees/controls/SelectDatetime.tsx:22 |
| 76 | - __( 'Select Datetime', 'event_espresso' ), |
|
| 76 | + __('Select Datetime', 'event_espresso'), |
|
| 77 | 77 | |
| 78 | 78 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectEvent.tsx:22 |
| 79 | 79 | // Reference: domains/core/admin/blocks/src/event/controls/SelectEvent.tsx:22 |
| 80 | - __( 'Select Event', 'event_espresso' ), |
|
| 80 | + __('Select Event', 'event_espresso'), |
|
| 81 | 81 | |
| 82 | 82 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:11 |
| 83 | - __( 'Attendee id', 'event_espresso' ), |
|
| 83 | + __('Attendee id', 'event_espresso'), |
|
| 84 | 84 | |
| 85 | 85 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:15 |
| 86 | - __( 'Last name only', 'event_espresso' ), |
|
| 86 | + __('Last name only', 'event_espresso'), |
|
| 87 | 87 | |
| 88 | 88 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:19 |
| 89 | - __( 'First name only', 'event_espresso' ), |
|
| 89 | + __('First name only', 'event_espresso'), |
|
| 90 | 90 | |
| 91 | 91 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:23 |
| 92 | - __( 'First, then Last name', 'event_espresso' ), |
|
| 92 | + __('First, then Last name', 'event_espresso'), |
|
| 93 | 93 | |
| 94 | 94 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:27 |
| 95 | - __( 'Last, then First name', 'event_espresso' ), |
|
| 95 | + __('Last, then First name', 'event_espresso'), |
|
| 96 | 96 | |
| 97 | 97 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectOrderBy.tsx:41 |
| 98 | - __( 'Order Attendees by:', 'event_espresso' ), |
|
| 98 | + __('Order Attendees by:', 'event_espresso'), |
|
| 99 | 99 | |
| 100 | 100 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/SelectTicket.tsx:22 |
| 101 | - __( 'Select Ticket', 'event_espresso' ), |
|
| 101 | + __('Select Ticket', 'event_espresso'), |
|
| 102 | 102 | |
| 103 | 103 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:21 |
| 104 | - __( 'Filter By Settings', 'event_espresso' ), |
|
| 104 | + __('Filter By Settings', 'event_espresso'), |
|
| 105 | 105 | |
| 106 | 106 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:36 |
| 107 | - __( 'Gravatar Setttings', 'event_espresso' ), |
|
| 107 | + __('Gravatar Setttings', 'event_espresso'), |
|
| 108 | 108 | |
| 109 | 109 | // Reference: domains/core/admin/blocks/src/event-attendees/controls/index.tsx:39 |
| 110 | - __( 'Archive Settings', 'event_espresso' ), |
|
| 110 | + __('Archive Settings', 'event_espresso'), |
|
| 111 | 111 | |
| 112 | 112 | // Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:10 |
| 113 | - __( 'Event Attendees', 'event_espresso' ), |
|
| 113 | + __('Event Attendees', 'event_espresso'), |
|
| 114 | 114 | |
| 115 | 115 | // Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:11 |
| 116 | - __( 'Displays a list of people that have registered for the specified event', 'event_espresso' ), |
|
| 116 | + __('Displays a list of people that have registered for the specified event', 'event_espresso'), |
|
| 117 | 117 | |
| 118 | 118 | // Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14 |
| 119 | 119 | // Reference: domains/core/admin/blocks/src/event/index.tsx:12 |
| 120 | 120 | // Reference: packages/edtr-services/src/constants.ts:25 |
| 121 | - __( 'event', 'event_espresso' ), |
|
| 121 | + __('event', 'event_espresso'), |
|
| 122 | 122 | |
| 123 | 123 | // Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14 |
| 124 | - __( 'attendees', 'event_espresso' ), |
|
| 124 | + __('attendees', 'event_espresso'), |
|
| 125 | 125 | |
| 126 | 126 | // Reference: domains/core/admin/blocks/src/event-attendees/index.tsx:14 |
| 127 | - __( 'list', 'event_espresso' ), |
|
| 127 | + __('list', 'event_espresso'), |
|
| 128 | 128 | |
| 129 | 129 | // Reference: domains/core/admin/blocks/src/event/DisplayField.tsx:41 |
| 130 | - __( 'An unknown error occurred while fetching event details.', 'event_espresso' ), |
|
| 130 | + __('An unknown error occurred while fetching event details.', 'event_espresso'), |
|
| 131 | 131 | |
| 132 | 132 | // Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:10 |
| 133 | 133 | // Reference: domains/core/admin/blocks/src/services/utils.ts:24 |
| 134 | 134 | // Reference: packages/utils/src/list/index.ts:14 |
| 135 | - __( 'Select…', 'event_espresso' ), |
|
| 135 | + __('Select…', 'event_espresso'), |
|
| 136 | 136 | |
| 137 | 137 | // Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:15 |
| 138 | 138 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:75 |
@@ -141,7 +141,7 @@ discard block |
||
| 141 | 141 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:198 |
| 142 | 142 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:48 |
| 143 | 143 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:40 |
| 144 | - __( 'Name', 'event_espresso' ), |
|
| 144 | + __('Name', 'event_espresso'), |
|
| 145 | 145 | |
| 146 | 146 | // Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:19 |
| 147 | 147 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:80 |
@@ -149,407 +149,407 @@ discard block |
||
| 149 | 149 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:203 |
| 150 | 150 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:54 |
| 151 | 151 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47 |
| 152 | - __( 'Description', 'event_espresso' ), |
|
| 152 | + __('Description', 'event_espresso'), |
|
| 153 | 153 | |
| 154 | 154 | // Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:23 |
| 155 | - __( 'Short description', 'event_espresso' ), |
|
| 155 | + __('Short description', 'event_espresso'), |
|
| 156 | 156 | |
| 157 | 157 | // Reference: domains/core/admin/blocks/src/event/controls/SelectField.tsx:35 |
| 158 | - __( 'Select Field', 'event_espresso' ), |
|
| 158 | + __('Select Field', 'event_espresso'), |
|
| 159 | 159 | |
| 160 | 160 | // Reference: domains/core/admin/blocks/src/event/controls/index.tsx:27 |
| 161 | - __( 'Text Color', 'event_espresso' ), |
|
| 161 | + __('Text Color', 'event_espresso'), |
|
| 162 | 162 | |
| 163 | 163 | // Reference: domains/core/admin/blocks/src/event/controls/index.tsx:32 |
| 164 | - __( 'Background Color', 'event_espresso' ), |
|
| 164 | + __('Background Color', 'event_espresso'), |
|
| 165 | 165 | |
| 166 | 166 | // Reference: domains/core/admin/blocks/src/event/controls/index.tsx:41 |
| 167 | 167 | // Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:22 |
| 168 | 168 | // Reference: packages/form-builder/src/FormSection/Tabs/FormSectionTabs.tsx:21 |
| 169 | - __( 'Settings', 'event_espresso' ), |
|
| 169 | + __('Settings', 'event_espresso'), |
|
| 170 | 170 | |
| 171 | 171 | // Reference: domains/core/admin/blocks/src/event/controls/index.tsx:45 |
| 172 | - __( 'Typography', 'event_espresso' ), |
|
| 172 | + __('Typography', 'event_espresso'), |
|
| 173 | 173 | |
| 174 | 174 | // Reference: domains/core/admin/blocks/src/event/controls/index.tsx:48 |
| 175 | - __( 'Color', 'event_espresso' ), |
|
| 175 | + __('Color', 'event_espresso'), |
|
| 176 | 176 | |
| 177 | 177 | // Reference: domains/core/admin/blocks/src/event/index.tsx:12 |
| 178 | - __( 'field', 'event_espresso' ), |
|
| 178 | + __('field', 'event_espresso'), |
|
| 179 | 179 | |
| 180 | 180 | // Reference: domains/core/admin/blocks/src/event/index.tsx:8 |
| 181 | - __( 'Event Field', 'event_espresso' ), |
|
| 181 | + __('Event Field', 'event_espresso'), |
|
| 182 | 182 | |
| 183 | 183 | // Reference: domains/core/admin/blocks/src/event/index.tsx:9 |
| 184 | - __( 'Displays the selected field of an event', 'event_espresso' ), |
|
| 184 | + __('Displays the selected field of an event', 'event_espresso'), |
|
| 185 | 185 | |
| 186 | 186 | // Reference: domains/core/admin/blocks/src/services/utils.ts:17 |
| 187 | - __( 'Error', 'event_espresso' ), |
|
| 187 | + __('Error', 'event_espresso'), |
|
| 188 | 188 | |
| 189 | 189 | // Reference: domains/core/admin/blocks/src/services/utils.ts:9 |
| 190 | - __( 'Loading…', 'event_espresso' ), |
|
| 190 | + __('Loading…', 'event_espresso'), |
|
| 191 | 191 | |
| 192 | 192 | // Reference: domains/core/admin/eventEditor/src/ui/EventDescription.tsx:33 |
| 193 | - __( 'Event Description', 'event_espresso' ), |
|
| 193 | + __('Event Description', 'event_espresso'), |
|
| 194 | 194 | |
| 195 | 195 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:28 |
| 196 | - __( 'Active status', 'event_espresso' ), |
|
| 196 | + __('Active status', 'event_espresso'), |
|
| 197 | 197 | |
| 198 | 198 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:12 |
| 199 | - __( 'Alternative Registration Page', 'event_espresso' ), |
|
| 199 | + __('Alternative Registration Page', 'event_espresso'), |
|
| 200 | 200 | |
| 201 | 201 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:25 |
| 202 | - __( 'Default Registration Status', 'event_espresso' ), |
|
| 202 | + __('Default Registration Status', 'event_espresso'), |
|
| 203 | 203 | |
| 204 | 204 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:8 |
| 205 | - __( 'Donations Enabled', 'event_espresso' ), |
|
| 205 | + __('Donations Enabled', 'event_espresso'), |
|
| 206 | 206 | |
| 207 | 207 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:8 |
| 208 | - __( 'Donations Disabled', 'event_espresso' ), |
|
| 208 | + __('Donations Disabled', 'event_espresso'), |
|
| 209 | 209 | |
| 210 | 210 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:16 |
| 211 | - __( 'Event Manager', 'event_espresso' ), |
|
| 211 | + __('Event Manager', 'event_espresso'), |
|
| 212 | 212 | |
| 213 | 213 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:15 |
| 214 | - __( 'Event Phone Number', 'event_espresso' ), |
|
| 214 | + __('Event Phone Number', 'event_espresso'), |
|
| 215 | 215 | |
| 216 | 216 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:13 |
| 217 | - __( 'Max Registrations per Transaction', 'event_espresso' ), |
|
| 217 | + __('Max Registrations per Transaction', 'event_espresso'), |
|
| 218 | 218 | |
| 219 | 219 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:8 |
| 220 | - __( 'Ticket Selector Enabled', 'event_espresso' ), |
|
| 220 | + __('Ticket Selector Enabled', 'event_espresso'), |
|
| 221 | 221 | |
| 222 | 222 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:8 |
| 223 | - __( 'Ticket Selector Disabled', 'event_espresso' ), |
|
| 223 | + __('Ticket Selector Disabled', 'event_espresso'), |
|
| 224 | 224 | |
| 225 | 225 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/index.tsx:41 |
| 226 | - __( 'Event Details', 'event_espresso' ), |
|
| 226 | + __('Event Details', 'event_espresso'), |
|
| 227 | 227 | |
| 228 | 228 | // Reference: domains/core/admin/eventEditor/src/ui/EventRegistrationOptions/index.tsx:47 |
| 229 | - __( 'Registration Options', 'event_espresso' ), |
|
| 229 | + __('Registration Options', 'event_espresso'), |
|
| 230 | 230 | |
| 231 | 231 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10 |
| 232 | - __( 'primary information about the date', 'event_espresso' ), |
|
| 232 | + __('primary information about the date', 'event_espresso'), |
|
| 233 | 233 | |
| 234 | 234 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10 |
| 235 | - __( 'Date Details', 'event_espresso' ), |
|
| 235 | + __('Date Details', 'event_espresso'), |
|
| 236 | 236 | |
| 237 | 237 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11 |
| 238 | 238 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16 |
| 239 | 239 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16 |
| 240 | - __( 'relations between tickets and dates', 'event_espresso' ), |
|
| 240 | + __('relations between tickets and dates', 'event_espresso'), |
|
| 241 | 241 | |
| 242 | 242 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11 |
| 243 | - __( 'Assign Tickets', 'event_espresso' ), |
|
| 243 | + __('Assign Tickets', 'event_espresso'), |
|
| 244 | 244 | |
| 245 | 245 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/FooterButtons.tsx:22 |
| 246 | - __( 'Save and assign tickets', 'event_espresso' ), |
|
| 246 | + __('Save and assign tickets', 'event_espresso'), |
|
| 247 | 247 | |
| 248 | 248 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:30 |
| 249 | 249 | /* translators: %d database id */ |
| 250 | - __( 'Edit datetime %s', 'event_espresso' ), |
|
| 250 | + __('Edit datetime %s', 'event_espresso'), |
|
| 251 | 251 | |
| 252 | 252 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:33 |
| 253 | - __( 'New Datetime', 'event_espresso' ), |
|
| 253 | + __('New Datetime', 'event_espresso'), |
|
| 254 | 254 | |
| 255 | 255 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:43 |
| 256 | - __( 'modal for datetime', 'event_espresso' ), |
|
| 256 | + __('modal for datetime', 'event_espresso'), |
|
| 257 | 257 | |
| 258 | 258 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:110 |
| 259 | 259 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:107 |
| 260 | 260 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:233 |
| 261 | 261 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:106 |
| 262 | - __( 'Details', 'event_espresso' ), |
|
| 262 | + __('Details', 'event_espresso'), |
|
| 263 | 263 | |
| 264 | 264 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:114 |
| 265 | 265 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:111 |
| 266 | 266 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:81 |
| 267 | - __( 'Capacity', 'event_espresso' ), |
|
| 267 | + __('Capacity', 'event_espresso'), |
|
| 268 | 268 | |
| 269 | 269 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:119 |
| 270 | - __( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ), |
|
| 270 | + __('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'), |
|
| 271 | 271 | |
| 272 | 272 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:123 |
| 273 | - __( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ), |
|
| 273 | + __('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'), |
|
| 274 | 274 | |
| 275 | 275 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:129 |
| 276 | 276 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:171 |
| 277 | - __( 'Trash', 'event_espresso' ), |
|
| 277 | + __('Trash', 'event_espresso'), |
|
| 278 | 278 | |
| 279 | 279 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:71 |
| 280 | 280 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:44 |
| 281 | 281 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:194 |
| 282 | 282 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:44 |
| 283 | - __( 'Basics', 'event_espresso' ), |
|
| 283 | + __('Basics', 'event_espresso'), |
|
| 284 | 284 | |
| 285 | 285 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:88 |
| 286 | 286 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:62 |
| 287 | 287 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:62 |
| 288 | - __( 'Dates', 'event_espresso' ), |
|
| 288 | + __('Dates', 'event_espresso'), |
|
| 289 | 289 | |
| 290 | 290 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:92 |
| 291 | 291 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:51 |
| 292 | 292 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:215 |
| 293 | - __( 'Start Date', 'event_espresso' ), |
|
| 293 | + __('Start Date', 'event_espresso'), |
|
| 294 | 294 | |
| 295 | 295 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:99 |
| 296 | 296 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:65 |
| 297 | 297 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:222 |
| 298 | - __( 'End Date', 'event_espresso' ), |
|
| 298 | + __('End Date', 'event_espresso'), |
|
| 299 | 299 | |
| 300 | 300 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DateRegistrationsLink.tsx:13 |
| 301 | - __( 'view ALL registrations for this date.', 'event_espresso' ), |
|
| 301 | + __('view ALL registrations for this date.', 'event_espresso'), |
|
| 302 | 302 | |
| 303 | 303 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DateSoldLink.tsx:13 |
| 304 | - __( 'view approved registrations for this date.', 'event_espresso' ), |
|
| 304 | + __('view approved registrations for this date.', 'event_espresso'), |
|
| 305 | 305 | |
| 306 | 306 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:35 |
| 307 | 307 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:33 |
| 308 | - __( 'Event Dates', 'event_espresso' ), |
|
| 308 | + __('Event Dates', 'event_espresso'), |
|
| 309 | 309 | |
| 310 | 310 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:38 |
| 311 | - __( 'loading event dates…', 'event_espresso' ), |
|
| 311 | + __('loading event dates…', 'event_espresso'), |
|
| 312 | 312 | |
| 313 | 313 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:22 |
| 314 | - __( 'Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso' ), |
|
| 314 | + __('Add a date or a ticket in order to use Ticket Assignment Manager', 'event_espresso'), |
|
| 315 | 315 | |
| 316 | 316 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:32 |
| 317 | - __( 'Ticket Assignments', 'event_espresso' ), |
|
| 317 | + __('Ticket Assignments', 'event_espresso'), |
|
| 318 | 318 | |
| 319 | 319 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:25 |
| 320 | - __( 'Number of related tickets', 'event_espresso' ), |
|
| 320 | + __('Number of related tickets', 'event_espresso'), |
|
| 321 | 321 | |
| 322 | 322 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:26 |
| 323 | - __( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ), |
|
| 323 | + __('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'), |
|
| 324 | 324 | |
| 325 | 325 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:34 |
| 326 | - __( 'assign tickets', 'event_espresso' ), |
|
| 326 | + __('assign tickets', 'event_espresso'), |
|
| 327 | 327 | |
| 328 | 328 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:21 |
| 329 | - __( 'event datetime main menu', 'event_espresso' ), |
|
| 329 | + __('event datetime main menu', 'event_espresso'), |
|
| 330 | 330 | |
| 331 | 331 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:33 |
| 332 | - __( 'edit datetime', 'event_espresso' ), |
|
| 332 | + __('edit datetime', 'event_espresso'), |
|
| 333 | 333 | |
| 334 | 334 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:34 |
| 335 | - __( 'copy datetime', 'event_espresso' ), |
|
| 335 | + __('copy datetime', 'event_espresso'), |
|
| 336 | 336 | |
| 337 | 337 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:15 |
| 338 | 338 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:48 |
| 339 | - __( 'delete permanently', 'event_espresso' ), |
|
| 339 | + __('delete permanently', 'event_espresso'), |
|
| 340 | 340 | |
| 341 | 341 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:15 |
| 342 | - __( 'trash datetime', 'event_espresso' ), |
|
| 342 | + __('trash datetime', 'event_espresso'), |
|
| 343 | 343 | |
| 344 | 344 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:18 |
| 345 | - __( 'Permanently Delete Datetime?', 'event_espresso' ), |
|
| 345 | + __('Permanently Delete Datetime?', 'event_espresso'), |
|
| 346 | 346 | |
| 347 | 347 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:18 |
| 348 | - __( 'Move Datetime to Trash?', 'event_espresso' ), |
|
| 348 | + __('Move Datetime to Trash?', 'event_espresso'), |
|
| 349 | 349 | |
| 350 | 350 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:20 |
| 351 | - __( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ), |
|
| 351 | + __('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'), |
|
| 352 | 352 | |
| 353 | 353 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:23 |
| 354 | - __( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ), |
|
| 354 | + __('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'), |
|
| 355 | 355 | |
| 356 | 356 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DeleteDatetime.tsx:33 |
| 357 | - __( 'delete', 'event_espresso' ), |
|
| 357 | + __('delete', 'event_espresso'), |
|
| 358 | 358 | |
| 359 | 359 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:36 |
| 360 | 360 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:40 |
| 361 | 361 | // Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:43 |
| 362 | - __( 'bulk actions', 'event_espresso' ), |
|
| 362 | + __('bulk actions', 'event_espresso'), |
|
| 363 | 363 | |
| 364 | 364 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:40 |
| 365 | - __( 'edit datetime details', 'event_espresso' ), |
|
| 365 | + __('edit datetime details', 'event_espresso'), |
|
| 366 | 366 | |
| 367 | 367 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44 |
| 368 | - __( 'delete datetimes', 'event_espresso' ), |
|
| 368 | + __('delete datetimes', 'event_espresso'), |
|
| 369 | 369 | |
| 370 | 370 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44 |
| 371 | - __( 'trash datetimes', 'event_espresso' ), |
|
| 371 | + __('trash datetimes', 'event_espresso'), |
|
| 372 | 372 | |
| 373 | 373 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14 |
| 374 | - __( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ), |
|
| 374 | + __('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'), |
|
| 375 | 375 | |
| 376 | 376 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15 |
| 377 | - __( 'Are you sure you want to trash these datetimes?', 'event_espresso' ), |
|
| 377 | + __('Are you sure you want to trash these datetimes?', 'event_espresso'), |
|
| 378 | 378 | |
| 379 | 379 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16 |
| 380 | - __( 'Delete datetimes permanently', 'event_espresso' ), |
|
| 380 | + __('Delete datetimes permanently', 'event_espresso'), |
|
| 381 | 381 | |
| 382 | 382 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16 |
| 383 | - __( 'Trash datetimes', 'event_espresso' ), |
|
| 383 | + __('Trash datetimes', 'event_espresso'), |
|
| 384 | 384 | |
| 385 | 385 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:21 |
| 386 | - __( 'Bulk edit date details', 'event_espresso' ), |
|
| 386 | + __('Bulk edit date details', 'event_espresso'), |
|
| 387 | 387 | |
| 388 | 388 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22 |
| 389 | - __( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ), |
|
| 389 | + __('any changes will be applied to ALL of the selected dates.', 'event_espresso'), |
|
| 390 | 390 | |
| 391 | 391 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12 |
| 392 | 392 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12 |
| 393 | - __( 'Name must be at least three characters', 'event_espresso' ), |
|
| 393 | + __('Name must be at least three characters', 'event_espresso'), |
|
| 394 | 394 | |
| 395 | 395 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:66 |
| 396 | 396 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:66 |
| 397 | - __( 'Shift dates', 'event_espresso' ), |
|
| 397 | + __('Shift dates', 'event_espresso'), |
|
| 398 | 398 | |
| 399 | 399 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:91 |
| 400 | 400 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:90 |
| 401 | - __( 'earlier', 'event_espresso' ), |
|
| 401 | + __('earlier', 'event_espresso'), |
|
| 402 | 402 | |
| 403 | 403 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:95 |
| 404 | 404 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:94 |
| 405 | - __( 'later', 'event_espresso' ), |
|
| 405 | + __('later', 'event_espresso'), |
|
| 406 | 406 | |
| 407 | 407 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:31 |
| 408 | 408 | /* translators: click to edit capacity<linebreak>(registration limit)… */ |
| 409 | - __( 'click to edit capacity%s(registration limit)…', 'event_espresso' ), |
|
| 409 | + __('click to edit capacity%s(registration limit)…', 'event_espresso'), |
|
| 410 | 410 | |
| 411 | 411 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:31 |
| 412 | 412 | // Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:27 |
| 413 | 413 | // Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:34 |
| 414 | - __( 'starts', 'event_espresso' ), |
|
| 414 | + __('starts', 'event_espresso'), |
|
| 415 | 415 | |
| 416 | 416 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32 |
| 417 | 417 | // Reference: packages/ee-components/src/SimpleTicketCard/SimpleTicketCard.tsx:34 |
| 418 | 418 | // Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:47 |
| 419 | - __( 'ends', 'event_espresso' ), |
|
| 419 | + __('ends', 'event_espresso'), |
|
| 420 | 420 | |
| 421 | 421 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32 |
| 422 | - __( 'started', 'event_espresso' ), |
|
| 422 | + __('started', 'event_espresso'), |
|
| 423 | 423 | |
| 424 | 424 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:32 |
| 425 | - __( 'ended', 'event_espresso' ), |
|
| 425 | + __('ended', 'event_espresso'), |
|
| 426 | 426 | |
| 427 | 427 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:46 |
| 428 | - __( 'Edit Event Date', 'event_espresso' ), |
|
| 428 | + __('Edit Event Date', 'event_espresso'), |
|
| 429 | 429 | |
| 430 | 430 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:50 |
| 431 | - __( 'edit start and end dates', 'event_espresso' ), |
|
| 431 | + __('edit start and end dates', 'event_espresso'), |
|
| 432 | 432 | |
| 433 | 433 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:16 |
| 434 | 434 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:16 |
| 435 | - __( 'sold', 'event_espresso' ), |
|
| 435 | + __('sold', 'event_espresso'), |
|
| 436 | 436 | |
| 437 | 437 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:21 |
| 438 | - __( 'capacity', 'event_espresso' ), |
|
| 438 | + __('capacity', 'event_espresso'), |
|
| 439 | 439 | |
| 440 | 440 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:27 |
| 441 | 441 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:26 |
| 442 | - __( 'reg list', 'event_espresso' ), |
|
| 442 | + __('reg list', 'event_espresso'), |
|
| 443 | 443 | |
| 444 | 444 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:43 |
| 445 | 445 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:35 |
| 446 | - __( 'add description…', 'event_espresso' ), |
|
| 446 | + __('add description…', 'event_espresso'), |
|
| 447 | 447 | |
| 448 | 448 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:44 |
| 449 | 449 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:36 |
| 450 | - __( 'Edit description', 'event_espresso' ), |
|
| 450 | + __('Edit description', 'event_espresso'), |
|
| 451 | 451 | |
| 452 | 452 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:45 |
| 453 | 453 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:37 |
| 454 | - __( 'click to edit description…', 'event_espresso' ), |
|
| 454 | + __('click to edit description…', 'event_espresso'), |
|
| 455 | 455 | |
| 456 | 456 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:10 |
| 457 | - __( 'Move Date to Trash', 'event_espresso' ), |
|
| 457 | + __('Move Date to Trash', 'event_espresso'), |
|
| 458 | 458 | |
| 459 | 459 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:13 |
| 460 | 460 | // Reference: packages/constants/src/datetime.ts:6 |
| 461 | - __( 'Active', 'event_espresso' ), |
|
| 461 | + __('Active', 'event_espresso'), |
|
| 462 | 462 | |
| 463 | 463 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:14 |
| 464 | 464 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:13 |
| 465 | - __( 'Trashed', 'event_espresso' ), |
|
| 465 | + __('Trashed', 'event_espresso'), |
|
| 466 | 466 | |
| 467 | 467 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:15 |
| 468 | 468 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:14 |
| 469 | 469 | // Reference: packages/constants/src/datetime.ts:8 |
| 470 | - __( 'Expired', 'event_espresso' ), |
|
| 470 | + __('Expired', 'event_espresso'), |
|
| 471 | 471 | |
| 472 | 472 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:16 |
| 473 | 473 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:16 |
| 474 | - __( 'Sold Out', 'event_espresso' ), |
|
| 474 | + __('Sold Out', 'event_espresso'), |
|
| 475 | 475 | |
| 476 | 476 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:17 |
| 477 | 477 | // Reference: packages/constants/src/datetime.ts:12 |
| 478 | - __( 'Upcoming', 'event_espresso' ), |
|
| 478 | + __('Upcoming', 'event_espresso'), |
|
| 479 | 479 | |
| 480 | 480 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:7 |
| 481 | - __( 'Edit Event Date Details', 'event_espresso' ), |
|
| 481 | + __('Edit Event Date Details', 'event_espresso'), |
|
| 482 | 482 | |
| 483 | 483 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:8 |
| 484 | - __( 'View Registrations for this Date', 'event_espresso' ), |
|
| 484 | + __('View Registrations for this Date', 'event_espresso'), |
|
| 485 | 485 | |
| 486 | 486 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/config.ts:9 |
| 487 | - __( 'Manage Ticket Assignments', 'event_espresso' ), |
|
| 487 | + __('Manage Ticket Assignments', 'event_espresso'), |
|
| 488 | 488 | |
| 489 | 489 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:41 |
| 490 | 490 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:41 |
| 491 | - __( 'click to edit title…', 'event_espresso' ), |
|
| 491 | + __('click to edit title…', 'event_espresso'), |
|
| 492 | 492 | |
| 493 | 493 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:42 |
| 494 | 494 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:42 |
| 495 | - __( 'add title…', 'event_espresso' ), |
|
| 495 | + __('add title…', 'event_espresso'), |
|
| 496 | 496 | |
| 497 | 497 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:17 |
| 498 | 498 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:17 |
| 499 | - __( 'ON', 'event_espresso' ), |
|
| 499 | + __('ON', 'event_espresso'), |
|
| 500 | 500 | |
| 501 | 501 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10 |
| 502 | - __( 'end dates only', 'event_espresso' ), |
|
| 502 | + __('end dates only', 'event_espresso'), |
|
| 503 | 503 | |
| 504 | 504 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11 |
| 505 | - __( 'start and end dates', 'event_espresso' ), |
|
| 505 | + __('start and end dates', 'event_espresso'), |
|
| 506 | 506 | |
| 507 | 507 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16 |
| 508 | - __( 'dates above 90% capacity', 'event_espresso' ), |
|
| 508 | + __('dates above 90% capacity', 'event_espresso'), |
|
| 509 | 509 | |
| 510 | 510 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17 |
| 511 | - __( 'dates above 75% capacity', 'event_espresso' ), |
|
| 511 | + __('dates above 75% capacity', 'event_espresso'), |
|
| 512 | 512 | |
| 513 | 513 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18 |
| 514 | - __( 'dates above 50% capacity', 'event_espresso' ), |
|
| 514 | + __('dates above 50% capacity', 'event_espresso'), |
|
| 515 | 515 | |
| 516 | 516 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19 |
| 517 | - __( 'dates below 50% capacity', 'event_espresso' ), |
|
| 517 | + __('dates below 50% capacity', 'event_espresso'), |
|
| 518 | 518 | |
| 519 | 519 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23 |
| 520 | - __( 'all dates', 'event_espresso' ), |
|
| 520 | + __('all dates', 'event_espresso'), |
|
| 521 | 521 | |
| 522 | 522 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24 |
| 523 | - __( 'all active and upcoming', 'event_espresso' ), |
|
| 523 | + __('all active and upcoming', 'event_espresso'), |
|
| 524 | 524 | |
| 525 | 525 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25 |
| 526 | - __( 'active dates only', 'event_espresso' ), |
|
| 526 | + __('active dates only', 'event_espresso'), |
|
| 527 | 527 | |
| 528 | 528 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26 |
| 529 | - __( 'upcoming dates only', 'event_espresso' ), |
|
| 529 | + __('upcoming dates only', 'event_espresso'), |
|
| 530 | 530 | |
| 531 | 531 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27 |
| 532 | - __( 'next active or upcoming only', 'event_espresso' ), |
|
| 532 | + __('next active or upcoming only', 'event_espresso'), |
|
| 533 | 533 | |
| 534 | 534 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28 |
| 535 | - __( 'sold out dates only', 'event_espresso' ), |
|
| 535 | + __('sold out dates only', 'event_espresso'), |
|
| 536 | 536 | |
| 537 | 537 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29 |
| 538 | - __( 'recently expired dates', 'event_espresso' ), |
|
| 538 | + __('recently expired dates', 'event_espresso'), |
|
| 539 | 539 | |
| 540 | 540 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30 |
| 541 | - __( 'all expired dates', 'event_espresso' ), |
|
| 541 | + __('all expired dates', 'event_espresso'), |
|
| 542 | 542 | |
| 543 | 543 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31 |
| 544 | - __( 'trashed dates only', 'event_espresso' ), |
|
| 544 | + __('trashed dates only', 'event_espresso'), |
|
| 545 | 545 | |
| 546 | 546 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35 |
| 547 | 547 | // Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:9 |
| 548 | 548 | // Reference: packages/dates/src/components/DateRangePicker/index.tsx:61 |
| 549 | - __( 'start date', 'event_espresso' ), |
|
| 549 | + __('start date', 'event_espresso'), |
|
| 550 | 550 | |
| 551 | 551 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36 |
| 552 | - __( 'name', 'event_espresso' ), |
|
| 552 | + __('name', 'event_espresso'), |
|
| 553 | 553 | |
| 554 | 554 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37 |
| 555 | 555 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:31 |
@@ -557,176 +557,176 @@ discard block |
||
| 557 | 557 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:27 |
| 558 | 558 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:31 |
| 559 | 559 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23 |
| 560 | - __( 'ID', 'event_espresso' ), |
|
| 560 | + __('ID', 'event_espresso'), |
|
| 561 | 561 | |
| 562 | 562 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38 |
| 563 | 563 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47 |
| 564 | - __( 'custom order', 'event_espresso' ), |
|
| 564 | + __('custom order', 'event_espresso'), |
|
| 565 | 565 | |
| 566 | 566 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42 |
| 567 | 567 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:51 |
| 568 | - __( 'display', 'event_espresso' ), |
|
| 568 | + __('display', 'event_espresso'), |
|
| 569 | 569 | |
| 570 | 570 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43 |
| 571 | - __( 'recurrence', 'event_espresso' ), |
|
| 571 | + __('recurrence', 'event_espresso'), |
|
| 572 | 572 | |
| 573 | 573 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44 |
| 574 | 574 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53 |
| 575 | - __( 'sales', 'event_espresso' ), |
|
| 575 | + __('sales', 'event_espresso'), |
|
| 576 | 576 | |
| 577 | 577 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45 |
| 578 | 578 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55 |
| 579 | - __( 'sort by', 'event_espresso' ), |
|
| 579 | + __('sort by', 'event_espresso'), |
|
| 580 | 580 | |
| 581 | 581 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46 |
| 582 | 582 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54 |
| 583 | 583 | // Reference: packages/ee-components/src/EntityList/EntityListFilterBar.tsx:46 |
| 584 | - __( 'search', 'event_espresso' ), |
|
| 584 | + __('search', 'event_espresso'), |
|
| 585 | 585 | |
| 586 | 586 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47 |
| 587 | 587 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56 |
| 588 | - __( 'status', 'event_espresso' ), |
|
| 588 | + __('status', 'event_espresso'), |
|
| 589 | 589 | |
| 590 | 590 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9 |
| 591 | - __( 'start dates only', 'event_espresso' ), |
|
| 591 | + __('start dates only', 'event_espresso'), |
|
| 592 | 592 | |
| 593 | 593 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26 |
| 594 | 594 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/NewDateModal.tsx:12 |
| 595 | 595 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsModalButton.tsx:18 |
| 596 | - __( 'Add New Date', 'event_espresso' ), |
|
| 596 | + __('Add New Date', 'event_espresso'), |
|
| 597 | 597 | |
| 598 | 598 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:26 |
| 599 | - __( 'Add Single Date', 'event_espresso' ), |
|
| 599 | + __('Add Single Date', 'event_espresso'), |
|
| 600 | 600 | |
| 601 | 601 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:44 |
| 602 | - __( 'Add a single date that only occurs once', 'event_espresso' ), |
|
| 602 | + __('Add a single date that only occurs once', 'event_espresso'), |
|
| 603 | 603 | |
| 604 | 604 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:46 |
| 605 | - __( 'Single Date', 'event_espresso' ), |
|
| 605 | + __('Single Date', 'event_espresso'), |
|
| 606 | 606 | |
| 607 | 607 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:106 |
| 608 | - __( 'Reg list', 'event_espresso' ), |
|
| 608 | + __('Reg list', 'event_espresso'), |
|
| 609 | 609 | |
| 610 | 610 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:107 |
| 611 | - __( 'Regs', 'event_espresso' ), |
|
| 611 | + __('Regs', 'event_espresso'), |
|
| 612 | 612 | |
| 613 | 613 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:122 |
| 614 | 614 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:121 |
| 615 | 615 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:59 |
| 616 | - __( 'Actions', 'event_espresso' ), |
|
| 616 | + __('Actions', 'event_espresso'), |
|
| 617 | 617 | |
| 618 | 618 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52 |
| 619 | - __( 'Start', 'event_espresso' ), |
|
| 619 | + __('Start', 'event_espresso'), |
|
| 620 | 620 | |
| 621 | 621 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:66 |
| 622 | - __( 'End', 'event_espresso' ), |
|
| 622 | + __('End', 'event_espresso'), |
|
| 623 | 623 | |
| 624 | 624 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:82 |
| 625 | - __( 'Cap', 'event_espresso' ), |
|
| 625 | + __('Cap', 'event_espresso'), |
|
| 626 | 626 | |
| 627 | 627 | // Reference: domains/core/admin/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:94 |
| 628 | 628 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:98 |
| 629 | - __( 'Sold', 'event_espresso' ), |
|
| 629 | + __('Sold', 'event_espresso'), |
|
| 630 | 630 | |
| 631 | 631 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:33 |
| 632 | 632 | // Reference: packages/form-builder/src/constants.ts:67 |
| 633 | - __( 'Text Input', 'event_espresso' ), |
|
| 633 | + __('Text Input', 'event_espresso'), |
|
| 634 | 634 | |
| 635 | 635 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:34 |
| 636 | 636 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:32 |
| 637 | - __( 'Attendee First Name', 'event_espresso' ), |
|
| 637 | + __('Attendee First Name', 'event_espresso'), |
|
| 638 | 638 | |
| 639 | 639 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:39 |
| 640 | 640 | /* translators: field name */ |
| 641 | - __( 'Registration form must have a field of type "%1$s" which maps to "%2$s"', 'event_espresso' ), |
|
| 641 | + __('Registration form must have a field of type "%1$s" which maps to "%2$s"', 'event_espresso'), |
|
| 642 | 642 | |
| 643 | 643 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:40 |
| 644 | 644 | // Reference: packages/form-builder/src/constants.ts:82 |
| 645 | - __( 'Email Address', 'event_espresso' ), |
|
| 645 | + __('Email Address', 'event_espresso'), |
|
| 646 | 646 | |
| 647 | 647 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:41 |
| 648 | 648 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:40 |
| 649 | - __( 'Attendee Email Address', 'event_espresso' ), |
|
| 649 | + __('Attendee Email Address', 'event_espresso'), |
|
| 650 | 650 | |
| 651 | 651 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/ErrorMessage.tsx:49 |
| 652 | - __( 'Please add the required fields', 'event_espresso' ), |
|
| 652 | + __('Please add the required fields', 'event_espresso'), |
|
| 653 | 653 | |
| 654 | 654 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/RegistrationForm.tsx:12 |
| 655 | - __( 'Registration Form', 'event_espresso' ), |
|
| 655 | + __('Registration Form', 'event_espresso'), |
|
| 656 | 656 | |
| 657 | 657 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:13 |
| 658 | - __( 'primary registrant', 'event_espresso' ), |
|
| 658 | + __('primary registrant', 'event_espresso'), |
|
| 659 | 659 | |
| 660 | 660 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:17 |
| 661 | - __( 'purchaser', 'event_espresso' ), |
|
| 661 | + __('purchaser', 'event_espresso'), |
|
| 662 | 662 | |
| 663 | 663 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:21 |
| 664 | - __( 'registrants', 'event_espresso' ), |
|
| 664 | + __('registrants', 'event_espresso'), |
|
| 665 | 665 | |
| 666 | 666 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:36 |
| 667 | - __( 'Attendee Last Name', 'event_espresso' ), |
|
| 667 | + __('Attendee Last Name', 'event_espresso'), |
|
| 668 | 668 | |
| 669 | 669 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:44 |
| 670 | - __( 'Attendee Address', 'event_espresso' ), |
|
| 670 | + __('Attendee Address', 'event_espresso'), |
|
| 671 | 671 | |
| 672 | 672 | // Reference: domains/core/admin/eventEditor/src/ui/registrationForm/constants.ts:9 |
| 673 | - __( 'all', 'event_espresso' ), |
|
| 673 | + __('all', 'event_espresso'), |
|
| 674 | 674 | |
| 675 | 675 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18 |
| 676 | - __( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. |
|
| 677 | -Please correct the assignments for the highlighted cells.', 'event_espresso' ), |
|
| 676 | + __('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. |
|
| 677 | +Please correct the assignments for the highlighted cells.', 'event_espresso'), |
|
| 678 | 678 | |
| 679 | 679 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22 |
| 680 | - __( '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. |
|
| 681 | -Please correct the assignments for the highlighted cells.', 'event_espresso' ), |
|
| 680 | + __('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. |
|
| 681 | +Please correct the assignments for the highlighted cells.', 'event_espresso'), |
|
| 682 | 682 | |
| 683 | 683 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32 |
| 684 | - __( 'Please Update Assignments', 'event_espresso' ), |
|
| 684 | + __('Please Update Assignments', 'event_espresso'), |
|
| 685 | 685 | |
| 686 | 686 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:26 |
| 687 | - __( 'There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso' ), |
|
| 687 | + __('There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso'), |
|
| 688 | 688 | |
| 689 | 689 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:29 |
| 690 | - __( 'Alert!', 'event_espresso' ), |
|
| 690 | + __('Alert!', 'event_espresso'), |
|
| 691 | 691 | |
| 692 | 692 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:42 |
| 693 | 693 | /* translators: 1 entity id, 2 entity name */ |
| 694 | - __( 'Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso' ), |
|
| 694 | + __('Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso'), |
|
| 695 | 695 | |
| 696 | 696 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:49 |
| 697 | 697 | /* translators: 1 entity id, 2 entity name */ |
| 698 | - __( 'Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso' ), |
|
| 698 | + __('Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso'), |
|
| 699 | 699 | |
| 700 | 700 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal.tsx:45 |
| 701 | 701 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:13 |
| 702 | - __( 'Ticket Assignment Manager', 'event_espresso' ), |
|
| 702 | + __('Ticket Assignment Manager', 'event_espresso'), |
|
| 703 | 703 | |
| 704 | 704 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:10 |
| 705 | - __( 'existing relation', 'event_espresso' ), |
|
| 705 | + __('existing relation', 'event_espresso'), |
|
| 706 | 706 | |
| 707 | 707 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:15 |
| 708 | - __( 'remove existing relation', 'event_espresso' ), |
|
| 708 | + __('remove existing relation', 'event_espresso'), |
|
| 709 | 709 | |
| 710 | 710 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:20 |
| 711 | - __( 'add new relation', 'event_espresso' ), |
|
| 711 | + __('add new relation', 'event_espresso'), |
|
| 712 | 712 | |
| 713 | 713 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:25 |
| 714 | - __( 'invalid relation', 'event_espresso' ), |
|
| 714 | + __('invalid relation', 'event_espresso'), |
|
| 715 | 715 | |
| 716 | 716 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:29 |
| 717 | - __( 'no relation', 'event_espresso' ), |
|
| 717 | + __('no relation', 'event_espresso'), |
|
| 718 | 718 | |
| 719 | 719 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:15 |
| 720 | - __( 'Assignments', 'event_espresso' ), |
|
| 720 | + __('Assignments', 'event_espresso'), |
|
| 721 | 721 | |
| 722 | 722 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:16 |
| 723 | - __( 'Event Dates are listed below', 'event_espresso' ), |
|
| 723 | + __('Event Dates are listed below', 'event_espresso'), |
|
| 724 | 724 | |
| 725 | 725 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:17 |
| 726 | - __( 'Tickets are listed along the top', 'event_espresso' ), |
|
| 726 | + __('Tickets are listed along the top', 'event_espresso'), |
|
| 727 | 727 | |
| 728 | 728 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:18 |
| 729 | - __( 'Click the cell buttons to toggle assigments', 'event_espresso' ), |
|
| 729 | + __('Click the cell buttons to toggle assigments', 'event_espresso'), |
|
| 730 | 730 | |
| 731 | 731 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/components/useSubmitButtonProps.ts:29 |
| 732 | 732 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16 |
@@ -735,1575 +735,1575 @@ discard block |
||
| 735 | 735 | // Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:29 |
| 736 | 736 | // Reference: packages/ui-components/src/Modal/useSubmitButtonProps.tsx:13 |
| 737 | 737 | // Reference: packages/ui-components/src/Stepper/buttons/Submit.tsx:7 |
| 738 | - __( 'Submit', 'event_espresso' ), |
|
| 738 | + __('Submit', 'event_espresso'), |
|
| 739 | 739 | |
| 740 | 740 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:20 |
| 741 | - __( 'All Dates', 'event_espresso' ), |
|
| 741 | + __('All Dates', 'event_espresso'), |
|
| 742 | 742 | |
| 743 | 743 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:27 |
| 744 | - __( 'dates by month', 'event_espresso' ), |
|
| 744 | + __('dates by month', 'event_espresso'), |
|
| 745 | 745 | |
| 746 | 746 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:16 |
| 747 | - __( 'show expired tickets', 'event_espresso' ), |
|
| 747 | + __('show expired tickets', 'event_espresso'), |
|
| 748 | 748 | |
| 749 | 749 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:13 |
| 750 | - __( 'show trashed dates', 'event_espresso' ), |
|
| 750 | + __('show trashed dates', 'event_espresso'), |
|
| 751 | 751 | |
| 752 | 752 | // Reference: domains/core/admin/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:16 |
| 753 | - __( 'show trashed tickets', 'event_espresso' ), |
|
| 753 | + __('show trashed tickets', 'event_espresso'), |
|
| 754 | 754 | |
| 755 | 755 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/Container.tsx:38 |
| 756 | 756 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actions/Actions.tsx:25 |
| 757 | - __( 'Default tickets', 'event_espresso' ), |
|
| 757 | + __('Default tickets', 'event_espresso'), |
|
| 758 | 758 | |
| 759 | 759 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/ModalBody.tsx:63 |
| 760 | 760 | // Reference: packages/edtr-services/src/constants.ts:26 |
| 761 | - __( 'ticket', 'event_espresso' ), |
|
| 761 | + __('ticket', 'event_espresso'), |
|
| 762 | 762 | |
| 763 | 763 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:26 |
| 764 | 764 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:33 |
| 765 | - __( 'Set ticket prices', 'event_espresso' ), |
|
| 765 | + __('Set ticket prices', 'event_espresso'), |
|
| 766 | 766 | |
| 767 | 767 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:31 |
| 768 | - __( 'Skip prices - Save', 'event_espresso' ), |
|
| 768 | + __('Skip prices - Save', 'event_espresso'), |
|
| 769 | 769 | |
| 770 | 770 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:37 |
| 771 | 771 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:57 |
| 772 | - __( 'Ticket details', 'event_espresso' ), |
|
| 772 | + __('Ticket details', 'event_espresso'), |
|
| 773 | 773 | |
| 774 | 774 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/FooterButtons.tsx:38 |
| 775 | - __( 'Save', 'event_espresso' ), |
|
| 775 | + __('Save', 'event_espresso'), |
|
| 776 | 776 | |
| 777 | 777 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:22 |
| 778 | 778 | /* translators: %s ticket id */ |
| 779 | - __( 'Edit ticket %s', 'event_espresso' ), |
|
| 779 | + __('Edit ticket %s', 'event_espresso'), |
|
| 780 | 780 | |
| 781 | 781 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/Modal.tsx:25 |
| 782 | 782 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:33 |
| 783 | - __( 'New Ticket Details', 'event_espresso' ), |
|
| 783 | + __('New Ticket Details', 'event_espresso'), |
|
| 784 | 784 | |
| 785 | 785 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10 |
| 786 | 786 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10 |
| 787 | - __( 'primary information about the ticket', 'event_espresso' ), |
|
| 787 | + __('primary information about the ticket', 'event_espresso'), |
|
| 788 | 788 | |
| 789 | 789 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:10 |
| 790 | 790 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10 |
| 791 | - __( 'Ticket Details', 'event_espresso' ), |
|
| 791 | + __('Ticket Details', 'event_espresso'), |
|
| 792 | 792 | |
| 793 | 793 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:12 |
| 794 | 794 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:12 |
| 795 | - __( 'apply ticket price modifiers and taxes', 'event_espresso' ), |
|
| 795 | + __('apply ticket price modifiers and taxes', 'event_espresso'), |
|
| 796 | 796 | |
| 797 | 797 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:14 |
| 798 | 798 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:14 |
| 799 | - __( 'Price Calculator', 'event_espresso' ), |
|
| 799 | + __('Price Calculator', 'event_espresso'), |
|
| 800 | 800 | |
| 801 | 801 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/defaultTickets/multiStep/TicketFormSteps.tsx:16 |
| 802 | 802 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16 |
| 803 | - __( 'Assign Dates', 'event_espresso' ), |
|
| 803 | + __('Assign Dates', 'event_espresso'), |
|
| 804 | 804 | |
| 805 | 805 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:39 |
| 806 | - __( 'Skip prices - assign dates', 'event_espresso' ), |
|
| 806 | + __('Skip prices - assign dates', 'event_espresso'), |
|
| 807 | 807 | |
| 808 | 808 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:50 |
| 809 | - __( 'Save and assign dates', 'event_espresso' ), |
|
| 809 | + __('Save and assign dates', 'event_espresso'), |
|
| 810 | 810 | |
| 811 | 811 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:29 |
| 812 | 812 | /* translators: %1$s ticket name, %2$s ticket id */ |
| 813 | - __( 'Edit ticket "%1$s" - %2$s', 'event_espresso' ), |
|
| 813 | + __('Edit ticket "%1$s" - %2$s', 'event_espresso'), |
|
| 814 | 814 | |
| 815 | 815 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:43 |
| 816 | - __( 'modal for ticket', 'event_espresso' ), |
|
| 816 | + __('modal for ticket', 'event_espresso'), |
|
| 817 | 817 | |
| 818 | 818 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:101 |
| 819 | - __( 'The maximum number of this ticket available for sale.', 'event_espresso' ), |
|
| 819 | + __('The maximum number of this ticket available for sale.', 'event_espresso'), |
|
| 820 | 820 | |
| 821 | 821 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:103 |
| 822 | - __( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ), |
|
| 822 | + __('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'), |
|
| 823 | 823 | |
| 824 | 824 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:114 |
| 825 | 825 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:119 |
| 826 | - __( 'Number of Uses', 'event_espresso' ), |
|
| 826 | + __('Number of Uses', 'event_espresso'), |
|
| 827 | 827 | |
| 828 | 828 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:120 |
| 829 | - __( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ), |
|
| 829 | + __('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'), |
|
| 830 | 830 | |
| 831 | 831 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:124 |
| 832 | - __( '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' ), |
|
| 832 | + __('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'), |
|
| 833 | 833 | |
| 834 | 834 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:132 |
| 835 | 835 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:127 |
| 836 | - __( 'Minimum Quantity', 'event_espresso' ), |
|
| 836 | + __('Minimum Quantity', 'event_espresso'), |
|
| 837 | 837 | |
| 838 | 838 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:137 |
| 839 | - __( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ), |
|
| 839 | + __('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'), |
|
| 840 | 840 | |
| 841 | 841 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:141 |
| 842 | - __( 'Leave blank for no minimum.', 'event_espresso' ), |
|
| 842 | + __('Leave blank for no minimum.', 'event_espresso'), |
|
| 843 | 843 | |
| 844 | 844 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:147 |
| 845 | 845 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:135 |
| 846 | - __( 'Maximum Quantity', 'event_espresso' ), |
|
| 846 | + __('Maximum Quantity', 'event_espresso'), |
|
| 847 | 847 | |
| 848 | 848 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:153 |
| 849 | - __( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ), |
|
| 849 | + __('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'), |
|
| 850 | 850 | |
| 851 | 851 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:157 |
| 852 | - __( 'Leave blank for no maximum.', 'event_espresso' ), |
|
| 852 | + __('Leave blank for no maximum.', 'event_espresso'), |
|
| 853 | 853 | |
| 854 | 854 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:163 |
| 855 | 855 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:144 |
| 856 | - __( 'Required Ticket', 'event_espresso' ), |
|
| 856 | + __('Required Ticket', 'event_espresso'), |
|
| 857 | 857 | |
| 858 | 858 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:165 |
| 859 | - __( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ), |
|
| 859 | + __('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'), |
|
| 860 | 860 | |
| 861 | 861 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:177 |
| 862 | - __( 'Visibility', 'event_espresso' ), |
|
| 862 | + __('Visibility', 'event_espresso'), |
|
| 863 | 863 | |
| 864 | 864 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:211 |
| 865 | - __( 'Ticket Sales', 'event_espresso' ), |
|
| 865 | + __('Ticket Sales', 'event_espresso'), |
|
| 866 | 866 | |
| 867 | 867 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:95 |
| 868 | 868 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:110 |
| 869 | - __( 'Quantity For Sale', 'event_espresso' ), |
|
| 869 | + __('Quantity For Sale', 'event_espresso'), |
|
| 870 | 870 | |
| 871 | 871 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketRegistrationsLink.tsx:13 |
| 872 | - __( 'total registrations.', 'event_espresso' ), |
|
| 872 | + __('total registrations.', 'event_espresso'), |
|
| 873 | 873 | |
| 874 | 874 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketRegistrationsLink.tsx:14 |
| 875 | - __( 'view ALL registrations for this ticket.', 'event_espresso' ), |
|
| 875 | + __('view ALL registrations for this ticket.', 'event_espresso'), |
|
| 876 | 876 | |
| 877 | 877 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketSoldLink.tsx:13 |
| 878 | - __( 'view approved registrations for this ticket.', 'event_espresso' ), |
|
| 878 | + __('view approved registrations for this ticket.', 'event_espresso'), |
|
| 879 | 879 | |
| 880 | 880 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:36 |
| 881 | - __( 'Available Tickets', 'event_espresso' ), |
|
| 881 | + __('Available Tickets', 'event_espresso'), |
|
| 882 | 882 | |
| 883 | 883 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:39 |
| 884 | - __( 'loading tickets…', 'event_espresso' ), |
|
| 884 | + __('loading tickets…', 'event_espresso'), |
|
| 885 | 885 | |
| 886 | 886 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:26 |
| 887 | - __( 'Number of related dates', 'event_espresso' ), |
|
| 887 | + __('Number of related dates', 'event_espresso'), |
|
| 888 | 888 | |
| 889 | 889 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27 |
| 890 | - __( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ), |
|
| 890 | + __('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'), |
|
| 891 | 891 | |
| 892 | 892 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:37 |
| 893 | - __( 'assign dates', 'event_espresso' ), |
|
| 893 | + __('assign dates', 'event_espresso'), |
|
| 894 | 894 | |
| 895 | 895 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:19 |
| 896 | - __( 'Permanently Delete Ticket?', 'event_espresso' ), |
|
| 896 | + __('Permanently Delete Ticket?', 'event_espresso'), |
|
| 897 | 897 | |
| 898 | 898 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:19 |
| 899 | - __( 'Move Ticket to Trash?', 'event_espresso' ), |
|
| 899 | + __('Move Ticket to Trash?', 'event_espresso'), |
|
| 900 | 900 | |
| 901 | 901 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:22 |
| 902 | - __( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ), |
|
| 902 | + __('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'), |
|
| 903 | 903 | |
| 904 | 904 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/DeleteTicket.tsx:48 |
| 905 | 905 | // Reference: packages/ee-components/src/SimpleTicketCard/actions/Trash.tsx:6 |
| 906 | - __( 'trash ticket', 'event_espresso' ), |
|
| 906 | + __('trash ticket', 'event_espresso'), |
|
| 907 | 907 | |
| 908 | 908 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:25 |
| 909 | - __( 'ticket main menu', 'event_espresso' ), |
|
| 909 | + __('ticket main menu', 'event_espresso'), |
|
| 910 | 910 | |
| 911 | 911 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:38 |
| 912 | 912 | // Reference: packages/ee-components/src/SimpleTicketCard/actions/Edit.tsx:15 |
| 913 | - __( 'edit ticket', 'event_espresso' ), |
|
| 913 | + __('edit ticket', 'event_espresso'), |
|
| 914 | 914 | |
| 915 | 915 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:39 |
| 916 | - __( 'copy ticket', 'event_espresso' ), |
|
| 916 | + __('copy ticket', 'event_espresso'), |
|
| 917 | 917 | |
| 918 | 918 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:44 |
| 919 | - __( 'edit ticket details', 'event_espresso' ), |
|
| 919 | + __('edit ticket details', 'event_espresso'), |
|
| 920 | 920 | |
| 921 | 921 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:48 |
| 922 | - __( 'delete tickets', 'event_espresso' ), |
|
| 922 | + __('delete tickets', 'event_espresso'), |
|
| 923 | 923 | |
| 924 | 924 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:48 |
| 925 | - __( 'trash tickets', 'event_espresso' ), |
|
| 925 | + __('trash tickets', 'event_espresso'), |
|
| 926 | 926 | |
| 927 | 927 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:52 |
| 928 | - __( 'edit ticket prices', 'event_espresso' ), |
|
| 928 | + __('edit ticket prices', 'event_espresso'), |
|
| 929 | 929 | |
| 930 | 930 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14 |
| 931 | - __( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ), |
|
| 931 | + __('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'), |
|
| 932 | 932 | |
| 933 | 933 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15 |
| 934 | - __( 'Are you sure you want to trash these tickets?', 'event_espresso' ), |
|
| 934 | + __('Are you sure you want to trash these tickets?', 'event_espresso'), |
|
| 935 | 935 | |
| 936 | 936 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16 |
| 937 | - __( 'Delete tickets permanently', 'event_espresso' ), |
|
| 937 | + __('Delete tickets permanently', 'event_espresso'), |
|
| 938 | 938 | |
| 939 | 939 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16 |
| 940 | - __( 'Trash tickets', 'event_espresso' ), |
|
| 940 | + __('Trash tickets', 'event_espresso'), |
|
| 941 | 941 | |
| 942 | 942 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:21 |
| 943 | - __( 'Bulk edit ticket details', 'event_espresso' ), |
|
| 943 | + __('Bulk edit ticket details', 'event_espresso'), |
|
| 944 | 944 | |
| 945 | 945 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22 |
| 946 | - __( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ), |
|
| 946 | + __('any changes will be applied to ALL of the selected tickets.', 'event_espresso'), |
|
| 947 | 947 | |
| 948 | 948 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:19 |
| 949 | - __( 'Bulk edit ticket prices', 'event_espresso' ), |
|
| 949 | + __('Bulk edit ticket prices', 'event_espresso'), |
|
| 950 | 950 | |
| 951 | 951 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20 |
| 952 | - __( 'Edit all prices together', 'event_espresso' ), |
|
| 952 | + __('Edit all prices together', 'event_espresso'), |
|
| 953 | 953 | |
| 954 | 954 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:21 |
| 955 | - __( 'Edit all the selected ticket prices dynamically', 'event_espresso' ), |
|
| 955 | + __('Edit all the selected ticket prices dynamically', 'event_espresso'), |
|
| 956 | 956 | |
| 957 | 957 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25 |
| 958 | - __( 'Edit prices individually', 'event_espresso' ), |
|
| 958 | + __('Edit prices individually', 'event_espresso'), |
|
| 959 | 959 | |
| 960 | 960 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:26 |
| 961 | - __( 'Edit prices for each ticket individually', 'event_espresso' ), |
|
| 961 | + __('Edit prices for each ticket individually', 'event_espresso'), |
|
| 962 | 962 | |
| 963 | 963 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:14 |
| 964 | 964 | // Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:34 |
| 965 | 965 | // Reference: packages/form/src/ResetButton.tsx:18 |
| 966 | 966 | // Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12 |
| 967 | - __( 'Reset', 'event_espresso' ), |
|
| 967 | + __('Reset', 'event_espresso'), |
|
| 968 | 968 | |
| 969 | 969 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15 |
| 970 | 970 | // Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:76 |
| 971 | 971 | // Reference: packages/ui-components/src/Modal/useCancelButtonProps.tsx:10 |
| 972 | - __( 'Cancel', 'event_espresso' ), |
|
| 972 | + __('Cancel', 'event_espresso'), |
|
| 973 | 973 | |
| 974 | 974 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:26 |
| 975 | 975 | /* translators: %s ticket name */ |
| 976 | - __( 'Edit prices for Ticket: %s', 'event_espresso' ), |
|
| 976 | + __('Edit prices for Ticket: %s', 'event_espresso'), |
|
| 977 | 977 | |
| 978 | 978 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:30 |
| 979 | - __( 'sales start', 'event_espresso' ), |
|
| 979 | + __('sales start', 'event_espresso'), |
|
| 980 | 980 | |
| 981 | 981 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:33 |
| 982 | - __( 'sales began', 'event_espresso' ), |
|
| 982 | + __('sales began', 'event_espresso'), |
|
| 983 | 983 | |
| 984 | 984 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:35 |
| 985 | - __( 'sales ended', 'event_espresso' ), |
|
| 985 | + __('sales ended', 'event_espresso'), |
|
| 986 | 986 | |
| 987 | 987 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:36 |
| 988 | - __( 'sales end', 'event_espresso' ), |
|
| 988 | + __('sales end', 'event_espresso'), |
|
| 989 | 989 | |
| 990 | 990 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:50 |
| 991 | - __( 'Edit Ticket Sale Dates', 'event_espresso' ), |
|
| 991 | + __('Edit Ticket Sale Dates', 'event_espresso'), |
|
| 992 | 992 | |
| 993 | 993 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:54 |
| 994 | - __( 'edit ticket sales start and end dates', 'event_espresso' ), |
|
| 994 | + __('edit ticket sales start and end dates', 'event_espresso'), |
|
| 995 | 995 | |
| 996 | 996 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:21 |
| 997 | - __( 'quantity', 'event_espresso' ), |
|
| 997 | + __('quantity', 'event_espresso'), |
|
| 998 | 998 | |
| 999 | 999 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:28 |
| 1000 | 1000 | // Reference: packages/edtr-services/src/apollo/mutations/tickets/useUpdateTicketQtyByCapacity.ts:78 |
| 1001 | - __( 'Ticket quantity has been adjusted because it cannot be more than the related event date capacity.', 'event_espresso' ), |
|
| 1001 | + __('Ticket quantity has been adjusted because it cannot be more than the related event date capacity.', 'event_espresso'), |
|
| 1002 | 1002 | |
| 1003 | 1003 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:51 |
| 1004 | - __( 'edit quantity of tickets available…', 'event_espresso' ), |
|
| 1004 | + __('edit quantity of tickets available…', 'event_espresso'), |
|
| 1005 | 1005 | |
| 1006 | 1006 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:10 |
| 1007 | - __( 'Move Ticket to Trash', 'event_espresso' ), |
|
| 1007 | + __('Move Ticket to Trash', 'event_espresso'), |
|
| 1008 | 1008 | |
| 1009 | 1009 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:15 |
| 1010 | 1010 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:52 |
| 1011 | - __( 'On Sale', 'event_espresso' ), |
|
| 1011 | + __('On Sale', 'event_espresso'), |
|
| 1012 | 1012 | |
| 1013 | 1013 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:17 |
| 1014 | - __( 'Pending', 'event_espresso' ), |
|
| 1014 | + __('Pending', 'event_espresso'), |
|
| 1015 | 1015 | |
| 1016 | 1016 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:7 |
| 1017 | - __( 'Edit Ticket Details', 'event_espresso' ), |
|
| 1017 | + __('Edit Ticket Details', 'event_espresso'), |
|
| 1018 | 1018 | |
| 1019 | 1019 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:8 |
| 1020 | - __( 'Manage Date Assignments', 'event_espresso' ), |
|
| 1020 | + __('Manage Date Assignments', 'event_espresso'), |
|
| 1021 | 1021 | |
| 1022 | 1022 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/config.ts:9 |
| 1023 | 1023 | // Reference: packages/tpc/src/components/table/Table.tsx:43 |
| 1024 | - __( 'Ticket Price Calculator', 'event_espresso' ), |
|
| 1024 | + __('Ticket Price Calculator', 'event_espresso'), |
|
| 1025 | 1025 | |
| 1026 | 1026 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:39 |
| 1027 | - __( 'edit ticket total…', 'event_espresso' ), |
|
| 1027 | + __('edit ticket total…', 'event_espresso'), |
|
| 1028 | 1028 | |
| 1029 | 1029 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:53 |
| 1030 | - __( 'set price…', 'event_espresso' ), |
|
| 1030 | + __('set price…', 'event_espresso'), |
|
| 1031 | 1031 | |
| 1032 | 1032 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:23 |
| 1033 | - __( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ), |
|
| 1033 | + __('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'), |
|
| 1034 | 1034 | |
| 1035 | 1035 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24 |
| 1036 | - __( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ), |
|
| 1036 | + __('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'), |
|
| 1037 | 1037 | |
| 1038 | 1038 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10 |
| 1039 | - __( 'ticket sales start and end dates', 'event_espresso' ), |
|
| 1039 | + __('ticket sales start and end dates', 'event_espresso'), |
|
| 1040 | 1040 | |
| 1041 | 1041 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15 |
| 1042 | - __( 'tickets with 90% or more sold', 'event_espresso' ), |
|
| 1042 | + __('tickets with 90% or more sold', 'event_espresso'), |
|
| 1043 | 1043 | |
| 1044 | 1044 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16 |
| 1045 | - __( 'tickets with 75% or more sold', 'event_espresso' ), |
|
| 1045 | + __('tickets with 75% or more sold', 'event_espresso'), |
|
| 1046 | 1046 | |
| 1047 | 1047 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17 |
| 1048 | - __( 'tickets with 50% or more sold', 'event_espresso' ), |
|
| 1048 | + __('tickets with 50% or more sold', 'event_espresso'), |
|
| 1049 | 1049 | |
| 1050 | 1050 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19 |
| 1051 | - __( 'tickets with less than 50% sold', 'event_espresso' ), |
|
| 1051 | + __('tickets with less than 50% sold', 'event_espresso'), |
|
| 1052 | 1052 | |
| 1053 | 1053 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28 |
| 1054 | - __( 'all tickets for all dates', 'event_espresso' ), |
|
| 1054 | + __('all tickets for all dates', 'event_espresso'), |
|
| 1055 | 1055 | |
| 1056 | 1056 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29 |
| 1057 | - __( 'all on sale and sale pending', 'event_espresso' ), |
|
| 1057 | + __('all on sale and sale pending', 'event_espresso'), |
|
| 1058 | 1058 | |
| 1059 | 1059 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30 |
| 1060 | - __( 'on sale tickets only', 'event_espresso' ), |
|
| 1060 | + __('on sale tickets only', 'event_espresso'), |
|
| 1061 | 1061 | |
| 1062 | 1062 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31 |
| 1063 | - __( 'sale pending tickets only', 'event_espresso' ), |
|
| 1063 | + __('sale pending tickets only', 'event_espresso'), |
|
| 1064 | 1064 | |
| 1065 | 1065 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32 |
| 1066 | - __( 'next on sale or sale pending only', 'event_espresso' ), |
|
| 1066 | + __('next on sale or sale pending only', 'event_espresso'), |
|
| 1067 | 1067 | |
| 1068 | 1068 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33 |
| 1069 | - __( 'sold out tickets only', 'event_espresso' ), |
|
| 1069 | + __('sold out tickets only', 'event_espresso'), |
|
| 1070 | 1070 | |
| 1071 | 1071 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34 |
| 1072 | - __( 'expired tickets only', 'event_espresso' ), |
|
| 1072 | + __('expired tickets only', 'event_espresso'), |
|
| 1073 | 1073 | |
| 1074 | 1074 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35 |
| 1075 | - __( 'trashed tickets only', 'event_espresso' ), |
|
| 1075 | + __('trashed tickets only', 'event_espresso'), |
|
| 1076 | 1076 | |
| 1077 | 1077 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40 |
| 1078 | - __( 'all tickets for above dates', 'event_espresso' ), |
|
| 1078 | + __('all tickets for above dates', 'event_espresso'), |
|
| 1079 | 1079 | |
| 1080 | 1080 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44 |
| 1081 | - __( 'ticket sale date', 'event_espresso' ), |
|
| 1081 | + __('ticket sale date', 'event_espresso'), |
|
| 1082 | 1082 | |
| 1083 | 1083 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45 |
| 1084 | - __( 'ticket name', 'event_espresso' ), |
|
| 1084 | + __('ticket name', 'event_espresso'), |
|
| 1085 | 1085 | |
| 1086 | 1086 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46 |
| 1087 | - __( 'ticket ID', 'event_espresso' ), |
|
| 1087 | + __('ticket ID', 'event_espresso'), |
|
| 1088 | 1088 | |
| 1089 | 1089 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52 |
| 1090 | - __( 'link', 'event_espresso' ), |
|
| 1090 | + __('link', 'event_espresso'), |
|
| 1091 | 1091 | |
| 1092 | 1092 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8 |
| 1093 | - __( 'ticket sales start date only', 'event_espresso' ), |
|
| 1093 | + __('ticket sales start date only', 'event_espresso'), |
|
| 1094 | 1094 | |
| 1095 | 1095 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9 |
| 1096 | - __( 'ticket sales end date only', 'event_espresso' ), |
|
| 1096 | + __('ticket sales end date only', 'event_espresso'), |
|
| 1097 | 1097 | |
| 1098 | 1098 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:18 |
| 1099 | - __( 'Add New Ticket', 'event_espresso' ), |
|
| 1099 | + __('Add New Ticket', 'event_espresso'), |
|
| 1100 | 1100 | |
| 1101 | 1101 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:32 |
| 1102 | - __( 'Add a single ticket and assign the dates to it', 'event_espresso' ), |
|
| 1102 | + __('Add a single ticket and assign the dates to it', 'event_espresso'), |
|
| 1103 | 1103 | |
| 1104 | 1104 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:34 |
| 1105 | - __( 'Single Ticket', 'event_espresso' ), |
|
| 1105 | + __('Single Ticket', 'event_espresso'), |
|
| 1106 | 1106 | |
| 1107 | 1107 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:39 |
| 1108 | - __( 'Tickets', 'event_espresso' ), |
|
| 1108 | + __('Tickets', 'event_espresso'), |
|
| 1109 | 1109 | |
| 1110 | 1110 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:108 |
| 1111 | - __( 'Reg List', 'event_espresso' ), |
|
| 1111 | + __('Reg List', 'event_espresso'), |
|
| 1112 | 1112 | |
| 1113 | 1113 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51 |
| 1114 | - __( 'Goes on Sale', 'event_espresso' ), |
|
| 1114 | + __('Goes on Sale', 'event_espresso'), |
|
| 1115 | 1115 | |
| 1116 | 1116 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:65 |
| 1117 | - __( 'Sale Ends', 'event_espresso' ), |
|
| 1117 | + __('Sale Ends', 'event_espresso'), |
|
| 1118 | 1118 | |
| 1119 | 1119 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:66 |
| 1120 | - __( 'Ends', 'event_espresso' ), |
|
| 1120 | + __('Ends', 'event_espresso'), |
|
| 1121 | 1121 | |
| 1122 | 1122 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78 |
| 1123 | - __( 'Price', 'event_espresso' ), |
|
| 1123 | + __('Price', 'event_espresso'), |
|
| 1124 | 1124 | |
| 1125 | 1125 | // Reference: domains/core/admin/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:88 |
| 1126 | - __( 'Qty', 'event_espresso' ), |
|
| 1126 | + __('Qty', 'event_espresso'), |
|
| 1127 | 1127 | |
| 1128 | 1128 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:103 |
| 1129 | - __( 'Venue telephone', 'event_espresso' ), |
|
| 1129 | + __('Venue telephone', 'event_espresso'), |
|
| 1130 | 1130 | |
| 1131 | 1131 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:110 |
| 1132 | - __( 'Edit this Venue', 'event_espresso' ), |
|
| 1132 | + __('Edit this Venue', 'event_espresso'), |
|
| 1133 | 1133 | |
| 1134 | 1134 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:119 |
| 1135 | - __( 'Select a Venue for the Event', 'event_espresso' ), |
|
| 1135 | + __('Select a Venue for the Event', 'event_espresso'), |
|
| 1136 | 1136 | |
| 1137 | 1137 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:21 |
| 1138 | - __( 'Venue Details', 'event_espresso' ), |
|
| 1138 | + __('Venue Details', 'event_espresso'), |
|
| 1139 | 1139 | |
| 1140 | 1140 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:38 |
| 1141 | - __( 'unlimited space', 'event_espresso' ), |
|
| 1141 | + __('unlimited space', 'event_espresso'), |
|
| 1142 | 1142 | |
| 1143 | 1143 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:41 |
| 1144 | 1144 | /* translators: %d venue capacity */ |
| 1145 | - __( 'Space for up to %d people', 'event_espresso' ), |
|
| 1145 | + __('Space for up to %d people', 'event_espresso'), |
|
| 1146 | 1146 | |
| 1147 | 1147 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:52 |
| 1148 | - __( 'Venue address', 'event_espresso' ), |
|
| 1148 | + __('Venue address', 'event_espresso'), |
|
| 1149 | 1149 | |
| 1150 | 1150 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:58 |
| 1151 | - __( 'Venue Details card', 'event_espresso' ), |
|
| 1151 | + __('Venue Details card', 'event_espresso'), |
|
| 1152 | 1152 | |
| 1153 | 1153 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:67 |
| 1154 | - __( 'no image', 'event_espresso' ), |
|
| 1154 | + __('no image', 'event_espresso'), |
|
| 1155 | 1155 | |
| 1156 | 1156 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:71 |
| 1157 | - __( 'Venue name', 'event_espresso' ), |
|
| 1157 | + __('Venue name', 'event_espresso'), |
|
| 1158 | 1158 | |
| 1159 | 1159 | // Reference: domains/core/admin/eventEditor/src/ui/venue/VenueDetails.tsx:95 |
| 1160 | - __( 'Venue capacity', 'event_espresso' ), |
|
| 1160 | + __('Venue capacity', 'event_espresso'), |
|
| 1161 | 1161 | |
| 1162 | 1162 | // Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:29 |
| 1163 | - __( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ), |
|
| 1163 | + __('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'), |
|
| 1164 | 1164 | |
| 1165 | 1165 | // Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:40 |
| 1166 | - __( 'Skip', 'event_espresso' ), |
|
| 1166 | + __('Skip', 'event_espresso'), |
|
| 1167 | 1167 | |
| 1168 | 1168 | // Reference: domains/core/admin/wpPluginsPage/src/exitSurvey/Popup.tsx:42 |
| 1169 | - __( 'Sure I\'ll help', 'event_espresso' ), |
|
| 1169 | + __('Sure I\'ll help', 'event_espresso'), |
|
| 1170 | 1170 | |
| 1171 | 1171 | // Reference: packages/adapters/src/Pagination/Pagination.tsx:23 |
| 1172 | - __( 'pagination', 'event_espresso' ), |
|
| 1172 | + __('pagination', 'event_espresso'), |
|
| 1173 | 1173 | |
| 1174 | 1174 | // Reference: packages/adapters/src/TagSelector/TagSelector.tsx:113 |
| 1175 | - __( 'toggle menu', 'event_espresso' ), |
|
| 1175 | + __('toggle menu', 'event_espresso'), |
|
| 1176 | 1176 | |
| 1177 | 1177 | // Reference: packages/constants/src/datetime.ts:10 |
| 1178 | - __( 'Postponed', 'event_espresso' ), |
|
| 1178 | + __('Postponed', 'event_espresso'), |
|
| 1179 | 1179 | |
| 1180 | 1180 | // Reference: packages/constants/src/datetime.ts:11 |
| 1181 | - __( 'SoldOut', 'event_espresso' ), |
|
| 1181 | + __('SoldOut', 'event_espresso'), |
|
| 1182 | 1182 | |
| 1183 | 1183 | // Reference: packages/constants/src/datetime.ts:7 |
| 1184 | 1184 | // Reference: packages/predicates/src/registration/statusOptions.ts:11 |
| 1185 | - __( 'Cancelled', 'event_espresso' ), |
|
| 1185 | + __('Cancelled', 'event_espresso'), |
|
| 1186 | 1186 | |
| 1187 | 1187 | // Reference: packages/constants/src/datetime.ts:9 |
| 1188 | - __( 'Inactive', 'event_espresso' ), |
|
| 1188 | + __('Inactive', 'event_espresso'), |
|
| 1189 | 1189 | |
| 1190 | 1190 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:25 |
| 1191 | - __( 'error creating %s', 'event_espresso' ), |
|
| 1191 | + __('error creating %s', 'event_espresso'), |
|
| 1192 | 1192 | |
| 1193 | 1193 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:26 |
| 1194 | - __( 'error deleting %s', 'event_espresso' ), |
|
| 1194 | + __('error deleting %s', 'event_espresso'), |
|
| 1195 | 1195 | |
| 1196 | 1196 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:27 |
| 1197 | - __( 'error updating %s', 'event_espresso' ), |
|
| 1197 | + __('error updating %s', 'event_espresso'), |
|
| 1198 | 1198 | |
| 1199 | 1199 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:28 |
| 1200 | - __( 'creating %s', 'event_espresso' ), |
|
| 1200 | + __('creating %s', 'event_espresso'), |
|
| 1201 | 1201 | |
| 1202 | 1202 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:29 |
| 1203 | - __( 'deleting %s', 'event_espresso' ), |
|
| 1203 | + __('deleting %s', 'event_espresso'), |
|
| 1204 | 1204 | |
| 1205 | 1205 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:30 |
| 1206 | - __( 'updating %s', 'event_espresso' ), |
|
| 1206 | + __('updating %s', 'event_espresso'), |
|
| 1207 | 1207 | |
| 1208 | 1208 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:31 |
| 1209 | - __( 'successfully created %s', 'event_espresso' ), |
|
| 1209 | + __('successfully created %s', 'event_espresso'), |
|
| 1210 | 1210 | |
| 1211 | 1211 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:32 |
| 1212 | - __( 'successfully deleted %s', 'event_espresso' ), |
|
| 1212 | + __('successfully deleted %s', 'event_espresso'), |
|
| 1213 | 1213 | |
| 1214 | 1214 | // Reference: packages/data/src/mutations/useMutationWithFeedback.ts:33 |
| 1215 | - __( 'successfully updated %s', 'event_espresso' ), |
|
| 1215 | + __('successfully updated %s', 'event_espresso'), |
|
| 1216 | 1216 | |
| 1217 | 1217 | // Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:13 |
| 1218 | - __( 'day in range', 'event_espresso' ), |
|
| 1218 | + __('day in range', 'event_espresso'), |
|
| 1219 | 1219 | |
| 1220 | 1220 | // Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:17 |
| 1221 | 1221 | // Reference: packages/dates/src/components/DateRangePicker/index.tsx:79 |
| 1222 | - __( 'end date', 'event_espresso' ), |
|
| 1222 | + __('end date', 'event_espresso'), |
|
| 1223 | 1223 | |
| 1224 | 1224 | // Reference: packages/dates/src/components/DateTimePicker.tsx:17 |
| 1225 | 1225 | // Reference: packages/dates/src/components/TimePicker.tsx:17 |
| 1226 | 1226 | // Reference: packages/form-builder/src/state/utils.ts:433 |
| 1227 | - __( 'time', 'event_espresso' ), |
|
| 1227 | + __('time', 'event_espresso'), |
|
| 1228 | 1228 | |
| 1229 | 1229 | // Reference: packages/dates/src/constants.ts:7 |
| 1230 | - __( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ), |
|
| 1230 | + __('End Date & Time must be set later than the Start Date & Time', 'event_espresso'), |
|
| 1231 | 1231 | |
| 1232 | 1232 | // Reference: packages/dates/src/constants.ts:9 |
| 1233 | - __( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ), |
|
| 1233 | + __('Start Date & Time must be set before the End Date & Time', 'event_espresso'), |
|
| 1234 | 1234 | |
| 1235 | 1235 | // Reference: packages/dates/src/utils/misc.ts:16 |
| 1236 | - __( 'month(s)', 'event_espresso' ), |
|
| 1236 | + __('month(s)', 'event_espresso'), |
|
| 1237 | 1237 | |
| 1238 | 1238 | // Reference: packages/dates/src/utils/misc.ts:17 |
| 1239 | - __( 'week(s)', 'event_espresso' ), |
|
| 1239 | + __('week(s)', 'event_espresso'), |
|
| 1240 | 1240 | |
| 1241 | 1241 | // Reference: packages/dates/src/utils/misc.ts:18 |
| 1242 | - __( 'day(s)', 'event_espresso' ), |
|
| 1242 | + __('day(s)', 'event_espresso'), |
|
| 1243 | 1243 | |
| 1244 | 1244 | // Reference: packages/dates/src/utils/misc.ts:19 |
| 1245 | - __( 'hour(s)', 'event_espresso' ), |
|
| 1245 | + __('hour(s)', 'event_espresso'), |
|
| 1246 | 1246 | |
| 1247 | 1247 | // Reference: packages/dates/src/utils/misc.ts:20 |
| 1248 | - __( 'minute(s)', 'event_espresso' ), |
|
| 1248 | + __('minute(s)', 'event_espresso'), |
|
| 1249 | 1249 | |
| 1250 | 1250 | // Reference: packages/edtr-services/src/apollo/mutations/useReorderEntities.ts:63 |
| 1251 | - __( 'order updated', 'event_espresso' ), |
|
| 1251 | + __('order updated', 'event_espresso'), |
|
| 1252 | 1252 | |
| 1253 | 1253 | // Reference: packages/edtr-services/src/constants.ts:24 |
| 1254 | - __( 'datetime', 'event_espresso' ), |
|
| 1254 | + __('datetime', 'event_espresso'), |
|
| 1255 | 1255 | |
| 1256 | 1256 | // Reference: packages/edtr-services/src/constants.ts:27 |
| 1257 | - __( 'price', 'event_espresso' ), |
|
| 1257 | + __('price', 'event_espresso'), |
|
| 1258 | 1258 | |
| 1259 | 1259 | // Reference: packages/edtr-services/src/constants.ts:28 |
| 1260 | 1260 | // Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:20 |
| 1261 | - __( 'price type', 'event_espresso' ), |
|
| 1261 | + __('price type', 'event_espresso'), |
|
| 1262 | 1262 | |
| 1263 | 1263 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:38 |
| 1264 | 1264 | // Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:39 |
| 1265 | - __( 'End date has been adjusted', 'event_espresso' ), |
|
| 1265 | + __('End date has been adjusted', 'event_espresso'), |
|
| 1266 | 1266 | |
| 1267 | 1267 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:59 |
| 1268 | - __( 'Required', 'event_espresso' ), |
|
| 1268 | + __('Required', 'event_espresso'), |
|
| 1269 | 1269 | |
| 1270 | 1270 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:64 |
| 1271 | - __( 'Start Date is required', 'event_espresso' ), |
|
| 1271 | + __('Start Date is required', 'event_espresso'), |
|
| 1272 | 1272 | |
| 1273 | 1273 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:68 |
| 1274 | - __( 'End Date is required', 'event_espresso' ), |
|
| 1274 | + __('End Date is required', 'event_espresso'), |
|
| 1275 | 1275 | |
| 1276 | 1276 | // Reference: packages/ee-components/src/EntityList/EntityList.tsx:32 |
| 1277 | - __( 'no results found', 'event_espresso' ), |
|
| 1277 | + __('no results found', 'event_espresso'), |
|
| 1278 | 1278 | |
| 1279 | 1279 | // Reference: packages/ee-components/src/EntityList/EntityList.tsx:33 |
| 1280 | - __( 'try changing filter settings', 'event_espresso' ), |
|
| 1280 | + __('try changing filter settings', 'event_espresso'), |
|
| 1281 | 1281 | |
| 1282 | 1282 | // Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:38 |
| 1283 | 1283 | /* translators: %d entity id */ |
| 1284 | - __( 'select entity with id %d', 'event_espresso' ), |
|
| 1284 | + __('select entity with id %d', 'event_espresso'), |
|
| 1285 | 1285 | |
| 1286 | 1286 | // Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:41 |
| 1287 | - __( 'select all entities', 'event_espresso' ), |
|
| 1287 | + __('select all entities', 'event_espresso'), |
|
| 1288 | 1288 | |
| 1289 | 1289 | // Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20 |
| 1290 | - __( 'Note: ', 'event_espresso' ), |
|
| 1290 | + __('Note: ', 'event_espresso'), |
|
| 1291 | 1291 | |
| 1292 | 1292 | // Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20 |
| 1293 | - __( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ), |
|
| 1293 | + __('any changes will be applied to ALL of the selected entities.', 'event_espresso'), |
|
| 1294 | 1294 | |
| 1295 | 1295 | // Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:27 |
| 1296 | - __( 'Bulk edit details', 'event_espresso' ), |
|
| 1296 | + __('Bulk edit details', 'event_espresso'), |
|
| 1297 | 1297 | |
| 1298 | 1298 | // Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:17 |
| 1299 | - __( 'Are you sure you want to bulk update the details?', 'event_espresso' ), |
|
| 1299 | + __('Are you sure you want to bulk update the details?', 'event_espresso'), |
|
| 1300 | 1300 | |
| 1301 | 1301 | // Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:18 |
| 1302 | - __( 'Bulk update details', 'event_espresso' ), |
|
| 1302 | + __('Bulk update details', 'event_espresso'), |
|
| 1303 | 1303 | |
| 1304 | 1304 | // Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:27 |
| 1305 | - __( 'set custom dates order', 'event_espresso' ), |
|
| 1305 | + __('set custom dates order', 'event_espresso'), |
|
| 1306 | 1306 | |
| 1307 | 1307 | // Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:28 |
| 1308 | - __( 'set custom tickets order', 'event_espresso' ), |
|
| 1308 | + __('set custom tickets order', 'event_espresso'), |
|
| 1309 | 1309 | |
| 1310 | 1310 | // Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:30 |
| 1311 | - __( 'Set Custom Dates Order - this is how dates are ordered on the frontend', 'event_espresso' ), |
|
| 1311 | + __('Set Custom Dates Order - this is how dates are ordered on the frontend', 'event_espresso'), |
|
| 1312 | 1312 | |
| 1313 | 1313 | // Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:31 |
| 1314 | - __( 'Set Custom Tickets Order - this is how tickets are ordered on the frontend', 'event_espresso' ), |
|
| 1314 | + __('Set Custom Tickets Order - this is how tickets are ordered on the frontend', 'event_espresso'), |
|
| 1315 | 1315 | |
| 1316 | 1316 | // Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:32 |
| 1317 | - __( 'delete form element', 'event_espresso' ), |
|
| 1317 | + __('delete form element', 'event_espresso'), |
|
| 1318 | 1318 | |
| 1319 | 1319 | // Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:49 |
| 1320 | - __( 'form element settings', 'event_espresso' ), |
|
| 1320 | + __('form element settings', 'event_espresso'), |
|
| 1321 | 1321 | |
| 1322 | 1322 | // Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:59 |
| 1323 | - __( 'copy form element', 'event_espresso' ), |
|
| 1323 | + __('copy form element', 'event_espresso'), |
|
| 1324 | 1324 | |
| 1325 | 1325 | // Reference: packages/form-builder/src/FormElement/FormElementToolbar.tsx:69 |
| 1326 | - __( 'click, hold, and drag to reorder form element', 'event_espresso' ), |
|
| 1326 | + __('click, hold, and drag to reorder form element', 'event_espresso'), |
|
| 1327 | 1327 | |
| 1328 | 1328 | // Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:20 |
| 1329 | - __( 'remove option', 'event_espresso' ), |
|
| 1329 | + __('remove option', 'event_espresso'), |
|
| 1330 | 1330 | |
| 1331 | 1331 | // Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:42 |
| 1332 | - __( 'value', 'event_espresso' ), |
|
| 1332 | + __('value', 'event_espresso'), |
|
| 1333 | 1333 | |
| 1334 | 1334 | // Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:52 |
| 1335 | - __( 'label', 'event_espresso' ), |
|
| 1335 | + __('label', 'event_espresso'), |
|
| 1336 | 1336 | |
| 1337 | 1337 | // Reference: packages/form-builder/src/FormElement/Tabs/FieldOption.tsx:63 |
| 1338 | - __( 'click, hold, and drag to reorder field option', 'event_espresso' ), |
|
| 1338 | + __('click, hold, and drag to reorder field option', 'event_espresso'), |
|
| 1339 | 1339 | |
| 1340 | 1340 | // Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:61 |
| 1341 | - __( 'Options are the choices you give people to select from.', 'event_espresso' ), |
|
| 1341 | + __('Options are the choices you give people to select from.', 'event_espresso'), |
|
| 1342 | 1342 | |
| 1343 | 1343 | // Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:63 |
| 1344 | - __( 'The value is a simple key that will be saved to the database and the label is what is shown to the user.', 'event_espresso' ), |
|
| 1344 | + __('The value is a simple key that will be saved to the database and the label is what is shown to the user.', 'event_espresso'), |
|
| 1345 | 1345 | |
| 1346 | 1346 | // Reference: packages/form-builder/src/FormElement/Tabs/FieldOptions.tsx:96 |
| 1347 | - __( 'add new option', 'event_espresso' ), |
|
| 1347 | + __('add new option', 'event_espresso'), |
|
| 1348 | 1348 | |
| 1349 | 1349 | // Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:26 |
| 1350 | 1350 | // Reference: packages/form-builder/src/FormSection/Tabs/FormSectionTabs.tsx:25 |
| 1351 | - __( 'Styles', 'event_espresso' ), |
|
| 1351 | + __('Styles', 'event_espresso'), |
|
| 1352 | 1352 | |
| 1353 | 1353 | // Reference: packages/form-builder/src/FormElement/Tabs/FormElementTabs.tsx:30 |
| 1354 | - __( 'Validation', 'event_espresso' ), |
|
| 1354 | + __('Validation', 'event_espresso'), |
|
| 1355 | 1355 | |
| 1356 | 1356 | // Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:18 |
| 1357 | - __( 'Change input type', 'event_espresso' ), |
|
| 1357 | + __('Change input type', 'event_espresso'), |
|
| 1358 | 1358 | |
| 1359 | 1359 | // Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:19 |
| 1360 | - __( 'Some configurations might be lost. Are you sure you want to change the input type?', 'event_espresso' ), |
|
| 1360 | + __('Some configurations might be lost. Are you sure you want to change the input type?', 'event_espresso'), |
|
| 1361 | 1361 | |
| 1362 | 1362 | // Reference: packages/form-builder/src/FormElement/Tabs/InputType.tsx:40 |
| 1363 | - __( 'type', 'event_espresso' ), |
|
| 1363 | + __('type', 'event_espresso'), |
|
| 1364 | 1364 | |
| 1365 | 1365 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:26 |
| 1366 | 1366 | // Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:17 |
| 1367 | - __( 'public label', 'event_espresso' ), |
|
| 1367 | + __('public label', 'event_espresso'), |
|
| 1368 | 1368 | |
| 1369 | 1369 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:33 |
| 1370 | 1370 | // Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:22 |
| 1371 | - __( 'admin label', 'event_espresso' ), |
|
| 1371 | + __('admin label', 'event_espresso'), |
|
| 1372 | 1372 | |
| 1373 | 1373 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:40 |
| 1374 | - __( 'content', 'event_espresso' ), |
|
| 1374 | + __('content', 'event_espresso'), |
|
| 1375 | 1375 | |
| 1376 | 1376 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:48 |
| 1377 | - __( 'options', 'event_espresso' ), |
|
| 1377 | + __('options', 'event_espresso'), |
|
| 1378 | 1378 | |
| 1379 | 1379 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:51 |
| 1380 | - __( 'placeholder', 'event_espresso' ), |
|
| 1380 | + __('placeholder', 'event_espresso'), |
|
| 1381 | 1381 | |
| 1382 | 1382 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:57 |
| 1383 | - __( 'admin only', 'event_espresso' ), |
|
| 1383 | + __('admin only', 'event_espresso'), |
|
| 1384 | 1384 | |
| 1385 | 1385 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:62 |
| 1386 | - __( 'help text', 'event_espresso' ), |
|
| 1386 | + __('help text', 'event_espresso'), |
|
| 1387 | 1387 | |
| 1388 | 1388 | // Reference: packages/form-builder/src/FormElement/Tabs/Settings.tsx:71 |
| 1389 | - __( 'maps to', 'event_espresso' ), |
|
| 1389 | + __('maps to', 'event_espresso'), |
|
| 1390 | 1390 | |
| 1391 | 1391 | // Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:15 |
| 1392 | 1392 | // Reference: packages/form-builder/src/FormSection/Tabs/Styles.tsx:13 |
| 1393 | - __( 'css class', 'event_espresso' ), |
|
| 1393 | + __('css class', 'event_espresso'), |
|
| 1394 | 1394 | |
| 1395 | 1395 | // Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:20 |
| 1396 | - __( 'help text css class', 'event_espresso' ), |
|
| 1396 | + __('help text css class', 'event_espresso'), |
|
| 1397 | 1397 | |
| 1398 | 1398 | // Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:27 |
| 1399 | - __( 'size', 'event_espresso' ), |
|
| 1399 | + __('size', 'event_espresso'), |
|
| 1400 | 1400 | |
| 1401 | 1401 | // Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:35 |
| 1402 | - __( 'step', 'event_espresso' ), |
|
| 1402 | + __('step', 'event_espresso'), |
|
| 1403 | 1403 | |
| 1404 | 1404 | // Reference: packages/form-builder/src/FormElement/Tabs/Styles.tsx:41 |
| 1405 | - __( 'maxlength', 'event_espresso' ), |
|
| 1405 | + __('maxlength', 'event_espresso'), |
|
| 1406 | 1406 | |
| 1407 | 1407 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:123 |
| 1408 | - __( 'min', 'event_espresso' ), |
|
| 1408 | + __('min', 'event_espresso'), |
|
| 1409 | 1409 | |
| 1410 | 1410 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:128 |
| 1411 | - __( 'max', 'event_espresso' ), |
|
| 1411 | + __('max', 'event_espresso'), |
|
| 1412 | 1412 | |
| 1413 | 1413 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:28 |
| 1414 | - __( 'Germany', 'event_espresso' ), |
|
| 1414 | + __('Germany', 'event_espresso'), |
|
| 1415 | 1415 | |
| 1416 | 1416 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:32 |
| 1417 | - __( 'France', 'event_espresso' ), |
|
| 1417 | + __('France', 'event_espresso'), |
|
| 1418 | 1418 | |
| 1419 | 1419 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:36 |
| 1420 | - __( 'United Kingdom', 'event_espresso' ), |
|
| 1420 | + __('United Kingdom', 'event_espresso'), |
|
| 1421 | 1421 | |
| 1422 | 1422 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:40 |
| 1423 | - __( 'United States', 'event_espresso' ), |
|
| 1423 | + __('United States', 'event_espresso'), |
|
| 1424 | 1424 | |
| 1425 | 1425 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:44 |
| 1426 | - __( 'Custom', 'event_espresso' ), |
|
| 1426 | + __('Custom', 'event_espresso'), |
|
| 1427 | 1427 | |
| 1428 | 1428 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:54 |
| 1429 | - __( 'required', 'event_espresso' ), |
|
| 1429 | + __('required', 'event_espresso'), |
|
| 1430 | 1430 | |
| 1431 | 1431 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:59 |
| 1432 | - __( 'required text', 'event_espresso' ), |
|
| 1432 | + __('required text', 'event_espresso'), |
|
| 1433 | 1433 | |
| 1434 | 1434 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:66 |
| 1435 | - __( 'autocomplete', 'event_espresso' ), |
|
| 1435 | + __('autocomplete', 'event_espresso'), |
|
| 1436 | 1436 | |
| 1437 | 1437 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:74 |
| 1438 | - __( 'custom format', 'event_espresso' ), |
|
| 1438 | + __('custom format', 'event_espresso'), |
|
| 1439 | 1439 | |
| 1440 | 1440 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:75 |
| 1441 | - __( 'format', 'event_espresso' ), |
|
| 1441 | + __('format', 'event_espresso'), |
|
| 1442 | 1442 | |
| 1443 | 1443 | // Reference: packages/form-builder/src/FormElement/Tabs/Validation.tsx:83 |
| 1444 | - __( 'pattern', 'event_espresso' ), |
|
| 1444 | + __('pattern', 'event_espresso'), |
|
| 1445 | 1445 | |
| 1446 | 1446 | // Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:110 |
| 1447 | - __( 'add new form element', 'event_espresso' ), |
|
| 1447 | + __('add new form element', 'event_espresso'), |
|
| 1448 | 1448 | |
| 1449 | 1449 | // Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:117 |
| 1450 | 1450 | // Reference: packages/form/src/renderers/RepeatableRenderer.tsx:52 |
| 1451 | - __( 'Add', 'event_espresso' ), |
|
| 1451 | + __('Add', 'event_espresso'), |
|
| 1452 | 1452 | |
| 1453 | 1453 | // Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:76 |
| 1454 | - __( 'Add Form Element', 'event_espresso' ), |
|
| 1454 | + __('Add Form Element', 'event_espresso'), |
|
| 1455 | 1455 | |
| 1456 | 1456 | // Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:85 |
| 1457 | - __( 'form element order can be changed after adding by using the drag handles in the form element toolbar', 'event_espresso' ), |
|
| 1457 | + __('form element order can be changed after adding by using the drag handles in the form element toolbar', 'event_espresso'), |
|
| 1458 | 1458 | |
| 1459 | 1459 | // Reference: packages/form-builder/src/FormSection/AddFormElementPopover.tsx:92 |
| 1460 | - __( 'load existing form section', 'event_espresso' ), |
|
| 1460 | + __('load existing form section', 'event_espresso'), |
|
| 1461 | 1461 | |
| 1462 | 1462 | // Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:32 |
| 1463 | - __( 'delete form section', 'event_espresso' ), |
|
| 1463 | + __('delete form section', 'event_espresso'), |
|
| 1464 | 1464 | |
| 1465 | 1465 | // Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:47 |
| 1466 | - __( 'form section settings', 'event_espresso' ), |
|
| 1466 | + __('form section settings', 'event_espresso'), |
|
| 1467 | 1467 | |
| 1468 | 1468 | // Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:57 |
| 1469 | - __( 'copy form section', 'event_espresso' ), |
|
| 1469 | + __('copy form section', 'event_espresso'), |
|
| 1470 | 1470 | |
| 1471 | 1471 | // Reference: packages/form-builder/src/FormSection/FormSectionToolbar.tsx:74 |
| 1472 | - __( 'click, hold, and drag to reorder form section', 'event_espresso' ), |
|
| 1472 | + __('click, hold, and drag to reorder form section', 'event_espresso'), |
|
| 1473 | 1473 | |
| 1474 | 1474 | // Reference: packages/form-builder/src/FormSection/FormSections.tsx:26 |
| 1475 | - __( 'Add Form Section', 'event_espresso' ), |
|
| 1475 | + __('Add Form Section', 'event_espresso'), |
|
| 1476 | 1476 | |
| 1477 | 1477 | // Reference: packages/form-builder/src/FormSection/SaveSection.tsx:47 |
| 1478 | - __( 'save form section for use in other forms', 'event_espresso' ), |
|
| 1478 | + __('save form section for use in other forms', 'event_espresso'), |
|
| 1479 | 1479 | |
| 1480 | 1480 | // Reference: packages/form-builder/src/FormSection/SaveSection.tsx:51 |
| 1481 | - __( 'save as', 'event_espresso' ), |
|
| 1481 | + __('save as', 'event_espresso'), |
|
| 1482 | 1482 | |
| 1483 | 1483 | // Reference: packages/form-builder/src/FormSection/SaveSection.tsx:55 |
| 1484 | - __( 'default', 'event_espresso' ), |
|
| 1484 | + __('default', 'event_espresso'), |
|
| 1485 | 1485 | |
| 1486 | 1486 | // Reference: packages/form-builder/src/FormSection/SaveSection.tsx:58 |
| 1487 | - __( ' a copy of this form section will be automatically added to ALL new events', 'event_espresso' ), |
|
| 1487 | + __(' a copy of this form section will be automatically added to ALL new events', 'event_espresso'), |
|
| 1488 | 1488 | |
| 1489 | 1489 | // Reference: packages/form-builder/src/FormSection/SaveSection.tsx:61 |
| 1490 | - __( 'shared', 'event_espresso' ), |
|
| 1490 | + __('shared', 'event_espresso'), |
|
| 1491 | 1491 | |
| 1492 | 1492 | // Reference: packages/form-builder/src/FormSection/SaveSection.tsx:64 |
| 1493 | - __( 'a copy of this form section will be saved for use in other events but not loaded by default', 'event_espresso' ), |
|
| 1493 | + __('a copy of this form section will be saved for use in other events but not loaded by default', 'event_espresso'), |
|
| 1494 | 1494 | |
| 1495 | 1495 | // Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:27 |
| 1496 | - __( 'show label', 'event_espresso' ), |
|
| 1496 | + __('show label', 'event_espresso'), |
|
| 1497 | 1497 | |
| 1498 | 1498 | // Reference: packages/form-builder/src/FormSection/Tabs/Settings.tsx:33 |
| 1499 | - __( 'applies to', 'event_espresso' ), |
|
| 1499 | + __('applies to', 'event_espresso'), |
|
| 1500 | 1500 | |
| 1501 | 1501 | // Reference: packages/form-builder/src/constants.ts:102 |
| 1502 | 1502 | // Reference: packages/form-builder/src/state/utils.ts:436 |
| 1503 | - __( 'URL', 'event_espresso' ), |
|
| 1503 | + __('URL', 'event_espresso'), |
|
| 1504 | 1504 | |
| 1505 | 1505 | // Reference: packages/form-builder/src/constants.ts:104 |
| 1506 | - __( 'adds a text input for entering a URL address', 'event_espresso' ), |
|
| 1506 | + __('adds a text input for entering a URL address', 'event_espresso'), |
|
| 1507 | 1507 | |
| 1508 | 1508 | // Reference: packages/form-builder/src/constants.ts:107 |
| 1509 | - __( 'Date', 'event_espresso' ), |
|
| 1509 | + __('Date', 'event_espresso'), |
|
| 1510 | 1510 | |
| 1511 | 1511 | // Reference: packages/form-builder/src/constants.ts:109 |
| 1512 | - __( 'adds a text input that allows users to enter a date directly via keyboard or a datepicker', 'event_espresso' ), |
|
| 1512 | + __('adds a text input that allows users to enter a date directly via keyboard or a datepicker', 'event_espresso'), |
|
| 1513 | 1513 | |
| 1514 | 1514 | // Reference: packages/form-builder/src/constants.ts:112 |
| 1515 | 1515 | // Reference: packages/form-builder/src/state/utils.ts:369 |
| 1516 | - __( 'Local Date', 'event_espresso' ), |
|
| 1516 | + __('Local Date', 'event_espresso'), |
|
| 1517 | 1517 | |
| 1518 | 1518 | // Reference: packages/form-builder/src/constants.ts:117 |
| 1519 | - __( 'Month', 'event_espresso' ), |
|
| 1519 | + __('Month', 'event_espresso'), |
|
| 1520 | 1520 | |
| 1521 | 1521 | // Reference: packages/form-builder/src/constants.ts:119 |
| 1522 | - __( 'adds a text input that allows users to enter a month and year directly via keyboard or a datepicker', 'event_espresso' ), |
|
| 1522 | + __('adds a text input that allows users to enter a month and year directly via keyboard or a datepicker', 'event_espresso'), |
|
| 1523 | 1523 | |
| 1524 | 1524 | // Reference: packages/form-builder/src/constants.ts:122 |
| 1525 | - __( 'Time', 'event_espresso' ), |
|
| 1525 | + __('Time', 'event_espresso'), |
|
| 1526 | 1526 | |
| 1527 | 1527 | // Reference: packages/form-builder/src/constants.ts:124 |
| 1528 | - __( 'adds a text input that allows users to enter a time directly via keyboard or a timepicker', 'event_espresso' ), |
|
| 1528 | + __('adds a text input that allows users to enter a time directly via keyboard or a timepicker', 'event_espresso'), |
|
| 1529 | 1529 | |
| 1530 | 1530 | // Reference: packages/form-builder/src/constants.ts:127 |
| 1531 | - __( 'Week', 'event_espresso' ), |
|
| 1531 | + __('Week', 'event_espresso'), |
|
| 1532 | 1532 | |
| 1533 | 1533 | // Reference: packages/form-builder/src/constants.ts:129 |
| 1534 | - __( 'adds a text input that allows users to enter a week and year directly via keyboard or a datepicker', 'event_espresso' ), |
|
| 1534 | + __('adds a text input that allows users to enter a week and year directly via keyboard or a datepicker', 'event_espresso'), |
|
| 1535 | 1535 | |
| 1536 | 1536 | // Reference: packages/form-builder/src/constants.ts:132 |
| 1537 | - __( 'Day Selector', 'event_espresso' ), |
|
| 1537 | + __('Day Selector', 'event_espresso'), |
|
| 1538 | 1538 | |
| 1539 | 1539 | // Reference: packages/form-builder/src/constants.ts:134 |
| 1540 | - __( 'adds a dropdown selector that allows users to select the day of the month (01 to 31)', 'event_espresso' ), |
|
| 1540 | + __('adds a dropdown selector that allows users to select the day of the month (01 to 31)', 'event_espresso'), |
|
| 1541 | 1541 | |
| 1542 | 1542 | // Reference: packages/form-builder/src/constants.ts:137 |
| 1543 | - __( 'Month Selector', 'event_espresso' ), |
|
| 1543 | + __('Month Selector', 'event_espresso'), |
|
| 1544 | 1544 | |
| 1545 | 1545 | // Reference: packages/form-builder/src/constants.ts:139 |
| 1546 | - __( 'adds a dropdown selector that allows users to select the month of the year (01 to 12)', 'event_espresso' ), |
|
| 1546 | + __('adds a dropdown selector that allows users to select the month of the year (01 to 12)', 'event_espresso'), |
|
| 1547 | 1547 | |
| 1548 | 1548 | // Reference: packages/form-builder/src/constants.ts:142 |
| 1549 | - __( 'Year Selector', 'event_espresso' ), |
|
| 1549 | + __('Year Selector', 'event_espresso'), |
|
| 1550 | 1550 | |
| 1551 | 1551 | // Reference: packages/form-builder/src/constants.ts:144 |
| 1552 | - __( 'adds a dropdown selector that allows users to select the year from a configurable range', 'event_espresso' ), |
|
| 1552 | + __('adds a dropdown selector that allows users to select the year from a configurable range', 'event_espresso'), |
|
| 1553 | 1553 | |
| 1554 | 1554 | // Reference: packages/form-builder/src/constants.ts:147 |
| 1555 | - __( 'Radio Buttons', 'event_espresso' ), |
|
| 1555 | + __('Radio Buttons', 'event_espresso'), |
|
| 1556 | 1556 | |
| 1557 | 1557 | // Reference: packages/form-builder/src/constants.ts:149 |
| 1558 | - __( 'adds one or more radio buttons that allow users to only select one option from those provided', 'event_espresso' ), |
|
| 1558 | + __('adds one or more radio buttons that allow users to only select one option from those provided', 'event_espresso'), |
|
| 1559 | 1559 | |
| 1560 | 1560 | // Reference: packages/form-builder/src/constants.ts:152 |
| 1561 | 1561 | // Reference: packages/form-builder/src/state/utils.ts:375 |
| 1562 | - __( 'Decimal Number', 'event_espresso' ), |
|
| 1562 | + __('Decimal Number', 'event_espresso'), |
|
| 1563 | 1563 | |
| 1564 | 1564 | // Reference: packages/form-builder/src/constants.ts:154 |
| 1565 | - __( 'adds a text input that only accepts numbers whose value is a decimal (float)', 'event_espresso' ), |
|
| 1565 | + __('adds a text input that only accepts numbers whose value is a decimal (float)', 'event_espresso'), |
|
| 1566 | 1566 | |
| 1567 | 1567 | // Reference: packages/form-builder/src/constants.ts:157 |
| 1568 | 1568 | // Reference: packages/form-builder/src/state/utils.ts:378 |
| 1569 | - __( 'Whole Number', 'event_espresso' ), |
|
| 1569 | + __('Whole Number', 'event_espresso'), |
|
| 1570 | 1570 | |
| 1571 | 1571 | // Reference: packages/form-builder/src/constants.ts:159 |
| 1572 | - __( 'adds a text input that only accepts numbers whose value is an integer (whole number)', 'event_espresso' ), |
|
| 1572 | + __('adds a text input that only accepts numbers whose value is an integer (whole number)', 'event_espresso'), |
|
| 1573 | 1573 | |
| 1574 | 1574 | // Reference: packages/form-builder/src/constants.ts:162 |
| 1575 | - __( 'Number Range', 'event_espresso' ), |
|
| 1575 | + __('Number Range', 'event_espresso'), |
|
| 1576 | 1576 | |
| 1577 | 1577 | // Reference: packages/form-builder/src/constants.ts:167 |
| 1578 | - __( 'Phone Number', 'event_espresso' ), |
|
| 1578 | + __('Phone Number', 'event_espresso'), |
|
| 1579 | 1579 | |
| 1580 | 1580 | // Reference: packages/form-builder/src/constants.ts:172 |
| 1581 | - __( 'Dropdown', 'event_espresso' ), |
|
| 1581 | + __('Dropdown', 'event_espresso'), |
|
| 1582 | 1582 | |
| 1583 | 1583 | // Reference: packages/form-builder/src/constants.ts:174 |
| 1584 | - __( 'adds a dropdown selector that accepts a single value', 'event_espresso' ), |
|
| 1584 | + __('adds a dropdown selector that accepts a single value', 'event_espresso'), |
|
| 1585 | 1585 | |
| 1586 | 1586 | // Reference: packages/form-builder/src/constants.ts:177 |
| 1587 | - __( 'Multi Select', 'event_espresso' ), |
|
| 1587 | + __('Multi Select', 'event_espresso'), |
|
| 1588 | 1588 | |
| 1589 | 1589 | // Reference: packages/form-builder/src/constants.ts:179 |
| 1590 | - __( 'adds a dropdown selector that accepts multiple values', 'event_espresso' ), |
|
| 1590 | + __('adds a dropdown selector that accepts multiple values', 'event_espresso'), |
|
| 1591 | 1591 | |
| 1592 | 1592 | // Reference: packages/form-builder/src/constants.ts:182 |
| 1593 | - __( 'Toggle/Switch', 'event_espresso' ), |
|
| 1593 | + __('Toggle/Switch', 'event_espresso'), |
|
| 1594 | 1594 | |
| 1595 | 1595 | // Reference: packages/form-builder/src/constants.ts:184 |
| 1596 | - __( 'adds a toggle or a switch to accept true or false value', 'event_espresso' ), |
|
| 1596 | + __('adds a toggle or a switch to accept true or false value', 'event_espresso'), |
|
| 1597 | 1597 | |
| 1598 | 1598 | // Reference: packages/form-builder/src/constants.ts:187 |
| 1599 | - __( 'Multi Checkbox', 'event_espresso' ), |
|
| 1599 | + __('Multi Checkbox', 'event_espresso'), |
|
| 1600 | 1600 | |
| 1601 | 1601 | // Reference: packages/form-builder/src/constants.ts:189 |
| 1602 | - __( 'adds checkboxes that allow users to select zero or more options from those provided', 'event_espresso' ), |
|
| 1602 | + __('adds checkboxes that allow users to select zero or more options from those provided', 'event_espresso'), |
|
| 1603 | 1603 | |
| 1604 | 1604 | // Reference: packages/form-builder/src/constants.ts:192 |
| 1605 | - __( 'Country Selector', 'event_espresso' ), |
|
| 1605 | + __('Country Selector', 'event_espresso'), |
|
| 1606 | 1606 | |
| 1607 | 1607 | // Reference: packages/form-builder/src/constants.ts:194 |
| 1608 | - __( 'adds a dropdown selector populated with names of countries that are enabled for the site', 'event_espresso' ), |
|
| 1608 | + __('adds a dropdown selector populated with names of countries that are enabled for the site', 'event_espresso'), |
|
| 1609 | 1609 | |
| 1610 | 1610 | // Reference: packages/form-builder/src/constants.ts:197 |
| 1611 | - __( 'State Selector', 'event_espresso' ), |
|
| 1611 | + __('State Selector', 'event_espresso'), |
|
| 1612 | 1612 | |
| 1613 | 1613 | // Reference: packages/form-builder/src/constants.ts:202 |
| 1614 | - __( 'Button', 'event_espresso' ), |
|
| 1614 | + __('Button', 'event_espresso'), |
|
| 1615 | 1615 | |
| 1616 | 1616 | // Reference: packages/form-builder/src/constants.ts:204 |
| 1617 | - __( 'adds a button to the form that can be used for triggering fucntionality (requires custom coding)', 'event_espresso' ), |
|
| 1617 | + __('adds a button to the form that can be used for triggering fucntionality (requires custom coding)', 'event_espresso'), |
|
| 1618 | 1618 | |
| 1619 | 1619 | // Reference: packages/form-builder/src/constants.ts:207 |
| 1620 | - __( 'Reset Button', 'event_espresso' ), |
|
| 1620 | + __('Reset Button', 'event_espresso'), |
|
| 1621 | 1621 | |
| 1622 | 1622 | // Reference: packages/form-builder/src/constants.ts:209 |
| 1623 | - __( 'adds a button that will reset the form back to its original state.', 'event_espresso' ), |
|
| 1623 | + __('adds a button that will reset the form back to its original state.', 'event_espresso'), |
|
| 1624 | 1624 | |
| 1625 | 1625 | // Reference: packages/form-builder/src/constants.ts:55 |
| 1626 | - __( 'Form Section', 'event_espresso' ), |
|
| 1626 | + __('Form Section', 'event_espresso'), |
|
| 1627 | 1627 | |
| 1628 | 1628 | // Reference: packages/form-builder/src/constants.ts:57 |
| 1629 | - __( 'Used for creating logical groupings for questions and form elements. Need to add a heading or description? Use the HTML form element.', 'event_espresso' ), |
|
| 1629 | + __('Used for creating logical groupings for questions and form elements. Need to add a heading or description? Use the HTML form element.', 'event_espresso'), |
|
| 1630 | 1630 | |
| 1631 | 1631 | // Reference: packages/form-builder/src/constants.ts:62 |
| 1632 | - __( 'HTML Block', 'event_espresso' ), |
|
| 1632 | + __('HTML Block', 'event_espresso'), |
|
| 1633 | 1633 | |
| 1634 | 1634 | // Reference: packages/form-builder/src/constants.ts:64 |
| 1635 | - __( 'allows you to add HTML like headings or text paragraphs to your form', 'event_espresso' ), |
|
| 1635 | + __('allows you to add HTML like headings or text paragraphs to your form', 'event_espresso'), |
|
| 1636 | 1636 | |
| 1637 | 1637 | // Reference: packages/form-builder/src/constants.ts:69 |
| 1638 | - __( 'adds a text input that only accepts plain text', 'event_espresso' ), |
|
| 1638 | + __('adds a text input that only accepts plain text', 'event_espresso'), |
|
| 1639 | 1639 | |
| 1640 | 1640 | // Reference: packages/form-builder/src/constants.ts:72 |
| 1641 | - __( 'Plain Text Area', 'event_espresso' ), |
|
| 1641 | + __('Plain Text Area', 'event_espresso'), |
|
| 1642 | 1642 | |
| 1643 | 1643 | // Reference: packages/form-builder/src/constants.ts:74 |
| 1644 | - __( 'adds a textarea block that only accepts plain text', 'event_espresso' ), |
|
| 1644 | + __('adds a textarea block that only accepts plain text', 'event_espresso'), |
|
| 1645 | 1645 | |
| 1646 | 1646 | // Reference: packages/form-builder/src/constants.ts:77 |
| 1647 | - __( 'HTML Text Area', 'event_espresso' ), |
|
| 1647 | + __('HTML Text Area', 'event_espresso'), |
|
| 1648 | 1648 | |
| 1649 | 1649 | // Reference: packages/form-builder/src/constants.ts:79 |
| 1650 | - __( 'adds a textarea block that accepts text including simple HTML markup', 'event_espresso' ), |
|
| 1650 | + __('adds a textarea block that accepts text including simple HTML markup', 'event_espresso'), |
|
| 1651 | 1651 | |
| 1652 | 1652 | // Reference: packages/form-builder/src/constants.ts:84 |
| 1653 | - __( 'adds a text input that only accepts a valid email address', 'event_espresso' ), |
|
| 1653 | + __('adds a text input that only accepts a valid email address', 'event_espresso'), |
|
| 1654 | 1654 | |
| 1655 | 1655 | // Reference: packages/form-builder/src/constants.ts:87 |
| 1656 | - __( 'Email Confirmation', 'event_espresso' ), |
|
| 1656 | + __('Email Confirmation', 'event_espresso'), |
|
| 1657 | 1657 | |
| 1658 | 1658 | // Reference: packages/form-builder/src/constants.ts:92 |
| 1659 | - __( 'Password', 'event_espresso' ), |
|
| 1659 | + __('Password', 'event_espresso'), |
|
| 1660 | 1660 | |
| 1661 | 1661 | // Reference: packages/form-builder/src/constants.ts:94 |
| 1662 | - __( 'adds a text input that accepts text but masks what the user enters', 'event_espresso' ), |
|
| 1662 | + __('adds a text input that accepts text but masks what the user enters', 'event_espresso'), |
|
| 1663 | 1663 | |
| 1664 | 1664 | // Reference: packages/form-builder/src/constants.ts:97 |
| 1665 | - __( 'Password Confirmation', 'event_espresso' ), |
|
| 1665 | + __('Password Confirmation', 'event_espresso'), |
|
| 1666 | 1666 | |
| 1667 | 1667 | // Reference: packages/form-builder/src/data/useElementMutator.ts:54 |
| 1668 | - __( 'element', 'event_espresso' ), |
|
| 1668 | + __('element', 'event_espresso'), |
|
| 1669 | 1669 | |
| 1670 | 1670 | // Reference: packages/form-builder/src/data/useSectionMutator.ts:54 |
| 1671 | - __( 'section', 'event_espresso' ), |
|
| 1671 | + __('section', 'event_espresso'), |
|
| 1672 | 1672 | |
| 1673 | 1673 | // Reference: packages/form-builder/src/state/utils.ts:360 |
| 1674 | - __( 'click', 'event_espresso' ), |
|
| 1674 | + __('click', 'event_espresso'), |
|
| 1675 | 1675 | |
| 1676 | 1676 | // Reference: packages/form-builder/src/state/utils.ts:363 |
| 1677 | - __( 'checkboxes', 'event_espresso' ), |
|
| 1677 | + __('checkboxes', 'event_espresso'), |
|
| 1678 | 1678 | |
| 1679 | 1679 | // Reference: packages/form-builder/src/state/utils.ts:366 |
| 1680 | - __( 'date', 'event_espresso' ), |
|
| 1680 | + __('date', 'event_espresso'), |
|
| 1681 | 1681 | |
| 1682 | 1682 | // Reference: packages/form-builder/src/state/utils.ts:372 |
| 1683 | - __( 'day', 'event_espresso' ), |
|
| 1683 | + __('day', 'event_espresso'), |
|
| 1684 | 1684 | |
| 1685 | 1685 | // Reference: packages/form-builder/src/state/utils.ts:381 |
| 1686 | - __( 'email address', 'event_espresso' ), |
|
| 1686 | + __('email address', 'event_espresso'), |
|
| 1687 | 1687 | |
| 1688 | 1688 | // Reference: packages/form-builder/src/state/utils.ts:384 |
| 1689 | - __( 'confirm email address', 'event_espresso' ), |
|
| 1689 | + __('confirm email address', 'event_espresso'), |
|
| 1690 | 1690 | |
| 1691 | 1691 | // Reference: packages/form-builder/src/state/utils.ts:388 |
| 1692 | - __( 'month', 'event_espresso' ), |
|
| 1692 | + __('month', 'event_espresso'), |
|
| 1693 | 1693 | |
| 1694 | 1694 | // Reference: packages/form-builder/src/state/utils.ts:391 |
| 1695 | - __( 'password', 'event_espresso' ), |
|
| 1695 | + __('password', 'event_espresso'), |
|
| 1696 | 1696 | |
| 1697 | 1697 | // Reference: packages/form-builder/src/state/utils.ts:394 |
| 1698 | - __( 'confirm password', 'event_espresso' ), |
|
| 1698 | + __('confirm password', 'event_espresso'), |
|
| 1699 | 1699 | |
| 1700 | 1700 | // Reference: packages/form-builder/src/state/utils.ts:397 |
| 1701 | - __( 'radio buttons', 'event_espresso' ), |
|
| 1701 | + __('radio buttons', 'event_espresso'), |
|
| 1702 | 1702 | |
| 1703 | 1703 | // Reference: packages/form-builder/src/state/utils.ts:400 |
| 1704 | - __( 'number range', 'event_espresso' ), |
|
| 1704 | + __('number range', 'event_espresso'), |
|
| 1705 | 1705 | |
| 1706 | 1706 | // Reference: packages/form-builder/src/state/utils.ts:403 |
| 1707 | - __( 'selection dropdown', 'event_espresso' ), |
|
| 1707 | + __('selection dropdown', 'event_espresso'), |
|
| 1708 | 1708 | |
| 1709 | 1709 | // Reference: packages/form-builder/src/state/utils.ts:406 |
| 1710 | - __( 'country', 'event_espresso' ), |
|
| 1710 | + __('country', 'event_espresso'), |
|
| 1711 | 1711 | |
| 1712 | 1712 | // Reference: packages/form-builder/src/state/utils.ts:409 |
| 1713 | - __( 'multi-select dropdown', 'event_espresso' ), |
|
| 1713 | + __('multi-select dropdown', 'event_espresso'), |
|
| 1714 | 1714 | |
| 1715 | 1715 | // Reference: packages/form-builder/src/state/utils.ts:412 |
| 1716 | - __( 'state/province', 'event_espresso' ), |
|
| 1716 | + __('state/province', 'event_espresso'), |
|
| 1717 | 1717 | |
| 1718 | 1718 | // Reference: packages/form-builder/src/state/utils.ts:415 |
| 1719 | - __( 'on/off switch', 'event_espresso' ), |
|
| 1719 | + __('on/off switch', 'event_espresso'), |
|
| 1720 | 1720 | |
| 1721 | 1721 | // Reference: packages/form-builder/src/state/utils.ts:418 |
| 1722 | - __( 'reset', 'event_espresso' ), |
|
| 1722 | + __('reset', 'event_espresso'), |
|
| 1723 | 1723 | |
| 1724 | 1724 | // Reference: packages/form-builder/src/state/utils.ts:421 |
| 1725 | - __( 'phone number', 'event_espresso' ), |
|
| 1725 | + __('phone number', 'event_espresso'), |
|
| 1726 | 1726 | |
| 1727 | 1727 | // Reference: packages/form-builder/src/state/utils.ts:424 |
| 1728 | - __( 'text', 'event_espresso' ), |
|
| 1728 | + __('text', 'event_espresso'), |
|
| 1729 | 1729 | |
| 1730 | 1730 | // Reference: packages/form-builder/src/state/utils.ts:427 |
| 1731 | - __( 'simple textarea', 'event_espresso' ), |
|
| 1731 | + __('simple textarea', 'event_espresso'), |
|
| 1732 | 1732 | |
| 1733 | 1733 | // Reference: packages/form-builder/src/state/utils.ts:430 |
| 1734 | - __( 'html textarea', 'event_espresso' ), |
|
| 1734 | + __('html textarea', 'event_espresso'), |
|
| 1735 | 1735 | |
| 1736 | 1736 | // Reference: packages/form-builder/src/state/utils.ts:439 |
| 1737 | - __( 'week', 'event_espresso' ), |
|
| 1737 | + __('week', 'event_espresso'), |
|
| 1738 | 1738 | |
| 1739 | 1739 | // Reference: packages/form-builder/src/state/utils.ts:442 |
| 1740 | - __( 'year', 'event_espresso' ), |
|
| 1740 | + __('year', 'event_espresso'), |
|
| 1741 | 1741 | |
| 1742 | 1742 | // Reference: packages/form/src/adapters/WPMediaImage.tsx:12 |
| 1743 | - __( 'Select Image', 'event_espresso' ), |
|
| 1743 | + __('Select Image', 'event_espresso'), |
|
| 1744 | 1744 | |
| 1745 | 1745 | // Reference: packages/form/src/adapters/WPMediaImage.tsx:44 |
| 1746 | 1746 | // Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:11 |
| 1747 | 1747 | // Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:12 |
| 1748 | 1748 | // Reference: packages/ui-components/src/SimpleEntityList/EntityTemplate.tsx:32 |
| 1749 | - __( 'Select', 'event_espresso' ), |
|
| 1749 | + __('Select', 'event_espresso'), |
|
| 1750 | 1750 | |
| 1751 | 1751 | // Reference: packages/form/src/renderers/FormRenderer.tsx:51 |
| 1752 | - __( 'Form Errors', 'event_espresso' ), |
|
| 1752 | + __('Form Errors', 'event_espresso'), |
|
| 1753 | 1753 | |
| 1754 | 1754 | // Reference: packages/form/src/renderers/RepeatableRenderer.tsx:36 |
| 1755 | 1755 | /* translators: %d the entry number */ |
| 1756 | - __( 'Entry %d', 'event_espresso' ), |
|
| 1756 | + __('Entry %d', 'event_espresso'), |
|
| 1757 | 1757 | |
| 1758 | 1758 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11 |
| 1759 | 1759 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17 |
| 1760 | - __( 'sold out', 'event_espresso' ), |
|
| 1760 | + __('sold out', 'event_espresso'), |
|
| 1761 | 1761 | |
| 1762 | 1762 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14 |
| 1763 | 1763 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14 |
| 1764 | - __( 'expired', 'event_espresso' ), |
|
| 1764 | + __('expired', 'event_espresso'), |
|
| 1765 | 1765 | |
| 1766 | 1766 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17 |
| 1767 | - __( 'upcoming', 'event_espresso' ), |
|
| 1767 | + __('upcoming', 'event_espresso'), |
|
| 1768 | 1768 | |
| 1769 | 1769 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20 |
| 1770 | - __( 'active', 'event_espresso' ), |
|
| 1770 | + __('active', 'event_espresso'), |
|
| 1771 | 1771 | |
| 1772 | 1772 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23 |
| 1773 | 1773 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11 |
| 1774 | - __( 'trashed', 'event_espresso' ), |
|
| 1774 | + __('trashed', 'event_espresso'), |
|
| 1775 | 1775 | |
| 1776 | 1776 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26 |
| 1777 | - __( 'cancelled', 'event_espresso' ), |
|
| 1777 | + __('cancelled', 'event_espresso'), |
|
| 1778 | 1778 | |
| 1779 | 1779 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29 |
| 1780 | - __( 'postponed', 'event_espresso' ), |
|
| 1780 | + __('postponed', 'event_espresso'), |
|
| 1781 | 1781 | |
| 1782 | 1782 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33 |
| 1783 | - __( 'inactive', 'event_espresso' ), |
|
| 1783 | + __('inactive', 'event_espresso'), |
|
| 1784 | 1784 | |
| 1785 | 1785 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20 |
| 1786 | - __( 'pending', 'event_espresso' ), |
|
| 1786 | + __('pending', 'event_espresso'), |
|
| 1787 | 1787 | |
| 1788 | 1788 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23 |
| 1789 | - __( 'on sale', 'event_espresso' ), |
|
| 1789 | + __('on sale', 'event_espresso'), |
|
| 1790 | 1790 | |
| 1791 | 1791 | // Reference: packages/helpers/src/tickets/ticketVisibilityOptions.ts:6 |
| 1792 | - __( 'Where the ticket can be viewed throughout the UI. ', 'event_espresso' ), |
|
| 1792 | + __('Where the ticket can be viewed throughout the UI. ', 'event_espresso'), |
|
| 1793 | 1793 | |
| 1794 | 1794 | // Reference: packages/predicates/src/registration/statusOptions.ts:16 |
| 1795 | - __( 'Declined', 'event_espresso' ), |
|
| 1795 | + __('Declined', 'event_espresso'), |
|
| 1796 | 1796 | |
| 1797 | 1797 | // Reference: packages/predicates/src/registration/statusOptions.ts:21 |
| 1798 | - __( 'Incomplete', 'event_espresso' ), |
|
| 1798 | + __('Incomplete', 'event_espresso'), |
|
| 1799 | 1799 | |
| 1800 | 1800 | // Reference: packages/predicates/src/registration/statusOptions.ts:26 |
| 1801 | - __( 'Not Approved', 'event_espresso' ), |
|
| 1801 | + __('Not Approved', 'event_espresso'), |
|
| 1802 | 1802 | |
| 1803 | 1803 | // Reference: packages/predicates/src/registration/statusOptions.ts:31 |
| 1804 | - __( 'Pending Payment', 'event_espresso' ), |
|
| 1804 | + __('Pending Payment', 'event_espresso'), |
|
| 1805 | 1805 | |
| 1806 | 1806 | // Reference: packages/predicates/src/registration/statusOptions.ts:36 |
| 1807 | - __( 'Wait List', 'event_espresso' ), |
|
| 1807 | + __('Wait List', 'event_espresso'), |
|
| 1808 | 1808 | |
| 1809 | 1809 | // Reference: packages/predicates/src/registration/statusOptions.ts:6 |
| 1810 | - __( 'Approved', 'event_espresso' ), |
|
| 1810 | + __('Approved', 'event_espresso'), |
|
| 1811 | 1811 | |
| 1812 | 1812 | // Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:9 |
| 1813 | 1813 | // Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:10 |
| 1814 | - __( 'Select media', 'event_espresso' ), |
|
| 1814 | + __('Select media', 'event_espresso'), |
|
| 1815 | 1815 | |
| 1816 | 1816 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/RichTextEditor.tsx:84 |
| 1817 | - __( 'Write something…', 'event_espresso' ), |
|
| 1817 | + __('Write something…', 'event_espresso'), |
|
| 1818 | 1818 | |
| 1819 | 1819 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/Toolbar.tsx:20 |
| 1820 | - __( 'RTE Toolbar', 'event_espresso' ), |
|
| 1820 | + __('RTE Toolbar', 'event_espresso'), |
|
| 1821 | 1821 | |
| 1822 | 1822 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:11 |
| 1823 | - __( 'Normal', 'event_espresso' ), |
|
| 1823 | + __('Normal', 'event_espresso'), |
|
| 1824 | 1824 | |
| 1825 | 1825 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:12 |
| 1826 | - __( 'H1', 'event_espresso' ), |
|
| 1826 | + __('H1', 'event_espresso'), |
|
| 1827 | 1827 | |
| 1828 | 1828 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:13 |
| 1829 | - __( 'H2', 'event_espresso' ), |
|
| 1829 | + __('H2', 'event_espresso'), |
|
| 1830 | 1830 | |
| 1831 | 1831 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:14 |
| 1832 | - __( 'H3', 'event_espresso' ), |
|
| 1832 | + __('H3', 'event_espresso'), |
|
| 1833 | 1833 | |
| 1834 | 1834 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:15 |
| 1835 | - __( 'H4', 'event_espresso' ), |
|
| 1835 | + __('H4', 'event_espresso'), |
|
| 1836 | 1836 | |
| 1837 | 1837 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:16 |
| 1838 | - __( 'H5', 'event_espresso' ), |
|
| 1838 | + __('H5', 'event_espresso'), |
|
| 1839 | 1839 | |
| 1840 | 1840 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:17 |
| 1841 | - __( 'H6', 'event_espresso' ), |
|
| 1841 | + __('H6', 'event_espresso'), |
|
| 1842 | 1842 | |
| 1843 | 1843 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:18 |
| 1844 | - __( 'Block quote', 'event_espresso' ), |
|
| 1844 | + __('Block quote', 'event_espresso'), |
|
| 1845 | 1845 | |
| 1846 | 1846 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:19 |
| 1847 | - __( 'Code', 'event_espresso' ), |
|
| 1847 | + __('Code', 'event_espresso'), |
|
| 1848 | 1848 | |
| 1849 | 1849 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:36 |
| 1850 | - __( 'Set color', 'event_espresso' ), |
|
| 1850 | + __('Set color', 'event_espresso'), |
|
| 1851 | 1851 | |
| 1852 | 1852 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:45 |
| 1853 | - __( 'Text color', 'event_espresso' ), |
|
| 1853 | + __('Text color', 'event_espresso'), |
|
| 1854 | 1854 | |
| 1855 | 1855 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:47 |
| 1856 | - __( 'Background color', 'event_espresso' ), |
|
| 1856 | + __('Background color', 'event_espresso'), |
|
| 1857 | 1857 | |
| 1858 | 1858 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:39 |
| 1859 | - __( 'Add image', 'event_espresso' ), |
|
| 1859 | + __('Add image', 'event_espresso'), |
|
| 1860 | 1860 | |
| 1861 | 1861 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:51 |
| 1862 | - __( 'Image URL', 'event_espresso' ), |
|
| 1862 | + __('Image URL', 'event_espresso'), |
|
| 1863 | 1863 | |
| 1864 | 1864 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:55 |
| 1865 | - __( 'Alt text', 'event_espresso' ), |
|
| 1865 | + __('Alt text', 'event_espresso'), |
|
| 1866 | 1866 | |
| 1867 | 1867 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:56 |
| 1868 | - __( 'Width', 'event_espresso' ), |
|
| 1868 | + __('Width', 'event_espresso'), |
|
| 1869 | 1869 | |
| 1870 | 1870 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:60 |
| 1871 | - __( 'Height', 'event_espresso' ), |
|
| 1871 | + __('Height', 'event_espresso'), |
|
| 1872 | 1872 | |
| 1873 | 1873 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:54 |
| 1874 | - __( 'Edit link', 'event_espresso' ), |
|
| 1874 | + __('Edit link', 'event_espresso'), |
|
| 1875 | 1875 | |
| 1876 | 1876 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:64 |
| 1877 | - __( 'URL title', 'event_espresso' ), |
|
| 1877 | + __('URL title', 'event_espresso'), |
|
| 1878 | 1878 | |
| 1879 | 1879 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:11 |
| 1880 | - __( 'Unordered list', 'event_espresso' ), |
|
| 1880 | + __('Unordered list', 'event_espresso'), |
|
| 1881 | 1881 | |
| 1882 | 1882 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:12 |
| 1883 | - __( 'Ordered list', 'event_espresso' ), |
|
| 1883 | + __('Ordered list', 'event_espresso'), |
|
| 1884 | 1884 | |
| 1885 | 1885 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:13 |
| 1886 | 1886 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:13 |
| 1887 | - __( 'Indent', 'event_espresso' ), |
|
| 1887 | + __('Indent', 'event_espresso'), |
|
| 1888 | 1888 | |
| 1889 | 1889 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:14 |
| 1890 | 1890 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:14 |
| 1891 | - __( 'Outdent', 'event_espresso' ), |
|
| 1891 | + __('Outdent', 'event_espresso'), |
|
| 1892 | 1892 | |
| 1893 | 1893 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:11 |
| 1894 | - __( 'Unordered textalign', 'event_espresso' ), |
|
| 1894 | + __('Unordered textalign', 'event_espresso'), |
|
| 1895 | 1895 | |
| 1896 | 1896 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:12 |
| 1897 | - __( 'Ordered textalign', 'event_espresso' ), |
|
| 1897 | + __('Ordered textalign', 'event_espresso'), |
|
| 1898 | 1898 | |
| 1899 | 1899 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/render/Image/Toolbar.tsx:32 |
| 1900 | - __( 'Image toolbar', 'event_espresso' ), |
|
| 1900 | + __('Image toolbar', 'event_espresso'), |
|
| 1901 | 1901 | |
| 1902 | 1902 | // Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:62 |
| 1903 | 1903 | // Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:35 |
| 1904 | - __( 'Visual editor', 'event_espresso' ), |
|
| 1904 | + __('Visual editor', 'event_espresso'), |
|
| 1905 | 1905 | |
| 1906 | 1906 | // Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:66 |
| 1907 | 1907 | // Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:39 |
| 1908 | - __( 'HTML editor', 'event_espresso' ), |
|
| 1908 | + __('HTML editor', 'event_espresso'), |
|
| 1909 | 1909 | |
| 1910 | 1910 | // Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:68 |
| 1911 | - __( 'Add Media', 'event_espresso' ), |
|
| 1911 | + __('Add Media', 'event_espresso'), |
|
| 1912 | 1912 | |
| 1913 | 1913 | // Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:16 |
| 1914 | - __( 'add new price modifier after this row', 'event_espresso' ), |
|
| 1914 | + __('add new price modifier after this row', 'event_espresso'), |
|
| 1915 | 1915 | |
| 1916 | 1916 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:14 |
| 1917 | - __( 'Delete all prices', 'event_espresso' ), |
|
| 1917 | + __('Delete all prices', 'event_espresso'), |
|
| 1918 | 1918 | |
| 1919 | 1919 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:27 |
| 1920 | - __( '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' ), |
|
| 1920 | + __('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'), |
|
| 1921 | 1921 | |
| 1922 | 1922 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:31 |
| 1923 | - __( 'Delete all prices?', 'event_espresso' ), |
|
| 1923 | + __('Delete all prices?', 'event_espresso'), |
|
| 1924 | 1924 | |
| 1925 | 1925 | // Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12 |
| 1926 | - __( 'delete price modifier', 'event_espresso' ), |
|
| 1926 | + __('delete price modifier', 'event_espresso'), |
|
| 1927 | 1927 | |
| 1928 | 1928 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:14 |
| 1929 | - __( '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' ), |
|
| 1929 | + __('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'), |
|
| 1930 | 1930 | |
| 1931 | 1931 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:17 |
| 1932 | - __( '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' ), |
|
| 1932 | + __('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'), |
|
| 1933 | 1933 | |
| 1934 | 1934 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21 |
| 1935 | - __( 'Disable reverse calculate', 'event_espresso' ), |
|
| 1935 | + __('Disable reverse calculate', 'event_espresso'), |
|
| 1936 | 1936 | |
| 1937 | 1937 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:21 |
| 1938 | - __( 'Enable reverse calculate', 'event_espresso' ), |
|
| 1938 | + __('Enable reverse calculate', 'event_espresso'), |
|
| 1939 | 1939 | |
| 1940 | 1940 | // Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:28 |
| 1941 | - __( 'ticket price calculator', 'event_espresso' ), |
|
| 1941 | + __('ticket price calculator', 'event_espresso'), |
|
| 1942 | 1942 | |
| 1943 | 1943 | // Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:9 |
| 1944 | - __( 'Add default taxes', 'event_espresso' ), |
|
| 1944 | + __('Add default taxes', 'event_espresso'), |
|
| 1945 | 1945 | |
| 1946 | 1946 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:10 |
| 1947 | - __( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ), |
|
| 1947 | + __('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'), |
|
| 1948 | 1948 | |
| 1949 | 1949 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:14 |
| 1950 | - __( 'Remove all taxes?', 'event_espresso' ), |
|
| 1950 | + __('Remove all taxes?', 'event_espresso'), |
|
| 1951 | 1951 | |
| 1952 | 1952 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:7 |
| 1953 | - __( 'Remove taxes', 'event_espresso' ), |
|
| 1953 | + __('Remove taxes', 'event_espresso'), |
|
| 1954 | 1954 | |
| 1955 | 1955 | // Reference: packages/tpc/src/components/AddDefaultPricesButton.tsx:9 |
| 1956 | - __( 'Add default prices', 'event_espresso' ), |
|
| 1956 | + __('Add default prices', 'event_espresso'), |
|
| 1957 | 1957 | |
| 1958 | 1958 | // Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:29 |
| 1959 | - __( 'Modify default prices.', 'event_espresso' ), |
|
| 1959 | + __('Modify default prices.', 'event_espresso'), |
|
| 1960 | 1960 | |
| 1961 | 1961 | // Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:29 |
| 1962 | - __( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ), |
|
| 1962 | + __('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'), |
|
| 1963 | 1963 | |
| 1964 | 1964 | // Reference: packages/tpc/src/components/LockedTicketsBanner.tsx:12 |
| 1965 | 1965 | // Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:74 |
| 1966 | - __( 'Price editing is disabled!', 'event_espresso' ), |
|
| 1966 | + __('Price editing is disabled!', 'event_espresso'), |
|
| 1967 | 1967 | |
| 1968 | 1968 | // Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:12 |
| 1969 | - __( 'One or more price types are missing. Maybe they were placed in the trash?', 'event_espresso' ), |
|
| 1969 | + __('One or more price types are missing. Maybe they were placed in the trash?', 'event_espresso'), |
|
| 1970 | 1970 | |
| 1971 | 1971 | // Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:17 |
| 1972 | 1972 | /* translators: %s link to price types admin */ |
| 1973 | - __( 'Go to the%sto restore (untrash) your price types and/or create some new ones.', 'event_espresso' ), |
|
| 1973 | + __('Go to the%sto restore (untrash) your price types and/or create some new ones.', 'event_espresso'), |
|
| 1974 | 1974 | |
| 1975 | 1975 | // Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:18 |
| 1976 | - __( 'price types admin page', 'event_espresso' ), |
|
| 1976 | + __('price types admin page', 'event_espresso'), |
|
| 1977 | 1977 | |
| 1978 | 1978 | // Reference: packages/tpc/src/components/NoPriceTypesBanner.tsx:26 |
| 1979 | - __( 'Missing Price Types!', 'event_espresso' ), |
|
| 1979 | + __('Missing Price Types!', 'event_espresso'), |
|
| 1980 | 1980 | |
| 1981 | 1981 | // Reference: packages/tpc/src/components/NoPricesBanner.tsx:14 |
| 1982 | - __( 'This Ticket is Currently Free', 'event_espresso' ), |
|
| 1982 | + __('This Ticket is Currently Free', 'event_espresso'), |
|
| 1983 | 1983 | |
| 1984 | 1984 | // Reference: packages/tpc/src/components/NoPricesBanner.tsx:21 |
| 1985 | 1985 | /* translators: %s default prices */ |
| 1986 | - __( 'Click the button below to load your %s into the calculator.', 'event_espresso' ), |
|
| 1986 | + __('Click the button below to load your %s into the calculator.', 'event_espresso'), |
|
| 1987 | 1987 | |
| 1988 | 1988 | // Reference: packages/tpc/src/components/NoPricesBanner.tsx:22 |
| 1989 | - __( 'default prices', 'event_espresso' ), |
|
| 1989 | + __('default prices', 'event_espresso'), |
|
| 1990 | 1990 | |
| 1991 | 1991 | // Reference: packages/tpc/src/components/NoPricesBanner.tsx:29 |
| 1992 | - __( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ), |
|
| 1992 | + __('Additional ticket price modifiers can be added or removed.', 'event_espresso'), |
|
| 1993 | 1993 | |
| 1994 | 1994 | // Reference: packages/tpc/src/components/NoPricesBanner.tsx:31 |
| 1995 | - __( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ), |
|
| 1995 | + __('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'), |
|
| 1996 | 1996 | |
| 1997 | 1997 | // Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:22 |
| 1998 | 1998 | // Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:7 |
| 1999 | 1999 | // Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:10 |
| 2000 | 2000 | // Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:52 |
| 2001 | - __( 'Changes will be lost if you proceed.', 'event_espresso' ), |
|
| 2001 | + __('Changes will be lost if you proceed.', 'event_espresso'), |
|
| 2002 | 2002 | |
| 2003 | 2003 | // Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:33 |
| 2004 | 2004 | /* translators: %s ticket name */ |
| 2005 | - __( 'Price Calculator for Ticket: %s', 'event_espresso' ), |
|
| 2005 | + __('Price Calculator for Ticket: %s', 'event_espresso'), |
|
| 2006 | 2006 | |
| 2007 | 2007 | // Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:48 |
| 2008 | - __( 'Total', 'event_espresso' ), |
|
| 2008 | + __('Total', 'event_espresso'), |
|
| 2009 | 2009 | |
| 2010 | 2010 | // Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:57 |
| 2011 | - __( 'ticket total', 'event_espresso' ), |
|
| 2011 | + __('ticket total', 'event_espresso'), |
|
| 2012 | 2012 | |
| 2013 | 2013 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29 |
| 2014 | - __( 'Order', 'event_espresso' ), |
|
| 2014 | + __('Order', 'event_espresso'), |
|
| 2015 | 2015 | |
| 2016 | 2016 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35 |
| 2017 | - __( 'Price Type', 'event_espresso' ), |
|
| 2017 | + __('Price Type', 'event_espresso'), |
|
| 2018 | 2018 | |
| 2019 | 2019 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41 |
| 2020 | - __( 'Label', 'event_espresso' ), |
|
| 2020 | + __('Label', 'event_espresso'), |
|
| 2021 | 2021 | |
| 2022 | 2022 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53 |
| 2023 | - __( 'Amount', 'event_espresso' ), |
|
| 2023 | + __('Amount', 'event_espresso'), |
|
| 2024 | 2024 | |
| 2025 | 2025 | // Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:22 |
| 2026 | - __( 'Copy ticket', 'event_espresso' ), |
|
| 2026 | + __('Copy ticket', 'event_espresso'), |
|
| 2027 | 2027 | |
| 2028 | 2028 | // Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:26 |
| 2029 | - __( 'Copy and archive this ticket', 'event_espresso' ), |
|
| 2029 | + __('Copy and archive this ticket', 'event_espresso'), |
|
| 2030 | 2030 | |
| 2031 | 2031 | // Reference: packages/tpc/src/hooks/useLockedTicketAction.ts:29 |
| 2032 | - __( 'OK', 'event_espresso' ), |
|
| 2032 | + __('OK', 'event_espresso'), |
|
| 2033 | 2033 | |
| 2034 | 2034 | // Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:34 |
| 2035 | - __( 'amount', 'event_espresso' ), |
|
| 2035 | + __('amount', 'event_espresso'), |
|
| 2036 | 2036 | |
| 2037 | 2037 | // Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:46 |
| 2038 | - __( 'amount…', 'event_espresso' ), |
|
| 2038 | + __('amount…', 'event_espresso'), |
|
| 2039 | 2039 | |
| 2040 | 2040 | // Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:14 |
| 2041 | - __( 'description…', 'event_espresso' ), |
|
| 2041 | + __('description…', 'event_espresso'), |
|
| 2042 | 2042 | |
| 2043 | 2043 | // Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:9 |
| 2044 | - __( 'price description', 'event_espresso' ), |
|
| 2044 | + __('price description', 'event_espresso'), |
|
| 2045 | 2045 | |
| 2046 | 2046 | // Reference: packages/tpc/src/inputs/PriceIdInput.tsx:6 |
| 2047 | - __( 'price id', 'event_espresso' ), |
|
| 2047 | + __('price id', 'event_espresso'), |
|
| 2048 | 2048 | |
| 2049 | 2049 | // Reference: packages/tpc/src/inputs/PriceNameInput.tsx:13 |
| 2050 | - __( 'label…', 'event_espresso' ), |
|
| 2050 | + __('label…', 'event_espresso'), |
|
| 2051 | 2051 | |
| 2052 | 2052 | // Reference: packages/tpc/src/inputs/PriceNameInput.tsx:8 |
| 2053 | - __( 'price name', 'event_espresso' ), |
|
| 2053 | + __('price name', 'event_espresso'), |
|
| 2054 | 2054 | |
| 2055 | 2055 | // Reference: packages/tpc/src/inputs/PriceOrderInput.tsx:14 |
| 2056 | - __( 'price order', 'event_espresso' ), |
|
| 2056 | + __('price order', 'event_espresso'), |
|
| 2057 | 2057 | |
| 2058 | 2058 | // Reference: packages/tpc/src/utils/constants.ts:8 |
| 2059 | - __( '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' ), |
|
| 2059 | + __('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'), |
|
| 2060 | 2060 | |
| 2061 | 2061 | // Reference: packages/ui-components/src/ActiveFilters/ActiveFilters.tsx:8 |
| 2062 | - __( 'active filters:', 'event_espresso' ), |
|
| 2062 | + __('active filters:', 'event_espresso'), |
|
| 2063 | 2063 | |
| 2064 | 2064 | // Reference: packages/ui-components/src/ActiveFilters/FilterTag/index.tsx:15 |
| 2065 | 2065 | /* translators: %s filter name */ |
| 2066 | - __( 'remove filter - %s', 'event_espresso' ), |
|
| 2066 | + __('remove filter - %s', 'event_espresso'), |
|
| 2067 | 2067 | |
| 2068 | 2068 | // Reference: packages/ui-components/src/Address/Address.tsx:105 |
| 2069 | - __( 'Country:', 'event_espresso' ), |
|
| 2069 | + __('Country:', 'event_espresso'), |
|
| 2070 | 2070 | |
| 2071 | 2071 | // Reference: packages/ui-components/src/Address/Address.tsx:113 |
| 2072 | - __( 'Zip:', 'event_espresso' ), |
|
| 2072 | + __('Zip:', 'event_espresso'), |
|
| 2073 | 2073 | |
| 2074 | 2074 | // Reference: packages/ui-components/src/Address/Address.tsx:81 |
| 2075 | - __( 'Address:', 'event_espresso' ), |
|
| 2075 | + __('Address:', 'event_espresso'), |
|
| 2076 | 2076 | |
| 2077 | 2077 | // Reference: packages/ui-components/src/Address/Address.tsx:89 |
| 2078 | - __( 'City:', 'event_espresso' ), |
|
| 2078 | + __('City:', 'event_espresso'), |
|
| 2079 | 2079 | |
| 2080 | 2080 | // Reference: packages/ui-components/src/Address/Address.tsx:97 |
| 2081 | - __( 'State:', 'event_espresso' ), |
|
| 2081 | + __('State:', 'event_espresso'), |
|
| 2082 | 2082 | |
| 2083 | 2083 | // Reference: packages/ui-components/src/CalendarDateRange/CalendarDateRange.tsx:37 |
| 2084 | - __( 'to', 'event_espresso' ), |
|
| 2084 | + __('to', 'event_espresso'), |
|
| 2085 | 2085 | |
| 2086 | 2086 | // Reference: packages/ui-components/src/CalendarPageDate/CalendarPageDate.tsx:54 |
| 2087 | - __( 'TO', 'event_espresso' ), |
|
| 2087 | + __('TO', 'event_espresso'), |
|
| 2088 | 2088 | |
| 2089 | 2089 | // Reference: packages/ui-components/src/ColorPicker/ColorPicker.tsx:60 |
| 2090 | - __( 'Custom color', 'event_espresso' ), |
|
| 2090 | + __('Custom color', 'event_espresso'), |
|
| 2091 | 2091 | |
| 2092 | 2092 | // Reference: packages/ui-components/src/ColorPicker/Swatch.tsx:23 |
| 2093 | 2093 | /* translators: color name */ |
| 2094 | - __( 'Color: %s', 'event_espresso' ), |
|
| 2094 | + __('Color: %s', 'event_espresso'), |
|
| 2095 | 2095 | |
| 2096 | 2096 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:13 |
| 2097 | - __( 'Cyan bluish gray', 'event_espresso' ), |
|
| 2097 | + __('Cyan bluish gray', 'event_espresso'), |
|
| 2098 | 2098 | |
| 2099 | 2099 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:17 |
| 2100 | - __( 'White', 'event_espresso' ), |
|
| 2100 | + __('White', 'event_espresso'), |
|
| 2101 | 2101 | |
| 2102 | 2102 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:21 |
| 2103 | - __( 'Pale pink', 'event_espresso' ), |
|
| 2103 | + __('Pale pink', 'event_espresso'), |
|
| 2104 | 2104 | |
| 2105 | 2105 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:25 |
| 2106 | - __( 'Vivid red', 'event_espresso' ), |
|
| 2106 | + __('Vivid red', 'event_espresso'), |
|
| 2107 | 2107 | |
| 2108 | 2108 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:29 |
| 2109 | - __( 'Luminous vivid orange', 'event_espresso' ), |
|
| 2109 | + __('Luminous vivid orange', 'event_espresso'), |
|
| 2110 | 2110 | |
| 2111 | 2111 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:33 |
| 2112 | - __( 'Luminous vivid amber', 'event_espresso' ), |
|
| 2112 | + __('Luminous vivid amber', 'event_espresso'), |
|
| 2113 | 2113 | |
| 2114 | 2114 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:37 |
| 2115 | - __( 'Light green cyan', 'event_espresso' ), |
|
| 2115 | + __('Light green cyan', 'event_espresso'), |
|
| 2116 | 2116 | |
| 2117 | 2117 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:41 |
| 2118 | - __( 'Vivid green cyan', 'event_espresso' ), |
|
| 2118 | + __('Vivid green cyan', 'event_espresso'), |
|
| 2119 | 2119 | |
| 2120 | 2120 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:45 |
| 2121 | - __( 'Pale cyan blue', 'event_espresso' ), |
|
| 2121 | + __('Pale cyan blue', 'event_espresso'), |
|
| 2122 | 2122 | |
| 2123 | 2123 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:49 |
| 2124 | - __( 'Vivid cyan blue', 'event_espresso' ), |
|
| 2124 | + __('Vivid cyan blue', 'event_espresso'), |
|
| 2125 | 2125 | |
| 2126 | 2126 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:53 |
| 2127 | - __( 'Vivid purple', 'event_espresso' ), |
|
| 2127 | + __('Vivid purple', 'event_espresso'), |
|
| 2128 | 2128 | |
| 2129 | 2129 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:9 |
| 2130 | - __( 'Black', 'event_espresso' ), |
|
| 2130 | + __('Black', 'event_espresso'), |
|
| 2131 | 2131 | |
| 2132 | 2132 | // Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:8 |
| 2133 | 2133 | // Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:24 |
| 2134 | - __( 'Are you sure you want to close this?', 'event_espresso' ), |
|
| 2134 | + __('Are you sure you want to close this?', 'event_espresso'), |
|
| 2135 | 2135 | |
| 2136 | 2136 | // Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:9 |
| 2137 | 2137 | // Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:25 |
| 2138 | - __( 'Yes, discard changes', 'event_espresso' ), |
|
| 2138 | + __('Yes, discard changes', 'event_espresso'), |
|
| 2139 | 2139 | |
| 2140 | 2140 | // Reference: packages/ui-components/src/Confirm/ConfirmDelete.tsx:7 |
| 2141 | - __( 'Are you sure you want to delete this?', 'event_espresso' ), |
|
| 2141 | + __('Are you sure you want to delete this?', 'event_espresso'), |
|
| 2142 | 2142 | |
| 2143 | 2143 | // Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:11 |
| 2144 | - __( 'Please confirm this action.', 'event_espresso' ), |
|
| 2144 | + __('Please confirm this action.', 'event_espresso'), |
|
| 2145 | 2145 | |
| 2146 | 2146 | // Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:39 |
| 2147 | - __( 'cancel', 'event_espresso' ), |
|
| 2147 | + __('cancel', 'event_espresso'), |
|
| 2148 | 2148 | |
| 2149 | 2149 | // Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:40 |
| 2150 | - __( 'confirm', 'event_espresso' ), |
|
| 2150 | + __('confirm', 'event_espresso'), |
|
| 2151 | 2151 | |
| 2152 | 2152 | // Reference: packages/ui-components/src/CurrencyDisplay/CurrencyDisplay.tsx:34 |
| 2153 | - __( 'free', 'event_espresso' ), |
|
| 2153 | + __('free', 'event_espresso'), |
|
| 2154 | 2154 | |
| 2155 | 2155 | // Reference: packages/ui-components/src/DateTimeRangePicker/DateTimeRangePicker.tsx:117 |
| 2156 | 2156 | // Reference: packages/ui-components/src/Popover/PopoverForm/PopoverForm.tsx:44 |
| 2157 | - __( 'save', 'event_espresso' ), |
|
| 2157 | + __('save', 'event_espresso'), |
|
| 2158 | 2158 | |
| 2159 | 2159 | // Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36 |
| 2160 | - __( 'Hide Debug Info', 'event_espresso' ), |
|
| 2160 | + __('Hide Debug Info', 'event_espresso'), |
|
| 2161 | 2161 | |
| 2162 | 2162 | // Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36 |
| 2163 | - __( 'Show Debug Info', 'event_espresso' ), |
|
| 2163 | + __('Show Debug Info', 'event_espresso'), |
|
| 2164 | 2164 | |
| 2165 | 2165 | // Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:49 |
| 2166 | - __( 'Edit Start and End Dates and Times', 'event_espresso' ), |
|
| 2166 | + __('Edit Start and End Dates and Times', 'event_espresso'), |
|
| 2167 | 2167 | |
| 2168 | 2168 | // Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/CopyEntity.tsx:8 |
| 2169 | - __( 'copy', 'event_espresso' ), |
|
| 2169 | + __('copy', 'event_espresso'), |
|
| 2170 | 2170 | |
| 2171 | 2171 | // Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/EditEntity.tsx:8 |
| 2172 | - __( 'edit', 'event_espresso' ), |
|
| 2172 | + __('edit', 'event_espresso'), |
|
| 2173 | 2173 | |
| 2174 | 2174 | // Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/TrashEntity.tsx:8 |
| 2175 | - __( 'trash', 'event_espresso' ), |
|
| 2175 | + __('trash', 'event_espresso'), |
|
| 2176 | 2176 | |
| 2177 | 2177 | // Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Untrash.tsx:8 |
| 2178 | - __( 'untrash', 'event_espresso' ), |
|
| 2178 | + __('untrash', 'event_espresso'), |
|
| 2179 | 2179 | |
| 2180 | 2180 | // Reference: packages/ui-components/src/EntityList/EntityList.tsx:23 |
| 2181 | - __( 'OOPS!', 'event_espresso' ), |
|
| 2181 | + __('OOPS!', 'event_espresso'), |
|
| 2182 | 2182 | |
| 2183 | 2183 | // Reference: packages/ui-components/src/EntityList/EntityList.tsx:23 |
| 2184 | - __( 'Error Loading Entites List', 'event_espresso' ), |
|
| 2184 | + __('Error Loading Entites List', 'event_espresso'), |
|
| 2185 | 2185 | |
| 2186 | 2186 | // Reference: packages/ui-components/src/EntityList/RegistrationsLink/index.tsx:12 |
| 2187 | - __( 'click to open the registrations admin page in a new tab or window', 'event_espresso' ), |
|
| 2187 | + __('click to open the registrations admin page in a new tab or window', 'event_espresso'), |
|
| 2188 | 2188 | |
| 2189 | 2189 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:22 |
| 2190 | - __( 'card view', 'event_espresso' ), |
|
| 2190 | + __('card view', 'event_espresso'), |
|
| 2191 | 2191 | |
| 2192 | 2192 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:21 |
| 2193 | - __( 'table view', 'event_espresso' ), |
|
| 2193 | + __('table view', 'event_espresso'), |
|
| 2194 | 2194 | |
| 2195 | 2195 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8 |
| 2196 | - __( 'hide bulk actions', 'event_espresso' ), |
|
| 2196 | + __('hide bulk actions', 'event_espresso'), |
|
| 2197 | 2197 | |
| 2198 | 2198 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8 |
| 2199 | - __( 'show bulk actions', 'event_espresso' ), |
|
| 2199 | + __('show bulk actions', 'event_espresso'), |
|
| 2200 | 2200 | |
| 2201 | 2201 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9 |
| 2202 | - __( 'hide filters', 'event_espresso' ), |
|
| 2202 | + __('hide filters', 'event_espresso'), |
|
| 2203 | 2203 | |
| 2204 | 2204 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9 |
| 2205 | - __( 'show filters', 'event_espresso' ), |
|
| 2205 | + __('show filters', 'event_espresso'), |
|
| 2206 | 2206 | |
| 2207 | 2207 | // Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26 |
| 2208 | - __( 'hide legend', 'event_espresso' ), |
|
| 2208 | + __('hide legend', 'event_espresso'), |
|
| 2209 | 2209 | |
| 2210 | 2210 | // Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26 |
| 2211 | - __( 'show legend', 'event_espresso' ), |
|
| 2211 | + __('show legend', 'event_espresso'), |
|
| 2212 | 2212 | |
| 2213 | 2213 | // Reference: packages/ui-components/src/LoadingNotice/LoadingNotice.tsx:11 |
| 2214 | - __( 'loading…', 'event_espresso' ), |
|
| 2214 | + __('loading…', 'event_espresso'), |
|
| 2215 | 2215 | |
| 2216 | 2216 | // Reference: packages/ui-components/src/Modal/Modal.tsx:59 |
| 2217 | - __( 'close modal', 'event_espresso' ), |
|
| 2217 | + __('close modal', 'event_espresso'), |
|
| 2218 | 2218 | |
| 2219 | 2219 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:10 |
| 2220 | - __( 'jump to previous', 'event_espresso' ), |
|
| 2220 | + __('jump to previous', 'event_espresso'), |
|
| 2221 | 2221 | |
| 2222 | 2222 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:11 |
| 2223 | - __( 'jump to next', 'event_espresso' ), |
|
| 2223 | + __('jump to next', 'event_espresso'), |
|
| 2224 | 2224 | |
| 2225 | 2225 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:12 |
| 2226 | - __( 'page', 'event_espresso' ), |
|
| 2226 | + __('page', 'event_espresso'), |
|
| 2227 | 2227 | |
| 2228 | 2228 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:8 |
| 2229 | - __( 'previous', 'event_espresso' ), |
|
| 2229 | + __('previous', 'event_espresso'), |
|
| 2230 | 2230 | |
| 2231 | 2231 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:9 |
| 2232 | - __( 'next', 'event_espresso' ), |
|
| 2232 | + __('next', 'event_espresso'), |
|
| 2233 | 2233 | |
| 2234 | 2234 | // Reference: packages/ui-components/src/Pagination/PerPage.tsx:37 |
| 2235 | - __( 'items per page', 'event_espresso' ), |
|
| 2235 | + __('items per page', 'event_espresso'), |
|
| 2236 | 2236 | |
| 2237 | 2237 | // Reference: packages/ui-components/src/Pagination/constants.ts:10 |
| 2238 | 2238 | /* translators: %s is per page value */ |
| 2239 | - __( '%s / page', 'event_espresso' ), |
|
| 2239 | + __('%s / page', 'event_espresso'), |
|
| 2240 | 2240 | |
| 2241 | 2241 | // Reference: packages/ui-components/src/Pagination/constants.ts:13 |
| 2242 | - __( 'Next Page', 'event_espresso' ), |
|
| 2242 | + __('Next Page', 'event_espresso'), |
|
| 2243 | 2243 | |
| 2244 | 2244 | // Reference: packages/ui-components/src/Pagination/constants.ts:14 |
| 2245 | - __( 'Previous Page', 'event_espresso' ), |
|
| 2245 | + __('Previous Page', 'event_espresso'), |
|
| 2246 | 2246 | |
| 2247 | 2247 | // Reference: packages/ui-components/src/PercentSign/index.tsx:10 |
| 2248 | - __( '%', 'event_espresso' ), |
|
| 2248 | + __('%', 'event_espresso'), |
|
| 2249 | 2249 | |
| 2250 | 2250 | // Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:31 |
| 2251 | 2251 | /* translators: entity type to select */ |
| 2252 | - __( 'Select an existing %s to use as a template.', 'event_espresso' ), |
|
| 2252 | + __('Select an existing %s to use as a template.', 'event_espresso'), |
|
| 2253 | 2253 | |
| 2254 | 2254 | // Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:38 |
| 2255 | - __( 'or', 'event_espresso' ), |
|
| 2255 | + __('or', 'event_espresso'), |
|
| 2256 | 2256 | |
| 2257 | 2257 | // Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:43 |
| 2258 | 2258 | /* translators: entity type to add */ |
| 2259 | - __( 'Add a new %s and insert details manually', 'event_espresso' ), |
|
| 2259 | + __('Add a new %s and insert details manually', 'event_espresso'), |
|
| 2260 | 2260 | |
| 2261 | 2261 | // Reference: packages/ui-components/src/SimpleEntityList/EntityOptionsRow/index.tsx:48 |
| 2262 | - __( 'Add New', 'event_espresso' ), |
|
| 2262 | + __('Add New', 'event_espresso'), |
|
| 2263 | 2263 | |
| 2264 | 2264 | // Reference: packages/ui-components/src/Stepper/buttons/Next.tsx:8 |
| 2265 | - __( 'Next', 'event_espresso' ), |
|
| 2265 | + __('Next', 'event_espresso'), |
|
| 2266 | 2266 | |
| 2267 | 2267 | // Reference: packages/ui-components/src/Stepper/buttons/Previous.tsx:8 |
| 2268 | - __( 'Previous', 'event_espresso' ), |
|
| 2268 | + __('Previous', 'event_espresso'), |
|
| 2269 | 2269 | |
| 2270 | 2270 | // Reference: packages/ui-components/src/Steps/Steps.tsx:31 |
| 2271 | - __( 'Steps', 'event_espresso' ), |
|
| 2271 | + __('Steps', 'event_espresso'), |
|
| 2272 | 2272 | |
| 2273 | 2273 | // Reference: packages/ui-components/src/TabbableText/index.tsx:21 |
| 2274 | - __( 'click to edit…', 'event_espresso' ), |
|
| 2274 | + __('click to edit…', 'event_espresso'), |
|
| 2275 | 2275 | |
| 2276 | 2276 | // Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:14 |
| 2277 | - __( 'The Website\'s Time Zone', 'event_espresso' ), |
|
| 2277 | + __('The Website\'s Time Zone', 'event_espresso'), |
|
| 2278 | 2278 | |
| 2279 | 2279 | // Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:19 |
| 2280 | - __( 'UTC (Greenwich Mean Time)', 'event_espresso' ), |
|
| 2280 | + __('UTC (Greenwich Mean Time)', 'event_espresso'), |
|
| 2281 | 2281 | |
| 2282 | 2282 | // Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:9 |
| 2283 | - __( 'Your Local Time Zone', 'event_espresso' ), |
|
| 2283 | + __('Your Local Time Zone', 'event_espresso'), |
|
| 2284 | 2284 | |
| 2285 | 2285 | // Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:25 |
| 2286 | - __( 'click for timezone information', 'event_espresso' ), |
|
| 2286 | + __('click for timezone information', 'event_espresso'), |
|
| 2287 | 2287 | |
| 2288 | 2288 | // Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:30 |
| 2289 | - __( 'This Date Converted To:', 'event_espresso' ), |
|
| 2289 | + __('This Date Converted To:', 'event_espresso'), |
|
| 2290 | 2290 | |
| 2291 | 2291 | // Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:120 |
| 2292 | - __( 'Add New Venue', 'event_espresso' ), |
|
| 2292 | + __('Add New Venue', 'event_espresso'), |
|
| 2293 | 2293 | |
| 2294 | 2294 | // Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:36 |
| 2295 | - __( '~ no venue ~', 'event_espresso' ), |
|
| 2295 | + __('~ no venue ~', 'event_espresso'), |
|
| 2296 | 2296 | |
| 2297 | 2297 | // Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:43 |
| 2298 | - __( 'assign venue…', 'event_espresso' ), |
|
| 2298 | + __('assign venue…', 'event_espresso'), |
|
| 2299 | 2299 | |
| 2300 | 2300 | // Reference: packages/ui-components/src/VenueSelector/VenueSelector.tsx:44 |
| 2301 | - __( 'click to select a venue…', 'event_espresso' ), |
|
| 2301 | + __('click to select a venue…', 'event_espresso'), |
|
| 2302 | 2302 | |
| 2303 | 2303 | // Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:51 |
| 2304 | - __( 'select all', 'event_espresso' ), |
|
| 2304 | + __('select all', 'event_espresso'), |
|
| 2305 | 2305 | |
| 2306 | 2306 | // Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:54 |
| 2307 | - __( 'apply', 'event_espresso' ) |
|
| 2307 | + __('apply', 'event_espresso') |
|
| 2308 | 2308 | ); |
| 2309 | 2309 | /* THIS IS THE END OF THE GENERATED FILE */ |
@@ -37,138 +37,138 @@ |
||
| 37 | 37 | * @since 4.0 |
| 38 | 38 | */ |
| 39 | 39 | if (function_exists('espresso_version')) { |
| 40 | - if (! function_exists('espresso_duplicate_plugin_error')) { |
|
| 41 | - /** |
|
| 42 | - * espresso_duplicate_plugin_error |
|
| 43 | - * displays if more than one version of EE is activated at the same time. |
|
| 44 | - */ |
|
| 45 | - function espresso_duplicate_plugin_error() |
|
| 46 | - { |
|
| 47 | - ?> |
|
| 40 | + if (! function_exists('espresso_duplicate_plugin_error')) { |
|
| 41 | + /** |
|
| 42 | + * espresso_duplicate_plugin_error |
|
| 43 | + * displays if more than one version of EE is activated at the same time. |
|
| 44 | + */ |
|
| 45 | + function espresso_duplicate_plugin_error() |
|
| 46 | + { |
|
| 47 | + ?> |
|
| 48 | 48 | <div class="error"> |
| 49 | 49 | <p> |
| 50 | 50 | <?php |
| 51 | - echo esc_html__( |
|
| 52 | - 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
| 53 | - 'event_espresso' |
|
| 54 | - ); ?> |
|
| 51 | + echo esc_html__( |
|
| 52 | + 'Can not run multiple versions of Event Espresso! One version has been automatically deactivated. Please verify that you have the correct version you want still active.', |
|
| 53 | + 'event_espresso' |
|
| 54 | + ); ?> |
|
| 55 | 55 | </p> |
| 56 | 56 | </div> |
| 57 | 57 | <?php |
| 58 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 59 | - } |
|
| 60 | - } |
|
| 61 | - add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 58 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 59 | + } |
|
| 60 | + } |
|
| 61 | + add_action('admin_notices', 'espresso_duplicate_plugin_error', 1); |
|
| 62 | 62 | } else { |
| 63 | - define('EE_MIN_PHP_VER_REQUIRED', '7.4.0'); |
|
| 64 | - if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
| 65 | - /** |
|
| 66 | - * espresso_minimum_php_version_error |
|
| 67 | - * |
|
| 68 | - * @return void |
|
| 69 | - */ |
|
| 70 | - function espresso_minimum_php_version_error() |
|
| 71 | - { |
|
| 72 | - ?> |
|
| 63 | + define('EE_MIN_PHP_VER_REQUIRED', '7.4.0'); |
|
| 64 | + if (! version_compare(PHP_VERSION, EE_MIN_PHP_VER_REQUIRED, '>=')) { |
|
| 65 | + /** |
|
| 66 | + * espresso_minimum_php_version_error |
|
| 67 | + * |
|
| 68 | + * @return void |
|
| 69 | + */ |
|
| 70 | + function espresso_minimum_php_version_error() |
|
| 71 | + { |
|
| 72 | + ?> |
|
| 73 | 73 | <div class="error"> |
| 74 | 74 | <p> |
| 75 | 75 | <?php |
| 76 | - printf( |
|
| 77 | - esc_html__( |
|
| 78 | - 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
| 79 | - 'event_espresso' |
|
| 80 | - ), |
|
| 81 | - EE_MIN_PHP_VER_REQUIRED, |
|
| 82 | - PHP_VERSION, |
|
| 83 | - '<br/>', |
|
| 84 | - '<a href="https://www.php.net/downloads.php">https://php.net/downloads.php</a>' |
|
| 85 | - ); |
|
| 86 | - ?> |
|
| 76 | + printf( |
|
| 77 | + esc_html__( |
|
| 78 | + 'We\'re sorry, but Event Espresso requires PHP version %1$s or greater in order to operate. You are currently running version %2$s.%3$sIn order to update your version of PHP, you will need to contact your current hosting provider.%3$sFor information on stable PHP versions, please go to %4$s.', |
|
| 79 | + 'event_espresso' |
|
| 80 | + ), |
|
| 81 | + EE_MIN_PHP_VER_REQUIRED, |
|
| 82 | + PHP_VERSION, |
|
| 83 | + '<br/>', |
|
| 84 | + '<a href="https://www.php.net/downloads.php">https://php.net/downloads.php</a>' |
|
| 85 | + ); |
|
| 86 | + ?> |
|
| 87 | 87 | </p> |
| 88 | 88 | </div> |
| 89 | 89 | <?php |
| 90 | - espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 91 | - } |
|
| 90 | + espresso_deactivate_plugin(plugin_basename(__FILE__)); |
|
| 91 | + } |
|
| 92 | 92 | |
| 93 | - add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
| 94 | - } else { |
|
| 95 | - define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 93 | + add_action('admin_notices', 'espresso_minimum_php_version_error', 1); |
|
| 94 | + } else { |
|
| 95 | + define('EVENT_ESPRESSO_MAIN_FILE', __FILE__); |
|
| 96 | 96 | |
| 97 | - require_once __DIR__ . '/vendor/autoload.php'; |
|
| 97 | + require_once __DIR__ . '/vendor/autoload.php'; |
|
| 98 | 98 | |
| 99 | - /** |
|
| 100 | - * espresso_version |
|
| 101 | - * Returns the plugin version |
|
| 102 | - * |
|
| 103 | - * @return string |
|
| 104 | - */ |
|
| 105 | - function espresso_version(): string |
|
| 106 | - { |
|
| 107 | - return apply_filters('FHEE__espresso__espresso_version', '5.0.12.rc.000'); |
|
| 108 | - } |
|
| 99 | + /** |
|
| 100 | + * espresso_version |
|
| 101 | + * Returns the plugin version |
|
| 102 | + * |
|
| 103 | + * @return string |
|
| 104 | + */ |
|
| 105 | + function espresso_version(): string |
|
| 106 | + { |
|
| 107 | + return apply_filters('FHEE__espresso__espresso_version', '5.0.12.rc.000'); |
|
| 108 | + } |
|
| 109 | 109 | |
| 110 | - /** |
|
| 111 | - * espresso_plugin_activation |
|
| 112 | - * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
| 113 | - */ |
|
| 114 | - function espresso_plugin_activation() |
|
| 115 | - { |
|
| 116 | - update_option('ee_espresso_activation', true); |
|
| 117 | - update_option('event-espresso-core_allow_tracking', 'no'); |
|
| 118 | - update_option('event-espresso-core_tracking_notice', 'hide'); |
|
| 119 | - // Run WP GraphQL activation callback |
|
| 120 | - espressoLoadWpGraphQL(); |
|
| 121 | - graphql_activation_callback(); |
|
| 122 | - } |
|
| 110 | + /** |
|
| 111 | + * espresso_plugin_activation |
|
| 112 | + * adds a wp-option to indicate that EE has been activated via the WP admin plugins page |
|
| 113 | + */ |
|
| 114 | + function espresso_plugin_activation() |
|
| 115 | + { |
|
| 116 | + update_option('ee_espresso_activation', true); |
|
| 117 | + update_option('event-espresso-core_allow_tracking', 'no'); |
|
| 118 | + update_option('event-espresso-core_tracking_notice', 'hide'); |
|
| 119 | + // Run WP GraphQL activation callback |
|
| 120 | + espressoLoadWpGraphQL(); |
|
| 121 | + graphql_activation_callback(); |
|
| 122 | + } |
|
| 123 | 123 | |
| 124 | - register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 124 | + register_activation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_activation'); |
|
| 125 | 125 | |
| 126 | - /** |
|
| 127 | - * espresso_plugin_deactivation |
|
| 128 | - */ |
|
| 129 | - function espresso_plugin_deactivation() |
|
| 130 | - { |
|
| 131 | - // Run WP GraphQL deactivation callback |
|
| 132 | - espressoLoadWpGraphQL(); |
|
| 133 | - graphql_deactivation_callback(); |
|
| 134 | - delete_option('event-espresso-core_allow_tracking'); |
|
| 135 | - delete_option('event-espresso-core_tracking_notice'); |
|
| 136 | - } |
|
| 137 | - register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
| 126 | + /** |
|
| 127 | + * espresso_plugin_deactivation |
|
| 128 | + */ |
|
| 129 | + function espresso_plugin_deactivation() |
|
| 130 | + { |
|
| 131 | + // Run WP GraphQL deactivation callback |
|
| 132 | + espressoLoadWpGraphQL(); |
|
| 133 | + graphql_deactivation_callback(); |
|
| 134 | + delete_option('event-espresso-core_allow_tracking'); |
|
| 135 | + delete_option('event-espresso-core_tracking_notice'); |
|
| 136 | + } |
|
| 137 | + register_deactivation_hook(EVENT_ESPRESSO_MAIN_FILE, 'espresso_plugin_deactivation'); |
|
| 138 | 138 | |
| 139 | - require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
| 140 | - bootstrap_espresso(); |
|
| 141 | - } |
|
| 139 | + require_once __DIR__ . '/core/bootstrap_espresso.php'; |
|
| 140 | + bootstrap_espresso(); |
|
| 141 | + } |
|
| 142 | 142 | } |
| 143 | 143 | |
| 144 | 144 | if (! function_exists('espresso_deactivate_plugin')) { |
| 145 | - /** |
|
| 146 | - * deactivate_plugin |
|
| 147 | - * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
| 148 | - * |
|
| 149 | - * @access public |
|
| 150 | - * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
| 151 | - * @return void |
|
| 152 | - */ |
|
| 153 | - function espresso_deactivate_plugin(string $plugin_basename = '') |
|
| 154 | - { |
|
| 155 | - if (! function_exists('deactivate_plugins')) { |
|
| 156 | - require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
| 157 | - } |
|
| 158 | - unset($_GET['activate'], $_REQUEST['activate']); |
|
| 159 | - deactivate_plugins($plugin_basename); |
|
| 160 | - } |
|
| 145 | + /** |
|
| 146 | + * deactivate_plugin |
|
| 147 | + * usage: espresso_deactivate_plugin( plugin_basename( __FILE__ )); |
|
| 148 | + * |
|
| 149 | + * @access public |
|
| 150 | + * @param string $plugin_basename - the results of plugin_basename( __FILE__ ) for the plugin's main file |
|
| 151 | + * @return void |
|
| 152 | + */ |
|
| 153 | + function espresso_deactivate_plugin(string $plugin_basename = '') |
|
| 154 | + { |
|
| 155 | + if (! function_exists('deactivate_plugins')) { |
|
| 156 | + require_once ABSPATH . 'wp-admin/includes/plugin.php'; |
|
| 157 | + } |
|
| 158 | + unset($_GET['activate'], $_REQUEST['activate']); |
|
| 159 | + deactivate_plugins($plugin_basename); |
|
| 160 | + } |
|
| 161 | 161 | } |
| 162 | 162 | |
| 163 | 163 | |
| 164 | 164 | if (! function_exists('espressoLoadWpGraphQL')) { |
| 165 | - function espressoLoadWpGraphQL() |
|
| 166 | - { |
|
| 167 | - if ( |
|
| 168 | - ! class_exists('WPGraphQL') |
|
| 169 | - && is_readable(__DIR__ . '/vendor/wp-graphql/wp-graphql/wp-graphql.php') |
|
| 170 | - ) { |
|
| 171 | - require_once __DIR__ . '/vendor/wp-graphql/wp-graphql/wp-graphql.php'; |
|
| 172 | - } |
|
| 173 | - } |
|
| 165 | + function espressoLoadWpGraphQL() |
|
| 166 | + { |
|
| 167 | + if ( |
|
| 168 | + ! class_exists('WPGraphQL') |
|
| 169 | + && is_readable(__DIR__ . '/vendor/wp-graphql/wp-graphql/wp-graphql.php') |
|
| 170 | + ) { |
|
| 171 | + require_once __DIR__ . '/vendor/wp-graphql/wp-graphql/wp-graphql.php'; |
|
| 172 | + } |
|
| 173 | + } |
|
| 174 | 174 | } |
@@ -13,1265 +13,1265 @@ |
||
| 13 | 13 | */ |
| 14 | 14 | class EEH_MSG_Template |
| 15 | 15 | { |
| 16 | - /** |
|
| 17 | - * Holds a collection of EE_Message_Template_Pack objects. |
|
| 18 | - * @type EE_Messages_Template_Pack_Collection |
|
| 19 | - */ |
|
| 20 | - protected static $_template_pack_collection; |
|
| 21 | - |
|
| 22 | - |
|
| 23 | - /** |
|
| 24 | - * @throws EE_Error |
|
| 25 | - */ |
|
| 26 | - private static function _set_autoloader() |
|
| 27 | - { |
|
| 28 | - EED_Messages::set_autoloaders(); |
|
| 29 | - } |
|
| 30 | - |
|
| 31 | - |
|
| 32 | - /** |
|
| 33 | - * generate_new_templates |
|
| 34 | - * This will handle the messenger, message_type selection when "adding a new custom template" for an event and will |
|
| 35 | - * automatically create the defaults for the event. The user would then be redirected to edit the default context |
|
| 36 | - * for the event. |
|
| 37 | - * |
|
| 38 | - * @access protected |
|
| 39 | - * @param string $messenger the messenger we are generating templates for |
|
| 40 | - * @param array $message_types array of message types that the templates are generated for. |
|
| 41 | - * @param int $GRP_ID If a non global template is being generated then it is expected we'll have a GRP_ID |
|
| 42 | - * to use as the base for the new generated template. |
|
| 43 | - * @param bool $global true indicates generating templates on messenger activation. false requires GRP_ID |
|
| 44 | - * for event specific template generation. |
|
| 45 | - * @return array @see EEH_MSG_Template::_create_new_templates for the return value of each element in the array |
|
| 46 | - * for templates that are generated. If this is an empty array then it means no templates were |
|
| 47 | - * generated which usually means there was an error. Anything in the array with an empty value for |
|
| 48 | - * `MTP_context` means that it was not a new generated template but just reactivated (which only |
|
| 49 | - * happens for global templates that already exist in the database. |
|
| 50 | - * @throws EE_Error |
|
| 51 | - * @throws ReflectionException |
|
| 52 | - */ |
|
| 53 | - public static function generate_new_templates($messenger, $message_types, $GRP_ID = 0, $global = false) |
|
| 54 | - { |
|
| 55 | - // make sure message_type is an array. |
|
| 56 | - $message_types = (array) $message_types; |
|
| 57 | - $templates = array(); |
|
| 58 | - |
|
| 59 | - if (empty($messenger)) { |
|
| 60 | - throw new EE_Error(esc_html__('We need a messenger to generate templates!', 'event_espresso')); |
|
| 61 | - } |
|
| 62 | - |
|
| 63 | - // if we STILL have empty $message_types then we need to generate an error message b/c we NEED message types to do the template files. |
|
| 64 | - if (empty($message_types)) { |
|
| 65 | - throw new EE_Error(esc_html__('We need at least one message type to generate templates!', 'event_espresso')); |
|
| 66 | - } |
|
| 67 | - |
|
| 68 | - EEH_MSG_Template::_set_autoloader(); |
|
| 69 | - foreach ($message_types as $message_type) { |
|
| 70 | - |
|
| 71 | - // if this is global template generation. |
|
| 72 | - if ($global) { |
|
| 73 | - // let's attempt to get the GRP_ID for this combo IF GRP_ID is empty. |
|
| 74 | - if (empty($GRP_ID)) { |
|
| 75 | - $GRP_ID = EEM_Message_Template_Group::instance()->get_one( |
|
| 76 | - array( |
|
| 77 | - array( |
|
| 78 | - 'MTP_messenger' => $messenger, |
|
| 79 | - 'MTP_message_type' => $message_type, |
|
| 80 | - 'MTP_is_global' => true, |
|
| 81 | - ), |
|
| 82 | - ) |
|
| 83 | - ); |
|
| 84 | - $GRP_ID = $GRP_ID instanceof EE_Message_Template_Group ? $GRP_ID->ID() : 0; |
|
| 85 | - } |
|
| 86 | - // First let's determine if we already HAVE global templates for this messenger and message_type combination. |
|
| 87 | - // If we do then NO generation!! |
|
| 88 | - if (EEH_MSG_Template::already_generated($messenger, $message_type, $GRP_ID)) { |
|
| 89 | - $templates[] = array( |
|
| 90 | - 'GRP_ID' => $GRP_ID, |
|
| 91 | - 'MTP_context' => '', |
|
| 92 | - ); |
|
| 93 | - // we already have generated templates for this so let's go to the next message type. |
|
| 94 | - continue; |
|
| 95 | - } |
|
| 96 | - } |
|
| 97 | - $new_message_template_group = EEH_MSG_Template::create_new_templates( |
|
| 98 | - $messenger, |
|
| 99 | - $message_type, |
|
| 100 | - $GRP_ID, |
|
| 101 | - $global |
|
| 102 | - ); |
|
| 103 | - |
|
| 104 | - if (! $new_message_template_group) { |
|
| 105 | - continue; |
|
| 106 | - } |
|
| 107 | - $templates[] = $new_message_template_group; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - return $templates; |
|
| 111 | - } |
|
| 112 | - |
|
| 113 | - |
|
| 114 | - /** |
|
| 115 | - * The purpose of this method is to determine if there are already generated templates in the database for the |
|
| 116 | - * given variables. |
|
| 117 | - * |
|
| 118 | - * @param string $messenger messenger |
|
| 119 | - * @param string $message_type message type |
|
| 120 | - * @param int $GRP_ID GRP ID ( if a custom template) (if not provided then we're just doing global |
|
| 121 | - * template check) |
|
| 122 | - * @return bool true = generated, false = hasn't been generated. |
|
| 123 | - * @throws EE_Error |
|
| 124 | - */ |
|
| 125 | - public static function already_generated($messenger, $message_type, $GRP_ID = 0) |
|
| 126 | - { |
|
| 127 | - EEH_MSG_Template::_set_autoloader(); |
|
| 128 | - // what method we use depends on whether we have an GRP_ID or not |
|
| 129 | - $count = empty($GRP_ID) |
|
| 130 | - ? EEM_Message_Template::instance()->count( |
|
| 131 | - array( |
|
| 132 | - array( |
|
| 133 | - 'Message_Template_Group.MTP_messenger' => $messenger, |
|
| 134 | - 'Message_Template_Group.MTP_message_type' => $message_type, |
|
| 135 | - 'Message_Template_Group.MTP_is_global' => true |
|
| 136 | - ) |
|
| 137 | - ) |
|
| 138 | - ) |
|
| 139 | - : EEM_Message_Template::instance()->count(array( array( 'GRP_ID' => $GRP_ID ) )); |
|
| 140 | - |
|
| 141 | - return $count > 0; |
|
| 142 | - } |
|
| 143 | - |
|
| 144 | - |
|
| 145 | - /** |
|
| 146 | - * Updates all message templates matching the incoming messengers and message types to active status. |
|
| 147 | - * |
|
| 148 | - * @static |
|
| 149 | - * @param array $messenger_names Messenger slug |
|
| 150 | - * @param array $message_type_names Message type slug |
|
| 151 | - * @return int count of updated records. |
|
| 152 | - * @throws EE_Error |
|
| 153 | - */ |
|
| 154 | - public static function update_to_active($messenger_names, $message_type_names) |
|
| 155 | - { |
|
| 156 | - $messenger_names = is_array($messenger_names) ? $messenger_names : array( $messenger_names ); |
|
| 157 | - $message_type_names = is_array($message_type_names) ? $message_type_names : array( $message_type_names ); |
|
| 158 | - return EEM_Message_Template_Group::instance()->update( |
|
| 159 | - array( 'MTP_is_active' => 1 ), |
|
| 160 | - array( |
|
| 161 | - array( |
|
| 162 | - 'MTP_messenger' => array( 'IN', $messenger_names ), |
|
| 163 | - 'MTP_message_type' => array( 'IN', $message_type_names ) |
|
| 164 | - ) |
|
| 165 | - ) |
|
| 166 | - ); |
|
| 167 | - } |
|
| 168 | - |
|
| 169 | - |
|
| 170 | - /** |
|
| 171 | - * Updates all message template groups matching the incoming arguments to inactive status. |
|
| 172 | - * |
|
| 173 | - * @static |
|
| 174 | - * @param array $messenger_names The messenger slugs. |
|
| 175 | - * If empty then all templates matching the message types are marked inactive. |
|
| 176 | - * Otherwise only templates matching the messengers and message types. |
|
| 177 | - * @param array $message_type_names The message type slugs. |
|
| 178 | - * If empty then all templates matching the messengers are marked inactive. |
|
| 179 | - * Otherwise only templates matching the messengers and message types. |
|
| 180 | - * |
|
| 181 | - * @return int count of updated records. |
|
| 182 | - * @throws EE_Error |
|
| 183 | - */ |
|
| 184 | - public static function update_to_inactive($messenger_names = array(), $message_type_names = array()) |
|
| 185 | - { |
|
| 186 | - return EEM_Message_Template_Group::instance()->deactivate_message_template_groups_for( |
|
| 187 | - $messenger_names, |
|
| 188 | - $message_type_names |
|
| 189 | - ); |
|
| 190 | - } |
|
| 191 | - |
|
| 192 | - |
|
| 193 | - /** |
|
| 194 | - * The purpose of this function is to return all installed message objects |
|
| 195 | - * (messengers and message type regardless of whether they are ACTIVE or not) |
|
| 196 | - * |
|
| 197 | - * @param string $type |
|
| 198 | - * @return array array consisting of installed messenger objects and installed message type objects. |
|
| 199 | - * @throws EE_Error |
|
| 200 | - * @throws ReflectionException |
|
| 201 | - * @deprecated 4.9.0 |
|
| 202 | - * @static |
|
| 203 | - */ |
|
| 204 | - public static function get_installed_message_objects($type = 'all') |
|
| 205 | - { |
|
| 206 | - self::_set_autoloader(); |
|
| 207 | - $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 208 | - return array( |
|
| 209 | - 'messenger' => $message_resource_manager->installed_messengers(), |
|
| 210 | - 'message_type' => $message_resource_manager->installed_message_types() |
|
| 211 | - ); |
|
| 212 | - } |
|
| 213 | - |
|
| 214 | - |
|
| 215 | - /** |
|
| 216 | - * This will return an array of shortcodes => labels from the |
|
| 217 | - * messenger and message_type objects associated with this |
|
| 218 | - * template. |
|
| 219 | - * |
|
| 220 | - * @param string $message_type |
|
| 221 | - * @param string $messenger |
|
| 222 | - * @param array $fields What fields we're returning valid shortcodes for. |
|
| 223 | - * If empty then we assume all fields are to be returned. Optional. |
|
| 224 | - * @param string $context What context we're going to return shortcodes for. Optional. |
|
| 225 | - * @param bool $merged If TRUE then we don't return shortcodes indexed by field, |
|
| 226 | - * but instead an array of the unique shortcodes for all the given ( |
|
| 227 | - * or all) fields. Optional. |
|
| 228 | - * @return array an array of shortcodes in the format |
|
| 229 | - * array( '[shortcode] => 'label') |
|
| 230 | - * OR |
|
| 231 | - * FALSE if no shortcodes found. |
|
| 232 | - * @throws ReflectionException |
|
| 233 | - * @throws EE_Error*@since 4.3.0 |
|
| 234 | - * |
|
| 235 | - */ |
|
| 236 | - public static function get_shortcodes( |
|
| 237 | - $message_type, |
|
| 238 | - $messenger, |
|
| 239 | - $fields = array(), |
|
| 240 | - $context = 'admin', |
|
| 241 | - $merged = false |
|
| 242 | - ) { |
|
| 243 | - $messenger_name = str_replace(' ', '_', ucwords(str_replace('_', ' ', $messenger))); |
|
| 244 | - $mt_name = str_replace(' ', '_', ucwords(str_replace('_', ' ', $message_type))); |
|
| 245 | - /** @var EE_Message_Resource_Manager $message_resource_manager */ |
|
| 246 | - $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 247 | - // convert slug to object |
|
| 248 | - $messenger = $message_resource_manager->get_messenger($messenger); |
|
| 249 | - |
|
| 250 | - // if messenger isn't a EE_messenger resource then bail. |
|
| 251 | - if (! $messenger instanceof EE_messenger) { |
|
| 252 | - return array(); |
|
| 253 | - } |
|
| 254 | - |
|
| 255 | - // validate class for getting our list of shortcodes |
|
| 256 | - $classname = 'EE_Messages_' . $messenger_name . '_' . $mt_name . '_Validator'; |
|
| 257 | - if (! class_exists($classname)) { |
|
| 258 | - $msg[] = esc_html__('The Validator class was unable to load', 'event_espresso'); |
|
| 259 | - $msg[] = sprintf( |
|
| 260 | - esc_html__('The class name compiled was %s. Please check and make sure the spelling and case is correct for the class name and that there is an autoloader in place for this class', 'event_espresso'), |
|
| 261 | - $classname |
|
| 262 | - ); |
|
| 263 | - throw new EE_Error(implode('||', $msg)); |
|
| 264 | - } |
|
| 265 | - |
|
| 266 | - /** @type EE_Messages_Validator $_VLD */ |
|
| 267 | - $_VLD = new $classname(array(), $context); |
|
| 268 | - $valid_shortcodes = $_VLD->get_validators(); |
|
| 269 | - |
|
| 270 | - // let's make sure we're only getting the shortcode part of the validators |
|
| 271 | - $shortcodes = array(); |
|
| 272 | - foreach ($valid_shortcodes as $field => $validators) { |
|
| 273 | - $shortcodes[ $field ] = $validators['shortcodes']; |
|
| 274 | - } |
|
| 275 | - $valid_shortcodes = $shortcodes; |
|
| 276 | - |
|
| 277 | - // if not all fields let's make sure we ONLY include the shortcodes for the specified fields. |
|
| 278 | - if (! empty($fields)) { |
|
| 279 | - $specified_shortcodes = array(); |
|
| 280 | - foreach ($fields as $field) { |
|
| 281 | - if (isset($valid_shortcodes[ $field ])) { |
|
| 282 | - $specified_shortcodes[ $field ] = $valid_shortcodes[ $field ]; |
|
| 283 | - } |
|
| 284 | - } |
|
| 285 | - $valid_shortcodes = $specified_shortcodes; |
|
| 286 | - } |
|
| 287 | - |
|
| 288 | - // if not merged then let's replace the fields with the localized fields |
|
| 289 | - if (! $merged) { |
|
| 290 | - // let's get all the fields for the set messenger so that we can get the localized label and use that in the returned array. |
|
| 291 | - $field_settings = $messenger->get_template_fields(); |
|
| 292 | - $localized = array(); |
|
| 293 | - foreach ($valid_shortcodes as $field => $shortcodes) { |
|
| 294 | - // get localized field label |
|
| 295 | - if (isset($field_settings[ $field ])) { |
|
| 296 | - // possible that this is used as a main field. |
|
| 297 | - if (empty($field_settings[ $field ])) { |
|
| 298 | - if (isset($field_settings['extra'][ $field ])) { |
|
| 299 | - $_field = $field_settings['extra'][ $field ]['main']['label']; |
|
| 300 | - } else { |
|
| 301 | - $_field = $field; |
|
| 302 | - } |
|
| 303 | - } else { |
|
| 304 | - $_field = $field_settings[ $field ]['label']; |
|
| 305 | - } |
|
| 306 | - } elseif (isset($field_settings['extra'])) { |
|
| 307 | - // loop through extra "main fields" and see if any of their children have our field |
|
| 308 | - foreach ($field_settings['extra'] as $fields) { |
|
| 309 | - if (isset($fields[ $field ])) { |
|
| 310 | - $_field = $fields[ $field ]['label']; |
|
| 311 | - } else { |
|
| 312 | - $_field = $field; |
|
| 313 | - } |
|
| 314 | - } |
|
| 315 | - } else { |
|
| 316 | - $_field = $field; |
|
| 317 | - } |
|
| 318 | - if (isset($_field)) { |
|
| 319 | - $localized[ (string) $_field ] = $shortcodes; |
|
| 320 | - } |
|
| 321 | - } |
|
| 322 | - $valid_shortcodes = $localized; |
|
| 323 | - } |
|
| 324 | - |
|
| 325 | - // if $merged then let's merge all the shortcodes into one list NOT indexed by field. |
|
| 326 | - if ($merged) { |
|
| 327 | - $merged_codes = array(); |
|
| 328 | - foreach ($valid_shortcodes as $shortcode) { |
|
| 329 | - foreach ($shortcode as $code => $label) { |
|
| 330 | - if (isset($merged_codes[ $code ])) { |
|
| 331 | - continue; |
|
| 332 | - } else { |
|
| 333 | - $merged_codes[ $code ] = $label; |
|
| 334 | - } |
|
| 335 | - } |
|
| 336 | - } |
|
| 337 | - $valid_shortcodes = $merged_codes; |
|
| 338 | - } |
|
| 339 | - |
|
| 340 | - return $valid_shortcodes; |
|
| 341 | - } |
|
| 342 | - |
|
| 343 | - |
|
| 344 | - /** |
|
| 345 | - * Get Messenger object. |
|
| 346 | - * |
|
| 347 | - * @param string $messenger messenger slug for the messenger object we want to retrieve. |
|
| 348 | - * @return EE_messenger |
|
| 349 | - * @throws ReflectionException |
|
| 350 | - * @throws EE_Error*@since 4.3.0 |
|
| 351 | - * @deprecated 4.9.0 |
|
| 352 | - */ |
|
| 353 | - public static function messenger_obj($messenger) |
|
| 354 | - { |
|
| 355 | - /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 356 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 357 | - return $Message_Resource_Manager->get_messenger($messenger); |
|
| 358 | - } |
|
| 359 | - |
|
| 360 | - |
|
| 361 | - /** |
|
| 362 | - * get Message type object |
|
| 363 | - * |
|
| 364 | - * @param string $message_type the slug for the message type object to retrieve |
|
| 365 | - * @return EE_message_type |
|
| 366 | - * @throws ReflectionException |
|
| 367 | - * @throws EE_Error*@since 4.3.0 |
|
| 368 | - * @deprecated 4.9.0 |
|
| 369 | - */ |
|
| 370 | - public static function message_type_obj($message_type) |
|
| 371 | - { |
|
| 372 | - /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 373 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 374 | - return $Message_Resource_Manager->get_message_type($message_type); |
|
| 375 | - } |
|
| 376 | - |
|
| 377 | - |
|
| 378 | - /** |
|
| 379 | - * Given a message_type slug, will return whether that message type is active in the system or not. |
|
| 380 | - * |
|
| 381 | - * @since 4.3.0 |
|
| 382 | - * @param string $message_type message type to check for. |
|
| 383 | - * @return boolean |
|
| 384 | - * @throws EE_Error |
|
| 385 | - * @throws ReflectionException |
|
| 386 | - */ |
|
| 387 | - public static function is_mt_active($message_type) |
|
| 388 | - { |
|
| 389 | - /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 390 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 391 | - $active_mts = $Message_Resource_Manager->list_of_active_message_types(); |
|
| 392 | - return in_array($message_type, $active_mts); |
|
| 393 | - } |
|
| 394 | - |
|
| 395 | - |
|
| 396 | - /** |
|
| 397 | - * Given a messenger slug, will return whether that messenger is active in the system or not. |
|
| 398 | - * |
|
| 399 | - * @since 4.3.0 |
|
| 400 | - * |
|
| 401 | - * @param string $messenger slug for messenger to check. |
|
| 402 | - * @return boolean |
|
| 403 | - * @throws EE_Error |
|
| 404 | - * @throws ReflectionException |
|
| 405 | - */ |
|
| 406 | - public static function is_messenger_active($messenger) |
|
| 407 | - { |
|
| 408 | - /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 409 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 410 | - $active_messenger = $Message_Resource_Manager->get_active_messenger($messenger); |
|
| 411 | - return $active_messenger instanceof EE_messenger; |
|
| 412 | - } |
|
| 413 | - |
|
| 414 | - |
|
| 415 | - /** |
|
| 416 | - * Used to return active messengers array stored in the wp options table. |
|
| 417 | - * If no value is present in the option then an empty array is returned. |
|
| 418 | - * |
|
| 419 | - * @deprecated 4.9 |
|
| 420 | - * @since 4.3.1 |
|
| 421 | - * |
|
| 422 | - * @return array |
|
| 423 | - * @throws EE_Error |
|
| 424 | - * @throws ReflectionException |
|
| 425 | - */ |
|
| 426 | - public static function get_active_messengers_in_db() |
|
| 427 | - { |
|
| 428 | - EE_Error::doing_it_wrong( |
|
| 429 | - __METHOD__, |
|
| 430 | - esc_html__('Please use EE_Message_Resource_Manager::get_active_messengers_option() instead.', 'event_espresso'), |
|
| 431 | - '4.9.0' |
|
| 432 | - ); |
|
| 433 | - /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 434 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 435 | - return $Message_Resource_Manager->get_active_messengers_option(); |
|
| 436 | - } |
|
| 437 | - |
|
| 438 | - |
|
| 439 | - /** |
|
| 440 | - * Used to update the active messengers array stored in the wp options table. |
|
| 441 | - * |
|
| 442 | - * @since 4.3.1 |
|
| 443 | - * @deprecated 4.9.0 |
|
| 444 | - * |
|
| 445 | - * @param array $data_to_save Incoming data to save. |
|
| 446 | - * |
|
| 447 | - * @return bool FALSE if not updated, TRUE if updated. |
|
| 448 | - * @throws EE_Error |
|
| 449 | - * @throws ReflectionException |
|
| 450 | - */ |
|
| 451 | - public static function update_active_messengers_in_db($data_to_save) |
|
| 452 | - { |
|
| 453 | - EE_Error::doing_it_wrong( |
|
| 454 | - __METHOD__, |
|
| 455 | - esc_html__('Please use EE_Message_Resource_Manager::update_active_messengers_option() instead.', 'event_espresso'), |
|
| 456 | - '4.9.0' |
|
| 457 | - ); |
|
| 458 | - /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 459 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 460 | - return $Message_Resource_Manager->update_active_messengers_option($data_to_save); |
|
| 461 | - } |
|
| 462 | - |
|
| 463 | - |
|
| 464 | - /** |
|
| 465 | - * This does some validation of incoming params, determines what type of url is being prepped and returns the |
|
| 466 | - * appropriate url trigger |
|
| 467 | - * |
|
| 468 | - * @param EE_message_type $message_type |
|
| 469 | - * @param EE_Message $message |
|
| 470 | - * @param EE_Registration | null $registration The registration object must be included if this |
|
| 471 | - * is going to be a registration trigger url. |
|
| 472 | - * @param string $sending_messenger The (optional) sending messenger for the url. |
|
| 473 | - * |
|
| 474 | - * @return string |
|
| 475 | - * @throws EE_Error |
|
| 476 | - */ |
|
| 477 | - public static function get_url_trigger( |
|
| 478 | - EE_message_type $message_type, |
|
| 479 | - EE_Message $message, |
|
| 480 | - $registration = null, |
|
| 481 | - $sending_messenger = '' |
|
| 482 | - ) { |
|
| 483 | - // first determine if the url can be to the EE_Message object. |
|
| 484 | - if (! $message_type->always_generate()) { |
|
| 485 | - return EEH_MSG_Template::generate_browser_trigger($message); |
|
| 486 | - } |
|
| 487 | - |
|
| 488 | - // if $registration object is not valid then exit early because there's nothing that can be generated. |
|
| 489 | - if (! $registration instanceof EE_Registration) { |
|
| 490 | - throw new EE_Error( |
|
| 491 | - esc_html__('Incoming value for registration is not a valid EE_Registration object.', 'event_espresso') |
|
| 492 | - ); |
|
| 493 | - } |
|
| 494 | - |
|
| 495 | - // validate given context |
|
| 496 | - $contexts = $message_type->get_contexts(); |
|
| 497 | - if ($message->context() !== '' && ! isset($contexts[ $message->context() ])) { |
|
| 498 | - throw new EE_Error( |
|
| 499 | - sprintf( |
|
| 500 | - esc_html__('The context %s is not a valid context for %s.', 'event_espresso'), |
|
| 501 | - $message->context(), |
|
| 502 | - get_class($message_type) |
|
| 503 | - ) |
|
| 504 | - ); |
|
| 505 | - } |
|
| 506 | - |
|
| 507 | - // valid sending messenger but only if sending messenger set. Otherwise generating messenger is used. |
|
| 508 | - if (! empty($sending_messenger)) { |
|
| 509 | - $with_messengers = $message_type->with_messengers(); |
|
| 510 | - if ( |
|
| 511 | - ! isset($with_messengers[ $message->messenger() ]) |
|
| 512 | - || ! in_array($sending_messenger, $with_messengers[ $message->messenger() ]) |
|
| 513 | - ) { |
|
| 514 | - throw new EE_Error( |
|
| 515 | - sprintf( |
|
| 516 | - esc_html__( |
|
| 517 | - 'The given sending messenger string (%1$s) does not match a valid sending messenger with the %2$s. If this is incorrect, make sure that the message type has defined this messenger as a sending messenger in its $_with_messengers array.', |
|
| 518 | - 'event_espresso' |
|
| 519 | - ), |
|
| 520 | - $sending_messenger, |
|
| 521 | - get_class($message_type) |
|
| 522 | - ) |
|
| 523 | - ); |
|
| 524 | - } |
|
| 525 | - } else { |
|
| 526 | - $sending_messenger = $message->messenger(); |
|
| 527 | - } |
|
| 528 | - return EEH_MSG_Template::generate_url_trigger( |
|
| 529 | - $sending_messenger, |
|
| 530 | - $message->messenger(), |
|
| 531 | - $message->context(), |
|
| 532 | - $message->message_type(), |
|
| 533 | - $registration, |
|
| 534 | - $message->GRP_ID() |
|
| 535 | - ); |
|
| 536 | - } |
|
| 537 | - |
|
| 538 | - |
|
| 539 | - /** |
|
| 540 | - * This returns the url for triggering a in browser view of a specific EE_Message object. |
|
| 541 | - * @param EE_Message $message |
|
| 542 | - * @return string. |
|
| 543 | - */ |
|
| 544 | - public static function generate_browser_trigger(EE_Message $message) |
|
| 545 | - { |
|
| 546 | - $query_args = array( |
|
| 547 | - 'ee' => 'msg_browser_trigger', |
|
| 548 | - 'token' => $message->MSG_token() |
|
| 549 | - ); |
|
| 550 | - return apply_filters( |
|
| 551 | - 'FHEE__EEH_MSG_Template__generate_browser_trigger', |
|
| 552 | - add_query_arg($query_args, site_url()), |
|
| 553 | - $message |
|
| 554 | - ); |
|
| 555 | - } |
|
| 556 | - |
|
| 557 | - |
|
| 558 | - |
|
| 559 | - |
|
| 560 | - |
|
| 561 | - |
|
| 562 | - /** |
|
| 563 | - * This returns the url for triggering an in browser view of the error saved on the incoming message object. |
|
| 564 | - * @param EE_Message $message |
|
| 565 | - * @return string |
|
| 566 | - */ |
|
| 567 | - public static function generate_error_display_trigger(EE_Message $message) |
|
| 568 | - { |
|
| 569 | - return apply_filters( |
|
| 570 | - 'FHEE__EEH_MSG_Template__generate_error_display_trigger', |
|
| 571 | - add_query_arg( |
|
| 572 | - array( |
|
| 573 | - 'ee' => 'msg_browser_error_trigger', |
|
| 574 | - 'token' => $message->MSG_token() |
|
| 575 | - ), |
|
| 576 | - site_url() |
|
| 577 | - ), |
|
| 578 | - $message |
|
| 579 | - ); |
|
| 580 | - } |
|
| 581 | - |
|
| 582 | - |
|
| 583 | - /** |
|
| 584 | - * This generates a url trigger for the msg_url_trigger route using the given arguments |
|
| 585 | - * |
|
| 586 | - * @param string $sending_messenger The sending messenger slug. |
|
| 587 | - * @param string $generating_messenger The generating messenger slug. |
|
| 588 | - * @param string $context The context for the template. |
|
| 589 | - * @param string $message_type The message type slug |
|
| 590 | - * @param EE_Registration $registration |
|
| 591 | - * @param integer $message_template_group id The EE_Message_Template_Group ID for the template. |
|
| 592 | - * @param integer $data_id The id to the EE_Base_Class for getting the data used by the |
|
| 593 | - * trigger. |
|
| 594 | - * @return string The generated url. |
|
| 595 | - * @throws EE_Error |
|
| 596 | - */ |
|
| 597 | - public static function generate_url_trigger( |
|
| 598 | - $sending_messenger, |
|
| 599 | - $generating_messenger, |
|
| 600 | - $context, |
|
| 601 | - $message_type, |
|
| 602 | - EE_Registration $registration, |
|
| 603 | - $message_template_group, |
|
| 604 | - $data_id = 0 |
|
| 605 | - ) { |
|
| 606 | - $query_args = array( |
|
| 607 | - 'ee' => 'msg_url_trigger', |
|
| 608 | - 'snd_msgr' => $sending_messenger, |
|
| 609 | - 'gen_msgr' => $generating_messenger, |
|
| 610 | - 'message_type' => $message_type, |
|
| 611 | - 'context' => $context, |
|
| 612 | - 'token' => $registration->reg_url_link(), |
|
| 613 | - 'GRP_ID' => $message_template_group, |
|
| 614 | - 'id' => $data_id |
|
| 615 | - ); |
|
| 616 | - $url = add_query_arg($query_args, get_home_url()); |
|
| 617 | - |
|
| 618 | - // made it here so now we can just get the url and filter it. Filtered globally and by message type. |
|
| 619 | - return apply_filters( |
|
| 620 | - 'FHEE__EEH_MSG_Template__generate_url_trigger', |
|
| 621 | - $url, |
|
| 622 | - $sending_messenger, |
|
| 623 | - $generating_messenger, |
|
| 624 | - $context, |
|
| 625 | - $message_type, |
|
| 626 | - $registration, |
|
| 627 | - $message_template_group, |
|
| 628 | - $data_id |
|
| 629 | - ); |
|
| 630 | - } |
|
| 631 | - |
|
| 632 | - |
|
| 633 | - |
|
| 634 | - |
|
| 635 | - /** |
|
| 636 | - * Return the specific css for the action icon given. |
|
| 637 | - * |
|
| 638 | - * @param string $type What action to return. |
|
| 639 | - * @return string[] |
|
| 640 | - * @since 4.9.0 |
|
| 641 | - */ |
|
| 642 | - public static function get_message_action_icon($type) |
|
| 643 | - { |
|
| 644 | - $action_icons = self::get_message_action_icons(); |
|
| 645 | - return isset($action_icons[ $type ]) ? $action_icons[ $type ] : []; |
|
| 646 | - } |
|
| 647 | - |
|
| 648 | - |
|
| 649 | - /** |
|
| 650 | - * This is used for retrieving the css classes used for the icons representing message actions. |
|
| 651 | - * |
|
| 652 | - * @since 4.9.0 |
|
| 653 | - * |
|
| 654 | - * @return array |
|
| 655 | - */ |
|
| 656 | - public static function get_message_action_icons() |
|
| 657 | - { |
|
| 658 | - return apply_filters( |
|
| 659 | - 'FHEE__EEH_MSG_Template__message_action_icons', |
|
| 660 | - array( |
|
| 661 | - 'view' => array( |
|
| 662 | - 'label' => esc_html__('View Message', 'event_espresso'), |
|
| 663 | - 'css_class' => 'dashicons dashicons-visibility', |
|
| 664 | - ), |
|
| 665 | - 'error' => array( |
|
| 666 | - 'label' => esc_html__('View Error Message', 'event_espresso'), |
|
| 667 | - 'css_class' => 'dashicons dashicons-info', |
|
| 668 | - ), |
|
| 669 | - 'see_notifications_for' => array( |
|
| 670 | - 'label' => esc_html__('View Related Messages', 'event_espresso'), |
|
| 671 | - 'css_class' => 'dashicons dashicons-megaphone', |
|
| 672 | - ), |
|
| 673 | - 'generate_now' => array( |
|
| 674 | - 'label' => esc_html__('Generate the message now.', 'event_espresso'), |
|
| 675 | - 'css_class' => 'dashicons dashicons-admin-tools', |
|
| 676 | - ), |
|
| 677 | - 'send_now' => array( |
|
| 678 | - 'label' => esc_html__('Send Immediately', 'event_espresso'), |
|
| 679 | - 'css_class' => 'dashicons dashicons-controls-forward', |
|
| 680 | - ), |
|
| 681 | - 'queue_for_resending' => array( |
|
| 682 | - 'label' => esc_html__('Queue for Resending', 'event_espresso'), |
|
| 683 | - 'css_class' => 'dashicons dashicons-controls-repeat', |
|
| 684 | - ), |
|
| 685 | - 'view_transaction' => array( |
|
| 686 | - 'label' => esc_html__('View related Transaction', 'event_espresso'), |
|
| 687 | - 'css_class' => 'dashicons dashicons-cart', |
|
| 688 | - ) |
|
| 689 | - ) |
|
| 690 | - ); |
|
| 691 | - } |
|
| 692 | - |
|
| 693 | - |
|
| 694 | - /** |
|
| 695 | - * This returns the url for a given action related to EE_Message. |
|
| 696 | - * |
|
| 697 | - * @param string $type What type of action to return the url for. |
|
| 698 | - * @param EE_Message $message Required for generating the correct url for some types. |
|
| 699 | - * @param array $query_params Any additional query params to be included with the generated url. |
|
| 700 | - * |
|
| 701 | - * @return string |
|
| 702 | - * @throws EE_Error |
|
| 703 | - * @throws ReflectionException |
|
| 704 | - * @since 4.9.0 |
|
| 705 | - * |
|
| 706 | - */ |
|
| 707 | - public static function get_message_action_url($type, EE_Message $message = null, $query_params = array()) |
|
| 708 | - { |
|
| 709 | - $action_urls = self::get_message_action_urls($message, $query_params); |
|
| 710 | - return isset($action_urls[ $type ]) ? $action_urls[ $type ] : ''; |
|
| 711 | - } |
|
| 712 | - |
|
| 713 | - |
|
| 714 | - /** |
|
| 715 | - * This returns all the current urls for EE_Message actions. |
|
| 716 | - * |
|
| 717 | - * @since 4.9.0 |
|
| 718 | - * |
|
| 719 | - * @param EE_Message $message The EE_Message object required to generate correct urls for some types. |
|
| 720 | - * @param array $query_params Any additional query_params to be included with the generated url. |
|
| 721 | - * |
|
| 722 | - * @return array |
|
| 723 | - * @throws EE_Error |
|
| 724 | - * @throws ReflectionException |
|
| 725 | - */ |
|
| 726 | - public static function get_message_action_urls(EE_Message $message = null, $query_params = array()) |
|
| 727 | - { |
|
| 728 | - EE_Registry::instance()->load_helper('URL'); |
|
| 729 | - // if $message is not an instance of EE_Message then let's just do a dummy. |
|
| 730 | - $message = empty($message) ? EE_Message_Factory::create() : $message; |
|
| 731 | - $action_urls = apply_filters( |
|
| 732 | - 'FHEE__EEH_MSG_Template__get_message_action_url', |
|
| 733 | - array( |
|
| 734 | - 'view' => EEH_MSG_Template::generate_browser_trigger($message), |
|
| 735 | - 'error' => EEH_MSG_Template::generate_error_display_trigger($message), |
|
| 736 | - 'see_notifications_for' => EEH_URL::add_query_args_and_nonce( |
|
| 737 | - array_merge( |
|
| 738 | - array( |
|
| 739 | - 'page' => 'espresso_messages', |
|
| 740 | - 'action' => 'default', |
|
| 741 | - 'filterby' => 1, |
|
| 742 | - ), |
|
| 743 | - $query_params |
|
| 744 | - ), |
|
| 745 | - admin_url('admin.php') |
|
| 746 | - ), |
|
| 747 | - 'generate_now' => EEH_URL::add_query_args_and_nonce( |
|
| 748 | - array( |
|
| 749 | - 'page' => 'espresso_messages', |
|
| 750 | - 'action' => 'generate_now', |
|
| 751 | - 'MSG_ID' => $message->ID() |
|
| 752 | - ), |
|
| 753 | - admin_url('admin.php') |
|
| 754 | - ), |
|
| 755 | - 'send_now' => EEH_URL::add_query_args_and_nonce( |
|
| 756 | - array( |
|
| 757 | - 'page' => 'espresso_messages', |
|
| 758 | - 'action' => 'send_now', |
|
| 759 | - 'MSG_ID' => $message->ID() |
|
| 760 | - ), |
|
| 761 | - admin_url('admin.php') |
|
| 762 | - ), |
|
| 763 | - 'queue_for_resending' => EEH_URL::add_query_args_and_nonce( |
|
| 764 | - array( |
|
| 765 | - 'page' => 'espresso_messages', |
|
| 766 | - 'action' => 'queue_for_resending', |
|
| 767 | - 'MSG_ID' => $message->ID() |
|
| 768 | - ), |
|
| 769 | - admin_url('admin.php') |
|
| 770 | - ), |
|
| 771 | - ) |
|
| 772 | - ); |
|
| 773 | - if ( |
|
| 774 | - $message->TXN_ID() > 0 |
|
| 775 | - && EE_Registry::instance()->CAP->current_user_can( |
|
| 776 | - 'ee_read_transaction', |
|
| 777 | - 'espresso_transactions_default', |
|
| 778 | - $message->TXN_ID() |
|
| 779 | - ) |
|
| 780 | - ) { |
|
| 781 | - $action_urls['view_transaction'] = EEH_URL::add_query_args_and_nonce( |
|
| 782 | - array( |
|
| 783 | - 'page' => 'espresso_transactions', |
|
| 784 | - 'action' => 'view_transaction', |
|
| 785 | - 'TXN_ID' => $message->TXN_ID() |
|
| 786 | - ), |
|
| 787 | - admin_url('admin.php') |
|
| 788 | - ); |
|
| 789 | - } else { |
|
| 790 | - $action_urls['view_transaction'] = ''; |
|
| 791 | - } |
|
| 792 | - return $action_urls; |
|
| 793 | - } |
|
| 794 | - |
|
| 795 | - |
|
| 796 | - /** |
|
| 797 | - * This returns a generated link html including the icon used for the action link for EE_Message actions. |
|
| 798 | - * |
|
| 799 | - * @param string $type What type of action the link is for (if invalid type is passed in then an |
|
| 800 | - * empty string is returned) |
|
| 801 | - * @param EE_Message|null $message The EE_Message object (required for some actions to generate correctly) |
|
| 802 | - * @param array $query_params Any extra query params to include in the generated link. |
|
| 803 | - * |
|
| 804 | - * @return string |
|
| 805 | - * @throws EE_Error |
|
| 806 | - * @throws ReflectionException |
|
| 807 | - * @since 4.9.0 |
|
| 808 | - * |
|
| 809 | - */ |
|
| 810 | - public static function get_message_action_link($type, EE_Message $message = null, $query_params = array()) |
|
| 811 | - { |
|
| 812 | - $url = EEH_MSG_Template::get_message_action_url($type, $message, $query_params); |
|
| 813 | - $icon_css = EEH_MSG_Template::get_message_action_icon($type); |
|
| 814 | - $label = $icon_css['label'] ?? null; |
|
| 815 | - $label = $label ? 'aria-label="' . $label . '"' : ''; |
|
| 816 | - $class = $label ? ' ee-aria-tooltip' : ''; |
|
| 817 | - |
|
| 818 | - if (empty($url) || empty($icon_css) || ! isset($icon_css['css_class'])) { |
|
| 819 | - return ''; |
|
| 820 | - } |
|
| 821 | - |
|
| 822 | - $icon_css_class = $icon_css['css_class'] . apply_filters( |
|
| 823 | - 'FHEE__EEH_MSG_Template__get_message_action_link__icon_css_class', |
|
| 824 | - ' js-ee-message-action-link ee-message-action-link-' . $type, |
|
| 825 | - $type, |
|
| 826 | - $message, |
|
| 827 | - $query_params |
|
| 828 | - ); |
|
| 829 | - |
|
| 830 | - return ' |
|
| 16 | + /** |
|
| 17 | + * Holds a collection of EE_Message_Template_Pack objects. |
|
| 18 | + * @type EE_Messages_Template_Pack_Collection |
|
| 19 | + */ |
|
| 20 | + protected static $_template_pack_collection; |
|
| 21 | + |
|
| 22 | + |
|
| 23 | + /** |
|
| 24 | + * @throws EE_Error |
|
| 25 | + */ |
|
| 26 | + private static function _set_autoloader() |
|
| 27 | + { |
|
| 28 | + EED_Messages::set_autoloaders(); |
|
| 29 | + } |
|
| 30 | + |
|
| 31 | + |
|
| 32 | + /** |
|
| 33 | + * generate_new_templates |
|
| 34 | + * This will handle the messenger, message_type selection when "adding a new custom template" for an event and will |
|
| 35 | + * automatically create the defaults for the event. The user would then be redirected to edit the default context |
|
| 36 | + * for the event. |
|
| 37 | + * |
|
| 38 | + * @access protected |
|
| 39 | + * @param string $messenger the messenger we are generating templates for |
|
| 40 | + * @param array $message_types array of message types that the templates are generated for. |
|
| 41 | + * @param int $GRP_ID If a non global template is being generated then it is expected we'll have a GRP_ID |
|
| 42 | + * to use as the base for the new generated template. |
|
| 43 | + * @param bool $global true indicates generating templates on messenger activation. false requires GRP_ID |
|
| 44 | + * for event specific template generation. |
|
| 45 | + * @return array @see EEH_MSG_Template::_create_new_templates for the return value of each element in the array |
|
| 46 | + * for templates that are generated. If this is an empty array then it means no templates were |
|
| 47 | + * generated which usually means there was an error. Anything in the array with an empty value for |
|
| 48 | + * `MTP_context` means that it was not a new generated template but just reactivated (which only |
|
| 49 | + * happens for global templates that already exist in the database. |
|
| 50 | + * @throws EE_Error |
|
| 51 | + * @throws ReflectionException |
|
| 52 | + */ |
|
| 53 | + public static function generate_new_templates($messenger, $message_types, $GRP_ID = 0, $global = false) |
|
| 54 | + { |
|
| 55 | + // make sure message_type is an array. |
|
| 56 | + $message_types = (array) $message_types; |
|
| 57 | + $templates = array(); |
|
| 58 | + |
|
| 59 | + if (empty($messenger)) { |
|
| 60 | + throw new EE_Error(esc_html__('We need a messenger to generate templates!', 'event_espresso')); |
|
| 61 | + } |
|
| 62 | + |
|
| 63 | + // if we STILL have empty $message_types then we need to generate an error message b/c we NEED message types to do the template files. |
|
| 64 | + if (empty($message_types)) { |
|
| 65 | + throw new EE_Error(esc_html__('We need at least one message type to generate templates!', 'event_espresso')); |
|
| 66 | + } |
|
| 67 | + |
|
| 68 | + EEH_MSG_Template::_set_autoloader(); |
|
| 69 | + foreach ($message_types as $message_type) { |
|
| 70 | + |
|
| 71 | + // if this is global template generation. |
|
| 72 | + if ($global) { |
|
| 73 | + // let's attempt to get the GRP_ID for this combo IF GRP_ID is empty. |
|
| 74 | + if (empty($GRP_ID)) { |
|
| 75 | + $GRP_ID = EEM_Message_Template_Group::instance()->get_one( |
|
| 76 | + array( |
|
| 77 | + array( |
|
| 78 | + 'MTP_messenger' => $messenger, |
|
| 79 | + 'MTP_message_type' => $message_type, |
|
| 80 | + 'MTP_is_global' => true, |
|
| 81 | + ), |
|
| 82 | + ) |
|
| 83 | + ); |
|
| 84 | + $GRP_ID = $GRP_ID instanceof EE_Message_Template_Group ? $GRP_ID->ID() : 0; |
|
| 85 | + } |
|
| 86 | + // First let's determine if we already HAVE global templates for this messenger and message_type combination. |
|
| 87 | + // If we do then NO generation!! |
|
| 88 | + if (EEH_MSG_Template::already_generated($messenger, $message_type, $GRP_ID)) { |
|
| 89 | + $templates[] = array( |
|
| 90 | + 'GRP_ID' => $GRP_ID, |
|
| 91 | + 'MTP_context' => '', |
|
| 92 | + ); |
|
| 93 | + // we already have generated templates for this so let's go to the next message type. |
|
| 94 | + continue; |
|
| 95 | + } |
|
| 96 | + } |
|
| 97 | + $new_message_template_group = EEH_MSG_Template::create_new_templates( |
|
| 98 | + $messenger, |
|
| 99 | + $message_type, |
|
| 100 | + $GRP_ID, |
|
| 101 | + $global |
|
| 102 | + ); |
|
| 103 | + |
|
| 104 | + if (! $new_message_template_group) { |
|
| 105 | + continue; |
|
| 106 | + } |
|
| 107 | + $templates[] = $new_message_template_group; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + return $templates; |
|
| 111 | + } |
|
| 112 | + |
|
| 113 | + |
|
| 114 | + /** |
|
| 115 | + * The purpose of this method is to determine if there are already generated templates in the database for the |
|
| 116 | + * given variables. |
|
| 117 | + * |
|
| 118 | + * @param string $messenger messenger |
|
| 119 | + * @param string $message_type message type |
|
| 120 | + * @param int $GRP_ID GRP ID ( if a custom template) (if not provided then we're just doing global |
|
| 121 | + * template check) |
|
| 122 | + * @return bool true = generated, false = hasn't been generated. |
|
| 123 | + * @throws EE_Error |
|
| 124 | + */ |
|
| 125 | + public static function already_generated($messenger, $message_type, $GRP_ID = 0) |
|
| 126 | + { |
|
| 127 | + EEH_MSG_Template::_set_autoloader(); |
|
| 128 | + // what method we use depends on whether we have an GRP_ID or not |
|
| 129 | + $count = empty($GRP_ID) |
|
| 130 | + ? EEM_Message_Template::instance()->count( |
|
| 131 | + array( |
|
| 132 | + array( |
|
| 133 | + 'Message_Template_Group.MTP_messenger' => $messenger, |
|
| 134 | + 'Message_Template_Group.MTP_message_type' => $message_type, |
|
| 135 | + 'Message_Template_Group.MTP_is_global' => true |
|
| 136 | + ) |
|
| 137 | + ) |
|
| 138 | + ) |
|
| 139 | + : EEM_Message_Template::instance()->count(array( array( 'GRP_ID' => $GRP_ID ) )); |
|
| 140 | + |
|
| 141 | + return $count > 0; |
|
| 142 | + } |
|
| 143 | + |
|
| 144 | + |
|
| 145 | + /** |
|
| 146 | + * Updates all message templates matching the incoming messengers and message types to active status. |
|
| 147 | + * |
|
| 148 | + * @static |
|
| 149 | + * @param array $messenger_names Messenger slug |
|
| 150 | + * @param array $message_type_names Message type slug |
|
| 151 | + * @return int count of updated records. |
|
| 152 | + * @throws EE_Error |
|
| 153 | + */ |
|
| 154 | + public static function update_to_active($messenger_names, $message_type_names) |
|
| 155 | + { |
|
| 156 | + $messenger_names = is_array($messenger_names) ? $messenger_names : array( $messenger_names ); |
|
| 157 | + $message_type_names = is_array($message_type_names) ? $message_type_names : array( $message_type_names ); |
|
| 158 | + return EEM_Message_Template_Group::instance()->update( |
|
| 159 | + array( 'MTP_is_active' => 1 ), |
|
| 160 | + array( |
|
| 161 | + array( |
|
| 162 | + 'MTP_messenger' => array( 'IN', $messenger_names ), |
|
| 163 | + 'MTP_message_type' => array( 'IN', $message_type_names ) |
|
| 164 | + ) |
|
| 165 | + ) |
|
| 166 | + ); |
|
| 167 | + } |
|
| 168 | + |
|
| 169 | + |
|
| 170 | + /** |
|
| 171 | + * Updates all message template groups matching the incoming arguments to inactive status. |
|
| 172 | + * |
|
| 173 | + * @static |
|
| 174 | + * @param array $messenger_names The messenger slugs. |
|
| 175 | + * If empty then all templates matching the message types are marked inactive. |
|
| 176 | + * Otherwise only templates matching the messengers and message types. |
|
| 177 | + * @param array $message_type_names The message type slugs. |
|
| 178 | + * If empty then all templates matching the messengers are marked inactive. |
|
| 179 | + * Otherwise only templates matching the messengers and message types. |
|
| 180 | + * |
|
| 181 | + * @return int count of updated records. |
|
| 182 | + * @throws EE_Error |
|
| 183 | + */ |
|
| 184 | + public static function update_to_inactive($messenger_names = array(), $message_type_names = array()) |
|
| 185 | + { |
|
| 186 | + return EEM_Message_Template_Group::instance()->deactivate_message_template_groups_for( |
|
| 187 | + $messenger_names, |
|
| 188 | + $message_type_names |
|
| 189 | + ); |
|
| 190 | + } |
|
| 191 | + |
|
| 192 | + |
|
| 193 | + /** |
|
| 194 | + * The purpose of this function is to return all installed message objects |
|
| 195 | + * (messengers and message type regardless of whether they are ACTIVE or not) |
|
| 196 | + * |
|
| 197 | + * @param string $type |
|
| 198 | + * @return array array consisting of installed messenger objects and installed message type objects. |
|
| 199 | + * @throws EE_Error |
|
| 200 | + * @throws ReflectionException |
|
| 201 | + * @deprecated 4.9.0 |
|
| 202 | + * @static |
|
| 203 | + */ |
|
| 204 | + public static function get_installed_message_objects($type = 'all') |
|
| 205 | + { |
|
| 206 | + self::_set_autoloader(); |
|
| 207 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 208 | + return array( |
|
| 209 | + 'messenger' => $message_resource_manager->installed_messengers(), |
|
| 210 | + 'message_type' => $message_resource_manager->installed_message_types() |
|
| 211 | + ); |
|
| 212 | + } |
|
| 213 | + |
|
| 214 | + |
|
| 215 | + /** |
|
| 216 | + * This will return an array of shortcodes => labels from the |
|
| 217 | + * messenger and message_type objects associated with this |
|
| 218 | + * template. |
|
| 219 | + * |
|
| 220 | + * @param string $message_type |
|
| 221 | + * @param string $messenger |
|
| 222 | + * @param array $fields What fields we're returning valid shortcodes for. |
|
| 223 | + * If empty then we assume all fields are to be returned. Optional. |
|
| 224 | + * @param string $context What context we're going to return shortcodes for. Optional. |
|
| 225 | + * @param bool $merged If TRUE then we don't return shortcodes indexed by field, |
|
| 226 | + * but instead an array of the unique shortcodes for all the given ( |
|
| 227 | + * or all) fields. Optional. |
|
| 228 | + * @return array an array of shortcodes in the format |
|
| 229 | + * array( '[shortcode] => 'label') |
|
| 230 | + * OR |
|
| 231 | + * FALSE if no shortcodes found. |
|
| 232 | + * @throws ReflectionException |
|
| 233 | + * @throws EE_Error*@since 4.3.0 |
|
| 234 | + * |
|
| 235 | + */ |
|
| 236 | + public static function get_shortcodes( |
|
| 237 | + $message_type, |
|
| 238 | + $messenger, |
|
| 239 | + $fields = array(), |
|
| 240 | + $context = 'admin', |
|
| 241 | + $merged = false |
|
| 242 | + ) { |
|
| 243 | + $messenger_name = str_replace(' ', '_', ucwords(str_replace('_', ' ', $messenger))); |
|
| 244 | + $mt_name = str_replace(' ', '_', ucwords(str_replace('_', ' ', $message_type))); |
|
| 245 | + /** @var EE_Message_Resource_Manager $message_resource_manager */ |
|
| 246 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 247 | + // convert slug to object |
|
| 248 | + $messenger = $message_resource_manager->get_messenger($messenger); |
|
| 249 | + |
|
| 250 | + // if messenger isn't a EE_messenger resource then bail. |
|
| 251 | + if (! $messenger instanceof EE_messenger) { |
|
| 252 | + return array(); |
|
| 253 | + } |
|
| 254 | + |
|
| 255 | + // validate class for getting our list of shortcodes |
|
| 256 | + $classname = 'EE_Messages_' . $messenger_name . '_' . $mt_name . '_Validator'; |
|
| 257 | + if (! class_exists($classname)) { |
|
| 258 | + $msg[] = esc_html__('The Validator class was unable to load', 'event_espresso'); |
|
| 259 | + $msg[] = sprintf( |
|
| 260 | + esc_html__('The class name compiled was %s. Please check and make sure the spelling and case is correct for the class name and that there is an autoloader in place for this class', 'event_espresso'), |
|
| 261 | + $classname |
|
| 262 | + ); |
|
| 263 | + throw new EE_Error(implode('||', $msg)); |
|
| 264 | + } |
|
| 265 | + |
|
| 266 | + /** @type EE_Messages_Validator $_VLD */ |
|
| 267 | + $_VLD = new $classname(array(), $context); |
|
| 268 | + $valid_shortcodes = $_VLD->get_validators(); |
|
| 269 | + |
|
| 270 | + // let's make sure we're only getting the shortcode part of the validators |
|
| 271 | + $shortcodes = array(); |
|
| 272 | + foreach ($valid_shortcodes as $field => $validators) { |
|
| 273 | + $shortcodes[ $field ] = $validators['shortcodes']; |
|
| 274 | + } |
|
| 275 | + $valid_shortcodes = $shortcodes; |
|
| 276 | + |
|
| 277 | + // if not all fields let's make sure we ONLY include the shortcodes for the specified fields. |
|
| 278 | + if (! empty($fields)) { |
|
| 279 | + $specified_shortcodes = array(); |
|
| 280 | + foreach ($fields as $field) { |
|
| 281 | + if (isset($valid_shortcodes[ $field ])) { |
|
| 282 | + $specified_shortcodes[ $field ] = $valid_shortcodes[ $field ]; |
|
| 283 | + } |
|
| 284 | + } |
|
| 285 | + $valid_shortcodes = $specified_shortcodes; |
|
| 286 | + } |
|
| 287 | + |
|
| 288 | + // if not merged then let's replace the fields with the localized fields |
|
| 289 | + if (! $merged) { |
|
| 290 | + // let's get all the fields for the set messenger so that we can get the localized label and use that in the returned array. |
|
| 291 | + $field_settings = $messenger->get_template_fields(); |
|
| 292 | + $localized = array(); |
|
| 293 | + foreach ($valid_shortcodes as $field => $shortcodes) { |
|
| 294 | + // get localized field label |
|
| 295 | + if (isset($field_settings[ $field ])) { |
|
| 296 | + // possible that this is used as a main field. |
|
| 297 | + if (empty($field_settings[ $field ])) { |
|
| 298 | + if (isset($field_settings['extra'][ $field ])) { |
|
| 299 | + $_field = $field_settings['extra'][ $field ]['main']['label']; |
|
| 300 | + } else { |
|
| 301 | + $_field = $field; |
|
| 302 | + } |
|
| 303 | + } else { |
|
| 304 | + $_field = $field_settings[ $field ]['label']; |
|
| 305 | + } |
|
| 306 | + } elseif (isset($field_settings['extra'])) { |
|
| 307 | + // loop through extra "main fields" and see if any of their children have our field |
|
| 308 | + foreach ($field_settings['extra'] as $fields) { |
|
| 309 | + if (isset($fields[ $field ])) { |
|
| 310 | + $_field = $fields[ $field ]['label']; |
|
| 311 | + } else { |
|
| 312 | + $_field = $field; |
|
| 313 | + } |
|
| 314 | + } |
|
| 315 | + } else { |
|
| 316 | + $_field = $field; |
|
| 317 | + } |
|
| 318 | + if (isset($_field)) { |
|
| 319 | + $localized[ (string) $_field ] = $shortcodes; |
|
| 320 | + } |
|
| 321 | + } |
|
| 322 | + $valid_shortcodes = $localized; |
|
| 323 | + } |
|
| 324 | + |
|
| 325 | + // if $merged then let's merge all the shortcodes into one list NOT indexed by field. |
|
| 326 | + if ($merged) { |
|
| 327 | + $merged_codes = array(); |
|
| 328 | + foreach ($valid_shortcodes as $shortcode) { |
|
| 329 | + foreach ($shortcode as $code => $label) { |
|
| 330 | + if (isset($merged_codes[ $code ])) { |
|
| 331 | + continue; |
|
| 332 | + } else { |
|
| 333 | + $merged_codes[ $code ] = $label; |
|
| 334 | + } |
|
| 335 | + } |
|
| 336 | + } |
|
| 337 | + $valid_shortcodes = $merged_codes; |
|
| 338 | + } |
|
| 339 | + |
|
| 340 | + return $valid_shortcodes; |
|
| 341 | + } |
|
| 342 | + |
|
| 343 | + |
|
| 344 | + /** |
|
| 345 | + * Get Messenger object. |
|
| 346 | + * |
|
| 347 | + * @param string $messenger messenger slug for the messenger object we want to retrieve. |
|
| 348 | + * @return EE_messenger |
|
| 349 | + * @throws ReflectionException |
|
| 350 | + * @throws EE_Error*@since 4.3.0 |
|
| 351 | + * @deprecated 4.9.0 |
|
| 352 | + */ |
|
| 353 | + public static function messenger_obj($messenger) |
|
| 354 | + { |
|
| 355 | + /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 356 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 357 | + return $Message_Resource_Manager->get_messenger($messenger); |
|
| 358 | + } |
|
| 359 | + |
|
| 360 | + |
|
| 361 | + /** |
|
| 362 | + * get Message type object |
|
| 363 | + * |
|
| 364 | + * @param string $message_type the slug for the message type object to retrieve |
|
| 365 | + * @return EE_message_type |
|
| 366 | + * @throws ReflectionException |
|
| 367 | + * @throws EE_Error*@since 4.3.0 |
|
| 368 | + * @deprecated 4.9.0 |
|
| 369 | + */ |
|
| 370 | + public static function message_type_obj($message_type) |
|
| 371 | + { |
|
| 372 | + /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 373 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 374 | + return $Message_Resource_Manager->get_message_type($message_type); |
|
| 375 | + } |
|
| 376 | + |
|
| 377 | + |
|
| 378 | + /** |
|
| 379 | + * Given a message_type slug, will return whether that message type is active in the system or not. |
|
| 380 | + * |
|
| 381 | + * @since 4.3.0 |
|
| 382 | + * @param string $message_type message type to check for. |
|
| 383 | + * @return boolean |
|
| 384 | + * @throws EE_Error |
|
| 385 | + * @throws ReflectionException |
|
| 386 | + */ |
|
| 387 | + public static function is_mt_active($message_type) |
|
| 388 | + { |
|
| 389 | + /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 390 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 391 | + $active_mts = $Message_Resource_Manager->list_of_active_message_types(); |
|
| 392 | + return in_array($message_type, $active_mts); |
|
| 393 | + } |
|
| 394 | + |
|
| 395 | + |
|
| 396 | + /** |
|
| 397 | + * Given a messenger slug, will return whether that messenger is active in the system or not. |
|
| 398 | + * |
|
| 399 | + * @since 4.3.0 |
|
| 400 | + * |
|
| 401 | + * @param string $messenger slug for messenger to check. |
|
| 402 | + * @return boolean |
|
| 403 | + * @throws EE_Error |
|
| 404 | + * @throws ReflectionException |
|
| 405 | + */ |
|
| 406 | + public static function is_messenger_active($messenger) |
|
| 407 | + { |
|
| 408 | + /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 409 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 410 | + $active_messenger = $Message_Resource_Manager->get_active_messenger($messenger); |
|
| 411 | + return $active_messenger instanceof EE_messenger; |
|
| 412 | + } |
|
| 413 | + |
|
| 414 | + |
|
| 415 | + /** |
|
| 416 | + * Used to return active messengers array stored in the wp options table. |
|
| 417 | + * If no value is present in the option then an empty array is returned. |
|
| 418 | + * |
|
| 419 | + * @deprecated 4.9 |
|
| 420 | + * @since 4.3.1 |
|
| 421 | + * |
|
| 422 | + * @return array |
|
| 423 | + * @throws EE_Error |
|
| 424 | + * @throws ReflectionException |
|
| 425 | + */ |
|
| 426 | + public static function get_active_messengers_in_db() |
|
| 427 | + { |
|
| 428 | + EE_Error::doing_it_wrong( |
|
| 429 | + __METHOD__, |
|
| 430 | + esc_html__('Please use EE_Message_Resource_Manager::get_active_messengers_option() instead.', 'event_espresso'), |
|
| 431 | + '4.9.0' |
|
| 432 | + ); |
|
| 433 | + /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 434 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 435 | + return $Message_Resource_Manager->get_active_messengers_option(); |
|
| 436 | + } |
|
| 437 | + |
|
| 438 | + |
|
| 439 | + /** |
|
| 440 | + * Used to update the active messengers array stored in the wp options table. |
|
| 441 | + * |
|
| 442 | + * @since 4.3.1 |
|
| 443 | + * @deprecated 4.9.0 |
|
| 444 | + * |
|
| 445 | + * @param array $data_to_save Incoming data to save. |
|
| 446 | + * |
|
| 447 | + * @return bool FALSE if not updated, TRUE if updated. |
|
| 448 | + * @throws EE_Error |
|
| 449 | + * @throws ReflectionException |
|
| 450 | + */ |
|
| 451 | + public static function update_active_messengers_in_db($data_to_save) |
|
| 452 | + { |
|
| 453 | + EE_Error::doing_it_wrong( |
|
| 454 | + __METHOD__, |
|
| 455 | + esc_html__('Please use EE_Message_Resource_Manager::update_active_messengers_option() instead.', 'event_espresso'), |
|
| 456 | + '4.9.0' |
|
| 457 | + ); |
|
| 458 | + /** @var EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 459 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 460 | + return $Message_Resource_Manager->update_active_messengers_option($data_to_save); |
|
| 461 | + } |
|
| 462 | + |
|
| 463 | + |
|
| 464 | + /** |
|
| 465 | + * This does some validation of incoming params, determines what type of url is being prepped and returns the |
|
| 466 | + * appropriate url trigger |
|
| 467 | + * |
|
| 468 | + * @param EE_message_type $message_type |
|
| 469 | + * @param EE_Message $message |
|
| 470 | + * @param EE_Registration | null $registration The registration object must be included if this |
|
| 471 | + * is going to be a registration trigger url. |
|
| 472 | + * @param string $sending_messenger The (optional) sending messenger for the url. |
|
| 473 | + * |
|
| 474 | + * @return string |
|
| 475 | + * @throws EE_Error |
|
| 476 | + */ |
|
| 477 | + public static function get_url_trigger( |
|
| 478 | + EE_message_type $message_type, |
|
| 479 | + EE_Message $message, |
|
| 480 | + $registration = null, |
|
| 481 | + $sending_messenger = '' |
|
| 482 | + ) { |
|
| 483 | + // first determine if the url can be to the EE_Message object. |
|
| 484 | + if (! $message_type->always_generate()) { |
|
| 485 | + return EEH_MSG_Template::generate_browser_trigger($message); |
|
| 486 | + } |
|
| 487 | + |
|
| 488 | + // if $registration object is not valid then exit early because there's nothing that can be generated. |
|
| 489 | + if (! $registration instanceof EE_Registration) { |
|
| 490 | + throw new EE_Error( |
|
| 491 | + esc_html__('Incoming value for registration is not a valid EE_Registration object.', 'event_espresso') |
|
| 492 | + ); |
|
| 493 | + } |
|
| 494 | + |
|
| 495 | + // validate given context |
|
| 496 | + $contexts = $message_type->get_contexts(); |
|
| 497 | + if ($message->context() !== '' && ! isset($contexts[ $message->context() ])) { |
|
| 498 | + throw new EE_Error( |
|
| 499 | + sprintf( |
|
| 500 | + esc_html__('The context %s is not a valid context for %s.', 'event_espresso'), |
|
| 501 | + $message->context(), |
|
| 502 | + get_class($message_type) |
|
| 503 | + ) |
|
| 504 | + ); |
|
| 505 | + } |
|
| 506 | + |
|
| 507 | + // valid sending messenger but only if sending messenger set. Otherwise generating messenger is used. |
|
| 508 | + if (! empty($sending_messenger)) { |
|
| 509 | + $with_messengers = $message_type->with_messengers(); |
|
| 510 | + if ( |
|
| 511 | + ! isset($with_messengers[ $message->messenger() ]) |
|
| 512 | + || ! in_array($sending_messenger, $with_messengers[ $message->messenger() ]) |
|
| 513 | + ) { |
|
| 514 | + throw new EE_Error( |
|
| 515 | + sprintf( |
|
| 516 | + esc_html__( |
|
| 517 | + 'The given sending messenger string (%1$s) does not match a valid sending messenger with the %2$s. If this is incorrect, make sure that the message type has defined this messenger as a sending messenger in its $_with_messengers array.', |
|
| 518 | + 'event_espresso' |
|
| 519 | + ), |
|
| 520 | + $sending_messenger, |
|
| 521 | + get_class($message_type) |
|
| 522 | + ) |
|
| 523 | + ); |
|
| 524 | + } |
|
| 525 | + } else { |
|
| 526 | + $sending_messenger = $message->messenger(); |
|
| 527 | + } |
|
| 528 | + return EEH_MSG_Template::generate_url_trigger( |
|
| 529 | + $sending_messenger, |
|
| 530 | + $message->messenger(), |
|
| 531 | + $message->context(), |
|
| 532 | + $message->message_type(), |
|
| 533 | + $registration, |
|
| 534 | + $message->GRP_ID() |
|
| 535 | + ); |
|
| 536 | + } |
|
| 537 | + |
|
| 538 | + |
|
| 539 | + /** |
|
| 540 | + * This returns the url for triggering a in browser view of a specific EE_Message object. |
|
| 541 | + * @param EE_Message $message |
|
| 542 | + * @return string. |
|
| 543 | + */ |
|
| 544 | + public static function generate_browser_trigger(EE_Message $message) |
|
| 545 | + { |
|
| 546 | + $query_args = array( |
|
| 547 | + 'ee' => 'msg_browser_trigger', |
|
| 548 | + 'token' => $message->MSG_token() |
|
| 549 | + ); |
|
| 550 | + return apply_filters( |
|
| 551 | + 'FHEE__EEH_MSG_Template__generate_browser_trigger', |
|
| 552 | + add_query_arg($query_args, site_url()), |
|
| 553 | + $message |
|
| 554 | + ); |
|
| 555 | + } |
|
| 556 | + |
|
| 557 | + |
|
| 558 | + |
|
| 559 | + |
|
| 560 | + |
|
| 561 | + |
|
| 562 | + /** |
|
| 563 | + * This returns the url for triggering an in browser view of the error saved on the incoming message object. |
|
| 564 | + * @param EE_Message $message |
|
| 565 | + * @return string |
|
| 566 | + */ |
|
| 567 | + public static function generate_error_display_trigger(EE_Message $message) |
|
| 568 | + { |
|
| 569 | + return apply_filters( |
|
| 570 | + 'FHEE__EEH_MSG_Template__generate_error_display_trigger', |
|
| 571 | + add_query_arg( |
|
| 572 | + array( |
|
| 573 | + 'ee' => 'msg_browser_error_trigger', |
|
| 574 | + 'token' => $message->MSG_token() |
|
| 575 | + ), |
|
| 576 | + site_url() |
|
| 577 | + ), |
|
| 578 | + $message |
|
| 579 | + ); |
|
| 580 | + } |
|
| 581 | + |
|
| 582 | + |
|
| 583 | + /** |
|
| 584 | + * This generates a url trigger for the msg_url_trigger route using the given arguments |
|
| 585 | + * |
|
| 586 | + * @param string $sending_messenger The sending messenger slug. |
|
| 587 | + * @param string $generating_messenger The generating messenger slug. |
|
| 588 | + * @param string $context The context for the template. |
|
| 589 | + * @param string $message_type The message type slug |
|
| 590 | + * @param EE_Registration $registration |
|
| 591 | + * @param integer $message_template_group id The EE_Message_Template_Group ID for the template. |
|
| 592 | + * @param integer $data_id The id to the EE_Base_Class for getting the data used by the |
|
| 593 | + * trigger. |
|
| 594 | + * @return string The generated url. |
|
| 595 | + * @throws EE_Error |
|
| 596 | + */ |
|
| 597 | + public static function generate_url_trigger( |
|
| 598 | + $sending_messenger, |
|
| 599 | + $generating_messenger, |
|
| 600 | + $context, |
|
| 601 | + $message_type, |
|
| 602 | + EE_Registration $registration, |
|
| 603 | + $message_template_group, |
|
| 604 | + $data_id = 0 |
|
| 605 | + ) { |
|
| 606 | + $query_args = array( |
|
| 607 | + 'ee' => 'msg_url_trigger', |
|
| 608 | + 'snd_msgr' => $sending_messenger, |
|
| 609 | + 'gen_msgr' => $generating_messenger, |
|
| 610 | + 'message_type' => $message_type, |
|
| 611 | + 'context' => $context, |
|
| 612 | + 'token' => $registration->reg_url_link(), |
|
| 613 | + 'GRP_ID' => $message_template_group, |
|
| 614 | + 'id' => $data_id |
|
| 615 | + ); |
|
| 616 | + $url = add_query_arg($query_args, get_home_url()); |
|
| 617 | + |
|
| 618 | + // made it here so now we can just get the url and filter it. Filtered globally and by message type. |
|
| 619 | + return apply_filters( |
|
| 620 | + 'FHEE__EEH_MSG_Template__generate_url_trigger', |
|
| 621 | + $url, |
|
| 622 | + $sending_messenger, |
|
| 623 | + $generating_messenger, |
|
| 624 | + $context, |
|
| 625 | + $message_type, |
|
| 626 | + $registration, |
|
| 627 | + $message_template_group, |
|
| 628 | + $data_id |
|
| 629 | + ); |
|
| 630 | + } |
|
| 631 | + |
|
| 632 | + |
|
| 633 | + |
|
| 634 | + |
|
| 635 | + /** |
|
| 636 | + * Return the specific css for the action icon given. |
|
| 637 | + * |
|
| 638 | + * @param string $type What action to return. |
|
| 639 | + * @return string[] |
|
| 640 | + * @since 4.9.0 |
|
| 641 | + */ |
|
| 642 | + public static function get_message_action_icon($type) |
|
| 643 | + { |
|
| 644 | + $action_icons = self::get_message_action_icons(); |
|
| 645 | + return isset($action_icons[ $type ]) ? $action_icons[ $type ] : []; |
|
| 646 | + } |
|
| 647 | + |
|
| 648 | + |
|
| 649 | + /** |
|
| 650 | + * This is used for retrieving the css classes used for the icons representing message actions. |
|
| 651 | + * |
|
| 652 | + * @since 4.9.0 |
|
| 653 | + * |
|
| 654 | + * @return array |
|
| 655 | + */ |
|
| 656 | + public static function get_message_action_icons() |
|
| 657 | + { |
|
| 658 | + return apply_filters( |
|
| 659 | + 'FHEE__EEH_MSG_Template__message_action_icons', |
|
| 660 | + array( |
|
| 661 | + 'view' => array( |
|
| 662 | + 'label' => esc_html__('View Message', 'event_espresso'), |
|
| 663 | + 'css_class' => 'dashicons dashicons-visibility', |
|
| 664 | + ), |
|
| 665 | + 'error' => array( |
|
| 666 | + 'label' => esc_html__('View Error Message', 'event_espresso'), |
|
| 667 | + 'css_class' => 'dashicons dashicons-info', |
|
| 668 | + ), |
|
| 669 | + 'see_notifications_for' => array( |
|
| 670 | + 'label' => esc_html__('View Related Messages', 'event_espresso'), |
|
| 671 | + 'css_class' => 'dashicons dashicons-megaphone', |
|
| 672 | + ), |
|
| 673 | + 'generate_now' => array( |
|
| 674 | + 'label' => esc_html__('Generate the message now.', 'event_espresso'), |
|
| 675 | + 'css_class' => 'dashicons dashicons-admin-tools', |
|
| 676 | + ), |
|
| 677 | + 'send_now' => array( |
|
| 678 | + 'label' => esc_html__('Send Immediately', 'event_espresso'), |
|
| 679 | + 'css_class' => 'dashicons dashicons-controls-forward', |
|
| 680 | + ), |
|
| 681 | + 'queue_for_resending' => array( |
|
| 682 | + 'label' => esc_html__('Queue for Resending', 'event_espresso'), |
|
| 683 | + 'css_class' => 'dashicons dashicons-controls-repeat', |
|
| 684 | + ), |
|
| 685 | + 'view_transaction' => array( |
|
| 686 | + 'label' => esc_html__('View related Transaction', 'event_espresso'), |
|
| 687 | + 'css_class' => 'dashicons dashicons-cart', |
|
| 688 | + ) |
|
| 689 | + ) |
|
| 690 | + ); |
|
| 691 | + } |
|
| 692 | + |
|
| 693 | + |
|
| 694 | + /** |
|
| 695 | + * This returns the url for a given action related to EE_Message. |
|
| 696 | + * |
|
| 697 | + * @param string $type What type of action to return the url for. |
|
| 698 | + * @param EE_Message $message Required for generating the correct url for some types. |
|
| 699 | + * @param array $query_params Any additional query params to be included with the generated url. |
|
| 700 | + * |
|
| 701 | + * @return string |
|
| 702 | + * @throws EE_Error |
|
| 703 | + * @throws ReflectionException |
|
| 704 | + * @since 4.9.0 |
|
| 705 | + * |
|
| 706 | + */ |
|
| 707 | + public static function get_message_action_url($type, EE_Message $message = null, $query_params = array()) |
|
| 708 | + { |
|
| 709 | + $action_urls = self::get_message_action_urls($message, $query_params); |
|
| 710 | + return isset($action_urls[ $type ]) ? $action_urls[ $type ] : ''; |
|
| 711 | + } |
|
| 712 | + |
|
| 713 | + |
|
| 714 | + /** |
|
| 715 | + * This returns all the current urls for EE_Message actions. |
|
| 716 | + * |
|
| 717 | + * @since 4.9.0 |
|
| 718 | + * |
|
| 719 | + * @param EE_Message $message The EE_Message object required to generate correct urls for some types. |
|
| 720 | + * @param array $query_params Any additional query_params to be included with the generated url. |
|
| 721 | + * |
|
| 722 | + * @return array |
|
| 723 | + * @throws EE_Error |
|
| 724 | + * @throws ReflectionException |
|
| 725 | + */ |
|
| 726 | + public static function get_message_action_urls(EE_Message $message = null, $query_params = array()) |
|
| 727 | + { |
|
| 728 | + EE_Registry::instance()->load_helper('URL'); |
|
| 729 | + // if $message is not an instance of EE_Message then let's just do a dummy. |
|
| 730 | + $message = empty($message) ? EE_Message_Factory::create() : $message; |
|
| 731 | + $action_urls = apply_filters( |
|
| 732 | + 'FHEE__EEH_MSG_Template__get_message_action_url', |
|
| 733 | + array( |
|
| 734 | + 'view' => EEH_MSG_Template::generate_browser_trigger($message), |
|
| 735 | + 'error' => EEH_MSG_Template::generate_error_display_trigger($message), |
|
| 736 | + 'see_notifications_for' => EEH_URL::add_query_args_and_nonce( |
|
| 737 | + array_merge( |
|
| 738 | + array( |
|
| 739 | + 'page' => 'espresso_messages', |
|
| 740 | + 'action' => 'default', |
|
| 741 | + 'filterby' => 1, |
|
| 742 | + ), |
|
| 743 | + $query_params |
|
| 744 | + ), |
|
| 745 | + admin_url('admin.php') |
|
| 746 | + ), |
|
| 747 | + 'generate_now' => EEH_URL::add_query_args_and_nonce( |
|
| 748 | + array( |
|
| 749 | + 'page' => 'espresso_messages', |
|
| 750 | + 'action' => 'generate_now', |
|
| 751 | + 'MSG_ID' => $message->ID() |
|
| 752 | + ), |
|
| 753 | + admin_url('admin.php') |
|
| 754 | + ), |
|
| 755 | + 'send_now' => EEH_URL::add_query_args_and_nonce( |
|
| 756 | + array( |
|
| 757 | + 'page' => 'espresso_messages', |
|
| 758 | + 'action' => 'send_now', |
|
| 759 | + 'MSG_ID' => $message->ID() |
|
| 760 | + ), |
|
| 761 | + admin_url('admin.php') |
|
| 762 | + ), |
|
| 763 | + 'queue_for_resending' => EEH_URL::add_query_args_and_nonce( |
|
| 764 | + array( |
|
| 765 | + 'page' => 'espresso_messages', |
|
| 766 | + 'action' => 'queue_for_resending', |
|
| 767 | + 'MSG_ID' => $message->ID() |
|
| 768 | + ), |
|
| 769 | + admin_url('admin.php') |
|
| 770 | + ), |
|
| 771 | + ) |
|
| 772 | + ); |
|
| 773 | + if ( |
|
| 774 | + $message->TXN_ID() > 0 |
|
| 775 | + && EE_Registry::instance()->CAP->current_user_can( |
|
| 776 | + 'ee_read_transaction', |
|
| 777 | + 'espresso_transactions_default', |
|
| 778 | + $message->TXN_ID() |
|
| 779 | + ) |
|
| 780 | + ) { |
|
| 781 | + $action_urls['view_transaction'] = EEH_URL::add_query_args_and_nonce( |
|
| 782 | + array( |
|
| 783 | + 'page' => 'espresso_transactions', |
|
| 784 | + 'action' => 'view_transaction', |
|
| 785 | + 'TXN_ID' => $message->TXN_ID() |
|
| 786 | + ), |
|
| 787 | + admin_url('admin.php') |
|
| 788 | + ); |
|
| 789 | + } else { |
|
| 790 | + $action_urls['view_transaction'] = ''; |
|
| 791 | + } |
|
| 792 | + return $action_urls; |
|
| 793 | + } |
|
| 794 | + |
|
| 795 | + |
|
| 796 | + /** |
|
| 797 | + * This returns a generated link html including the icon used for the action link for EE_Message actions. |
|
| 798 | + * |
|
| 799 | + * @param string $type What type of action the link is for (if invalid type is passed in then an |
|
| 800 | + * empty string is returned) |
|
| 801 | + * @param EE_Message|null $message The EE_Message object (required for some actions to generate correctly) |
|
| 802 | + * @param array $query_params Any extra query params to include in the generated link. |
|
| 803 | + * |
|
| 804 | + * @return string |
|
| 805 | + * @throws EE_Error |
|
| 806 | + * @throws ReflectionException |
|
| 807 | + * @since 4.9.0 |
|
| 808 | + * |
|
| 809 | + */ |
|
| 810 | + public static function get_message_action_link($type, EE_Message $message = null, $query_params = array()) |
|
| 811 | + { |
|
| 812 | + $url = EEH_MSG_Template::get_message_action_url($type, $message, $query_params); |
|
| 813 | + $icon_css = EEH_MSG_Template::get_message_action_icon($type); |
|
| 814 | + $label = $icon_css['label'] ?? null; |
|
| 815 | + $label = $label ? 'aria-label="' . $label . '"' : ''; |
|
| 816 | + $class = $label ? ' ee-aria-tooltip' : ''; |
|
| 817 | + |
|
| 818 | + if (empty($url) || empty($icon_css) || ! isset($icon_css['css_class'])) { |
|
| 819 | + return ''; |
|
| 820 | + } |
|
| 821 | + |
|
| 822 | + $icon_css_class = $icon_css['css_class'] . apply_filters( |
|
| 823 | + 'FHEE__EEH_MSG_Template__get_message_action_link__icon_css_class', |
|
| 824 | + ' js-ee-message-action-link ee-message-action-link-' . $type, |
|
| 825 | + $type, |
|
| 826 | + $message, |
|
| 827 | + $query_params |
|
| 828 | + ); |
|
| 829 | + |
|
| 830 | + return ' |
|
| 831 | 831 | <a href="' . $url . '" ' . $label . ' class="button button--icon-only' . $class . '"> |
| 832 | 832 | <span class="' . esc_attr($icon_css_class) . '"></span> |
| 833 | 833 | </a>'; |
| 834 | - } |
|
| 835 | - |
|
| 836 | - |
|
| 837 | - |
|
| 838 | - |
|
| 839 | - |
|
| 840 | - /** |
|
| 841 | - * This returns an array with keys as reg statuses and values as the corresponding message type slug (filtered). |
|
| 842 | - * |
|
| 843 | - * @since 4.9.0 |
|
| 844 | - * @return array |
|
| 845 | - */ |
|
| 846 | - public static function reg_status_to_message_type_array() |
|
| 847 | - { |
|
| 848 | - return (array) apply_filters( |
|
| 849 | - 'FHEE__EEH_MSG_Template__reg_status_to_message_type_array', |
|
| 850 | - array( |
|
| 851 | - EEM_Registration::status_id_approved => 'registration', |
|
| 852 | - EEM_Registration::status_id_pending_payment => 'pending_approval', |
|
| 853 | - EEM_Registration::status_id_not_approved => 'not_approved_registration', |
|
| 854 | - EEM_Registration::status_id_cancelled => 'cancelled_registration', |
|
| 855 | - EEM_Registration::status_id_declined => 'declined_registration' |
|
| 856 | - ) |
|
| 857 | - ); |
|
| 858 | - } |
|
| 859 | - |
|
| 860 | - |
|
| 861 | - |
|
| 862 | - |
|
| 863 | - /** |
|
| 864 | - * This returns the corresponding registration message type slug to the given reg status. If there isn't a |
|
| 865 | - * match, then returns an empty string. |
|
| 866 | - * |
|
| 867 | - * @since 4.9.0 |
|
| 868 | - * @param $reg_status |
|
| 869 | - * @return string |
|
| 870 | - */ |
|
| 871 | - public static function convert_reg_status_to_message_type($reg_status) |
|
| 872 | - { |
|
| 873 | - $reg_status_array = self::reg_status_to_message_type_array(); |
|
| 874 | - return isset($reg_status_array[ $reg_status ]) ? $reg_status_array[ $reg_status ] : ''; |
|
| 875 | - } |
|
| 876 | - |
|
| 877 | - |
|
| 878 | - /** |
|
| 879 | - * This returns an array with keys as payment stati and values as the corresponding message type slug (filtered). |
|
| 880 | - * |
|
| 881 | - * @since 4.9.0 |
|
| 882 | - * @return array |
|
| 883 | - */ |
|
| 884 | - public static function payment_status_to_message_type_array() |
|
| 885 | - { |
|
| 886 | - return (array) apply_filters( |
|
| 887 | - 'FHEE__EEH_MSG_Template__payment_status_to_message_type_array', |
|
| 888 | - array( |
|
| 889 | - EEM_Payment::status_id_approved => 'payment', |
|
| 890 | - EEM_Payment::status_id_pending => 'payment_pending', |
|
| 891 | - EEM_Payment::status_id_cancelled => 'payment_cancelled', |
|
| 892 | - EEM_Payment::status_id_declined => 'payment_declined', |
|
| 893 | - EEM_Payment::status_id_failed => 'payment_failed' |
|
| 894 | - ) |
|
| 895 | - ); |
|
| 896 | - } |
|
| 897 | - |
|
| 898 | - |
|
| 899 | - |
|
| 900 | - |
|
| 901 | - /** |
|
| 902 | - * This returns the corresponding payment message type slug to the given payment status. If there isn't a match then |
|
| 903 | - * an empty string is returned |
|
| 904 | - * |
|
| 905 | - * @since 4.9.0 |
|
| 906 | - * @param $payment_status |
|
| 907 | - * @return string |
|
| 908 | - */ |
|
| 909 | - public static function convert_payment_status_to_message_type($payment_status) |
|
| 910 | - { |
|
| 911 | - $payment_status_array = self::payment_status_to_message_type_array(); |
|
| 912 | - return isset($payment_status_array[ $payment_status ]) ? $payment_status_array[ $payment_status ] : ''; |
|
| 913 | - } |
|
| 914 | - |
|
| 915 | - |
|
| 916 | - /** |
|
| 917 | - * This is used to retrieve the template pack for the given name. |
|
| 918 | - * |
|
| 919 | - * @param string $template_pack_name should match the set `dbref` property value on the EE_Messages_Template_Pack. |
|
| 920 | - * |
|
| 921 | - * @return EE_Messages_Template_Pack |
|
| 922 | - */ |
|
| 923 | - public static function get_template_pack($template_pack_name) |
|
| 924 | - { |
|
| 925 | - if (! self::$_template_pack_collection instanceof EE_Object_Collection) { |
|
| 926 | - self::$_template_pack_collection = new EE_Messages_Template_Pack_Collection(); |
|
| 927 | - } |
|
| 928 | - |
|
| 929 | - // first see if in collection already |
|
| 930 | - $template_pack = self::$_template_pack_collection->get_by_name($template_pack_name); |
|
| 931 | - |
|
| 932 | - if ($template_pack instanceof EE_Messages_Template_Pack) { |
|
| 933 | - return $template_pack; |
|
| 934 | - } |
|
| 935 | - |
|
| 936 | - // nope...let's get it. |
|
| 937 | - // not set yet so let's attempt to get it. |
|
| 938 | - $pack_class_name = 'EE_Messages_Template_Pack_' . str_replace( |
|
| 939 | - ' ', |
|
| 940 | - '_', |
|
| 941 | - ucwords( |
|
| 942 | - str_replace('_', ' ', $template_pack_name) |
|
| 943 | - ) |
|
| 944 | - ); |
|
| 945 | - if (! class_exists($pack_class_name) && $template_pack_name !== 'default') { |
|
| 946 | - return self::get_template_pack('default'); |
|
| 947 | - } else { |
|
| 948 | - $template_pack = new $pack_class_name(); |
|
| 949 | - self::$_template_pack_collection->add($template_pack); |
|
| 950 | - return $template_pack; |
|
| 951 | - } |
|
| 952 | - } |
|
| 953 | - |
|
| 954 | - |
|
| 955 | - |
|
| 956 | - |
|
| 957 | - /** |
|
| 958 | - * Globs template packs installed in core and returns the template pack collection with all installed template packs |
|
| 959 | - * in it. |
|
| 960 | - * |
|
| 961 | - * @since 4.9.0 |
|
| 962 | - * |
|
| 963 | - * @return EE_Messages_Template_Pack_Collection |
|
| 964 | - */ |
|
| 965 | - public static function get_template_pack_collection() |
|
| 966 | - { |
|
| 967 | - $new_collection = false; |
|
| 968 | - if (! self::$_template_pack_collection instanceof EE_Messages_Template_Pack_Collection) { |
|
| 969 | - self::$_template_pack_collection = new EE_Messages_Template_Pack_Collection(); |
|
| 970 | - $new_collection = true; |
|
| 971 | - } |
|
| 972 | - |
|
| 973 | - // glob the defaults directory for messages |
|
| 974 | - $templates = glob(EE_LIBRARIES . 'messages/defaults/*', GLOB_ONLYDIR); |
|
| 975 | - foreach ($templates as $template_path) { |
|
| 976 | - // grab folder name |
|
| 977 | - $template = basename($template_path); |
|
| 978 | - |
|
| 979 | - if (! $new_collection) { |
|
| 980 | - // already have it? |
|
| 981 | - if (self::$_template_pack_collection->get_by_name($template) instanceof EE_Messages_Template_Pack) { |
|
| 982 | - continue; |
|
| 983 | - } |
|
| 984 | - } |
|
| 985 | - |
|
| 986 | - // setup classname. |
|
| 987 | - $template_pack_class_name = 'EE_Messages_Template_Pack_' . str_replace( |
|
| 988 | - ' ', |
|
| 989 | - '_', |
|
| 990 | - ucwords( |
|
| 991 | - str_replace( |
|
| 992 | - '_', |
|
| 993 | - ' ', |
|
| 994 | - $template |
|
| 995 | - ) |
|
| 996 | - ) |
|
| 997 | - ); |
|
| 998 | - if (! class_exists($template_pack_class_name)) { |
|
| 999 | - continue; |
|
| 1000 | - } |
|
| 1001 | - self::$_template_pack_collection->add(new $template_pack_class_name()); |
|
| 1002 | - } |
|
| 1003 | - |
|
| 1004 | - /** |
|
| 1005 | - * Filter for plugins to add in any additional template packs |
|
| 1006 | - * Note the filter name here is for backward compat, this used to be found in EED_Messages. |
|
| 1007 | - */ |
|
| 1008 | - $additional_template_packs = apply_filters('FHEE__EED_Messages__get_template_packs__template_packs', array()); |
|
| 1009 | - foreach ((array) $additional_template_packs as $template_pack) { |
|
| 1010 | - if ( |
|
| 1011 | - self::$_template_pack_collection->get_by_name( |
|
| 1012 | - $template_pack->dbref |
|
| 1013 | - ) instanceof EE_Messages_Template_Pack |
|
| 1014 | - ) { |
|
| 1015 | - continue; |
|
| 1016 | - } |
|
| 1017 | - self::$_template_pack_collection->add($template_pack); |
|
| 1018 | - } |
|
| 1019 | - return self::$_template_pack_collection; |
|
| 1020 | - } |
|
| 1021 | - |
|
| 1022 | - |
|
| 1023 | - /** |
|
| 1024 | - * This is a wrapper for the protected _create_new_templates function |
|
| 1025 | - * |
|
| 1026 | - * @param string $messenger_name |
|
| 1027 | - * @param string $message_type_name message type that the templates are being created for |
|
| 1028 | - * @param int $GRP_ID |
|
| 1029 | - * @param bool $global |
|
| 1030 | - * @return array |
|
| 1031 | - * @throws EE_Error |
|
| 1032 | - * @throws ReflectionException |
|
| 1033 | - */ |
|
| 1034 | - public static function create_new_templates($messenger_name, $message_type_name, $GRP_ID = 0, $global = false) |
|
| 1035 | - { |
|
| 1036 | - /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 1037 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 1038 | - $messenger = $Message_Resource_Manager->valid_messenger($messenger_name); |
|
| 1039 | - $message_type = $Message_Resource_Manager->valid_message_type($message_type_name); |
|
| 1040 | - if (! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type, $global)) { |
|
| 1041 | - return array(); |
|
| 1042 | - } |
|
| 1043 | - // whew made it this far! Okay, let's go ahead and create the templates then |
|
| 1044 | - return EEH_MSG_Template::_create_new_templates($messenger, $message_type, $GRP_ID, $global); |
|
| 1045 | - } |
|
| 1046 | - |
|
| 1047 | - |
|
| 1048 | - /** |
|
| 1049 | - * @param EE_messenger $messenger |
|
| 1050 | - * @param EE_message_type $message_type |
|
| 1051 | - * @param $GRP_ID |
|
| 1052 | - * @param $global |
|
| 1053 | - * @return array|mixed |
|
| 1054 | - * @throws EE_Error |
|
| 1055 | - * @throws ReflectionException |
|
| 1056 | - */ |
|
| 1057 | - protected static function _create_new_templates(EE_messenger $messenger, EE_message_type $message_type, $GRP_ID, $global) |
|
| 1058 | - { |
|
| 1059 | - // if we're creating a custom template then we don't need to use the defaults class |
|
| 1060 | - if (! $global) { |
|
| 1061 | - return EEH_MSG_Template::_create_custom_template_group($messenger, $message_type, $GRP_ID); |
|
| 1062 | - } |
|
| 1063 | - /** @type EE_Messages_Template_Defaults $Message_Template_Defaults */ |
|
| 1064 | - $Message_Template_Defaults = EE_Registry::factory( |
|
| 1065 | - 'EE_Messages_Template_Defaults', |
|
| 1066 | - array( $messenger, $message_type, $GRP_ID ) |
|
| 1067 | - ); |
|
| 1068 | - // generate templates |
|
| 1069 | - $success = $Message_Template_Defaults->create_new_templates(); |
|
| 1070 | - |
|
| 1071 | - // if creating the template failed. Then we should deactivate the related message_type for the messenger because |
|
| 1072 | - // its not active if it doesn't have a template. Note this is only happening for GLOBAL template creation |
|
| 1073 | - // attempts. |
|
| 1074 | - if (! $success) { |
|
| 1075 | - /** @var EE_Message_Resource_Manager $message_resource_manager */ |
|
| 1076 | - $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 1077 | - $message_resource_manager->deactivate_message_type_for_messenger($message_type->name, $messenger->name); |
|
| 1078 | - } |
|
| 1079 | - |
|
| 1080 | - /** |
|
| 1081 | - * $success is in an array in the following format |
|
| 1082 | - * array( |
|
| 1083 | - * 'GRP_ID' => $new_grp_id, |
|
| 1084 | - * 'MTP_context' => $first_context_in_new_templates, |
|
| 1085 | - * ) |
|
| 1086 | - */ |
|
| 1087 | - return $success; |
|
| 1088 | - } |
|
| 1089 | - |
|
| 1090 | - |
|
| 1091 | - /** |
|
| 1092 | - * This creates a custom template using the incoming GRP_ID |
|
| 1093 | - * |
|
| 1094 | - * @param EE_messenger $messenger |
|
| 1095 | - * @param EE_message_type $message_type |
|
| 1096 | - * @param int $GRP_ID GRP_ID for the template_group being used as the base |
|
| 1097 | - * @return array $success This will be an array in the format: |
|
| 1098 | - * array( |
|
| 1099 | - * 'GRP_ID' => $new_grp_id, |
|
| 1100 | - * 'MTP_context' => $first_context_in_created_template |
|
| 1101 | - * ) |
|
| 1102 | - * @throws EE_Error |
|
| 1103 | - * @throws ReflectionException |
|
| 1104 | - * @access private |
|
| 1105 | - */ |
|
| 1106 | - private static function _create_custom_template_group(EE_messenger $messenger, EE_message_type $message_type, $GRP_ID) |
|
| 1107 | - { |
|
| 1108 | - // defaults |
|
| 1109 | - $success = array( 'GRP_ID' => null, 'MTP_context' => '' ); |
|
| 1110 | - // get the template group to use as a template from the db. If $GRP_ID is empty then we'll assume the base will be the global template matching the messenger and message type. |
|
| 1111 | - $Message_Template_Group = empty($GRP_ID) |
|
| 1112 | - ? EEM_Message_Template_Group::instance()->get_one( |
|
| 1113 | - array( |
|
| 1114 | - array( |
|
| 1115 | - 'MTP_messenger' => $messenger->name, |
|
| 1116 | - 'MTP_message_type' => $message_type->name, |
|
| 1117 | - 'MTP_is_global' => true |
|
| 1118 | - ) |
|
| 1119 | - ) |
|
| 1120 | - ) |
|
| 1121 | - : EEM_Message_Template_Group::instance()->get_one_by_ID($GRP_ID); |
|
| 1122 | - // if we don't have a mtg at this point then we need to bail. |
|
| 1123 | - if (! $Message_Template_Group instanceof EE_Message_Template_Group) { |
|
| 1124 | - EE_Error::add_error( |
|
| 1125 | - sprintf( |
|
| 1126 | - esc_html__( |
|
| 1127 | - 'Something went wrong with generating the custom template from this group id: %s. This usually happens when there is no matching message template group in the db.', |
|
| 1128 | - 'event_espresso' |
|
| 1129 | - ), |
|
| 1130 | - $GRP_ID |
|
| 1131 | - ), |
|
| 1132 | - __FILE__, |
|
| 1133 | - __FUNCTION__, |
|
| 1134 | - __LINE__ |
|
| 1135 | - ); |
|
| 1136 | - return $success; |
|
| 1137 | - } |
|
| 1138 | - // let's get all the related message_template objects for this group. |
|
| 1139 | - $message_templates = $Message_Template_Group->message_templates(); |
|
| 1140 | - // now we have what we need to setup the new template |
|
| 1141 | - $new_mtg = clone $Message_Template_Group; |
|
| 1142 | - $new_mtg->set('GRP_ID', 0); |
|
| 1143 | - $new_mtg->set('MTP_is_global', false); |
|
| 1144 | - |
|
| 1145 | - /** @var RequestInterface $request */ |
|
| 1146 | - $request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
| 1147 | - $template_name = $request->isAjax() && $request->requestParamIsSet('templateName') |
|
| 1148 | - ? $request->getRequestParam('templateName') |
|
| 1149 | - : sprintf( |
|
| 1150 | - esc_html__('Custom %1$s', 'event_espresso'), |
|
| 1151 | - ucwords($message_type->label['singular']) ?? esc_html__('Template', 'event_espresso') |
|
| 1152 | - ); |
|
| 1153 | - $template_description = $request->isAjax() && $request->requestParamIsSet('templateDescription') |
|
| 1154 | - ? $request->getRequestParam('templateDescription') |
|
| 1155 | - : sprintf( |
|
| 1156 | - esc_html__( |
|
| 1157 | - 'This is a custom template that was created for the %s messenger and %s message type.', |
|
| 1158 | - 'event_espresso' |
|
| 1159 | - ), |
|
| 1160 | - $new_mtg->messenger_obj()->label['singular'], |
|
| 1161 | - $new_mtg->message_type_obj()->label['singular'] |
|
| 1162 | - ); |
|
| 1163 | - $new_mtg->set('MTP_name', $template_name); |
|
| 1164 | - $new_mtg->set('MTP_description', $template_description); |
|
| 1165 | - // remove ALL relations on this template group so they don't get saved! |
|
| 1166 | - $new_mtg->_remove_relations('Message_Template'); |
|
| 1167 | - $new_mtg->save(); |
|
| 1168 | - $success['GRP_ID'] = $new_mtg->ID(); |
|
| 1169 | - $success['template_name'] = $template_name; |
|
| 1170 | - // add new message templates and add relation to. |
|
| 1171 | - foreach ($message_templates as $message_template) { |
|
| 1172 | - if (! $message_template instanceof EE_Message_Template) { |
|
| 1173 | - continue; |
|
| 1174 | - } |
|
| 1175 | - $new_message_template = clone $message_template; |
|
| 1176 | - $new_message_template->set('MTP_ID', 0); |
|
| 1177 | - $new_message_template->set('GRP_ID', $new_mtg->ID()); // relation |
|
| 1178 | - $new_message_template->save(); |
|
| 1179 | - if (empty($success['MTP_context']) && $new_message_template->get('MTP_context') !== 'admin') { |
|
| 1180 | - $success['MTP_context'] = $new_message_template->get('MTP_context'); |
|
| 1181 | - } |
|
| 1182 | - } |
|
| 1183 | - return $success; |
|
| 1184 | - } |
|
| 1185 | - |
|
| 1186 | - |
|
| 1187 | - /** |
|
| 1188 | - * message_type_has_active_templates_for_messenger |
|
| 1189 | - * |
|
| 1190 | - * @param EE_messenger $messenger |
|
| 1191 | - * @param EE_message_type $message_type |
|
| 1192 | - * @param bool $global |
|
| 1193 | - * @return bool |
|
| 1194 | - * @throws EE_Error |
|
| 1195 | - */ |
|
| 1196 | - public static function message_type_has_active_templates_for_messenger( |
|
| 1197 | - EE_messenger $messenger, |
|
| 1198 | - EE_message_type $message_type, |
|
| 1199 | - $global = false |
|
| 1200 | - ) { |
|
| 1201 | - // is given message_type valid for given messenger (if this is not a global save) |
|
| 1202 | - if ($global) { |
|
| 1203 | - return true; |
|
| 1204 | - } |
|
| 1205 | - $active_templates = EEM_Message_Template_Group::instance()->count( |
|
| 1206 | - array( |
|
| 1207 | - array( |
|
| 1208 | - 'MTP_is_active' => true, |
|
| 1209 | - 'MTP_messenger' => $messenger->name, |
|
| 1210 | - 'MTP_message_type' => $message_type->name |
|
| 1211 | - ) |
|
| 1212 | - ) |
|
| 1213 | - ); |
|
| 1214 | - if ($active_templates > 0) { |
|
| 1215 | - return true; |
|
| 1216 | - } |
|
| 1217 | - EE_Error::add_error( |
|
| 1218 | - sprintf( |
|
| 1219 | - esc_html__( |
|
| 1220 | - 'The %1$s message type is not registered with the %2$s messenger. Please visit the Messenger activation page to assign this message type first if you want to use it.', |
|
| 1221 | - 'event_espresso' |
|
| 1222 | - ), |
|
| 1223 | - $message_type->name, |
|
| 1224 | - $messenger->name |
|
| 1225 | - ), |
|
| 1226 | - __FILE__, |
|
| 1227 | - __FUNCTION__, |
|
| 1228 | - __LINE__ |
|
| 1229 | - ); |
|
| 1230 | - return false; |
|
| 1231 | - } |
|
| 1232 | - |
|
| 1233 | - |
|
| 1234 | - /** |
|
| 1235 | - * get_fields |
|
| 1236 | - * This takes a given messenger and message type and returns all the template fields indexed by context (and with field type). |
|
| 1237 | - * |
|
| 1238 | - * @param string $messenger_name name of EE_messenger |
|
| 1239 | - * @param string $message_type_name name of EE_message_type |
|
| 1240 | - * @return array |
|
| 1241 | - * @throws EE_Error |
|
| 1242 | - * @throws ReflectionException |
|
| 1243 | - */ |
|
| 1244 | - public static function get_fields($messenger_name, $message_type_name) |
|
| 1245 | - { |
|
| 1246 | - $template_fields = array(); |
|
| 1247 | - /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 1248 | - $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 1249 | - $messenger = $Message_Resource_Manager->valid_messenger($messenger_name); |
|
| 1250 | - $message_type = $Message_Resource_Manager->valid_message_type($message_type_name); |
|
| 1251 | - if (! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type)) { |
|
| 1252 | - return array(); |
|
| 1253 | - } |
|
| 1254 | - |
|
| 1255 | - $excluded_fields_for_messenger = $message_type->excludedFieldsForMessenger($messenger_name); |
|
| 1256 | - |
|
| 1257 | - // okay now let's assemble an array with the messenger template fields added to the message_type contexts. |
|
| 1258 | - foreach ($message_type->get_contexts() as $context => $details) { |
|
| 1259 | - foreach ($messenger->get_template_fields() as $field => $value) { |
|
| 1260 | - if (in_array($field, $excluded_fields_for_messenger, true)) { |
|
| 1261 | - continue; |
|
| 1262 | - } |
|
| 1263 | - $template_fields[ $context ][ $field ] = $value; |
|
| 1264 | - } |
|
| 1265 | - } |
|
| 1266 | - if (empty($template_fields)) { |
|
| 1267 | - EE_Error::add_error( |
|
| 1268 | - esc_html__('Something went wrong and we couldn\'t get any templates assembled', 'event_espresso'), |
|
| 1269 | - __FILE__, |
|
| 1270 | - __FUNCTION__, |
|
| 1271 | - __LINE__ |
|
| 1272 | - ); |
|
| 1273 | - return array(); |
|
| 1274 | - } |
|
| 1275 | - return $template_fields; |
|
| 1276 | - } |
|
| 834 | + } |
|
| 835 | + |
|
| 836 | + |
|
| 837 | + |
|
| 838 | + |
|
| 839 | + |
|
| 840 | + /** |
|
| 841 | + * This returns an array with keys as reg statuses and values as the corresponding message type slug (filtered). |
|
| 842 | + * |
|
| 843 | + * @since 4.9.0 |
|
| 844 | + * @return array |
|
| 845 | + */ |
|
| 846 | + public static function reg_status_to_message_type_array() |
|
| 847 | + { |
|
| 848 | + return (array) apply_filters( |
|
| 849 | + 'FHEE__EEH_MSG_Template__reg_status_to_message_type_array', |
|
| 850 | + array( |
|
| 851 | + EEM_Registration::status_id_approved => 'registration', |
|
| 852 | + EEM_Registration::status_id_pending_payment => 'pending_approval', |
|
| 853 | + EEM_Registration::status_id_not_approved => 'not_approved_registration', |
|
| 854 | + EEM_Registration::status_id_cancelled => 'cancelled_registration', |
|
| 855 | + EEM_Registration::status_id_declined => 'declined_registration' |
|
| 856 | + ) |
|
| 857 | + ); |
|
| 858 | + } |
|
| 859 | + |
|
| 860 | + |
|
| 861 | + |
|
| 862 | + |
|
| 863 | + /** |
|
| 864 | + * This returns the corresponding registration message type slug to the given reg status. If there isn't a |
|
| 865 | + * match, then returns an empty string. |
|
| 866 | + * |
|
| 867 | + * @since 4.9.0 |
|
| 868 | + * @param $reg_status |
|
| 869 | + * @return string |
|
| 870 | + */ |
|
| 871 | + public static function convert_reg_status_to_message_type($reg_status) |
|
| 872 | + { |
|
| 873 | + $reg_status_array = self::reg_status_to_message_type_array(); |
|
| 874 | + return isset($reg_status_array[ $reg_status ]) ? $reg_status_array[ $reg_status ] : ''; |
|
| 875 | + } |
|
| 876 | + |
|
| 877 | + |
|
| 878 | + /** |
|
| 879 | + * This returns an array with keys as payment stati and values as the corresponding message type slug (filtered). |
|
| 880 | + * |
|
| 881 | + * @since 4.9.0 |
|
| 882 | + * @return array |
|
| 883 | + */ |
|
| 884 | + public static function payment_status_to_message_type_array() |
|
| 885 | + { |
|
| 886 | + return (array) apply_filters( |
|
| 887 | + 'FHEE__EEH_MSG_Template__payment_status_to_message_type_array', |
|
| 888 | + array( |
|
| 889 | + EEM_Payment::status_id_approved => 'payment', |
|
| 890 | + EEM_Payment::status_id_pending => 'payment_pending', |
|
| 891 | + EEM_Payment::status_id_cancelled => 'payment_cancelled', |
|
| 892 | + EEM_Payment::status_id_declined => 'payment_declined', |
|
| 893 | + EEM_Payment::status_id_failed => 'payment_failed' |
|
| 894 | + ) |
|
| 895 | + ); |
|
| 896 | + } |
|
| 897 | + |
|
| 898 | + |
|
| 899 | + |
|
| 900 | + |
|
| 901 | + /** |
|
| 902 | + * This returns the corresponding payment message type slug to the given payment status. If there isn't a match then |
|
| 903 | + * an empty string is returned |
|
| 904 | + * |
|
| 905 | + * @since 4.9.0 |
|
| 906 | + * @param $payment_status |
|
| 907 | + * @return string |
|
| 908 | + */ |
|
| 909 | + public static function convert_payment_status_to_message_type($payment_status) |
|
| 910 | + { |
|
| 911 | + $payment_status_array = self::payment_status_to_message_type_array(); |
|
| 912 | + return isset($payment_status_array[ $payment_status ]) ? $payment_status_array[ $payment_status ] : ''; |
|
| 913 | + } |
|
| 914 | + |
|
| 915 | + |
|
| 916 | + /** |
|
| 917 | + * This is used to retrieve the template pack for the given name. |
|
| 918 | + * |
|
| 919 | + * @param string $template_pack_name should match the set `dbref` property value on the EE_Messages_Template_Pack. |
|
| 920 | + * |
|
| 921 | + * @return EE_Messages_Template_Pack |
|
| 922 | + */ |
|
| 923 | + public static function get_template_pack($template_pack_name) |
|
| 924 | + { |
|
| 925 | + if (! self::$_template_pack_collection instanceof EE_Object_Collection) { |
|
| 926 | + self::$_template_pack_collection = new EE_Messages_Template_Pack_Collection(); |
|
| 927 | + } |
|
| 928 | + |
|
| 929 | + // first see if in collection already |
|
| 930 | + $template_pack = self::$_template_pack_collection->get_by_name($template_pack_name); |
|
| 931 | + |
|
| 932 | + if ($template_pack instanceof EE_Messages_Template_Pack) { |
|
| 933 | + return $template_pack; |
|
| 934 | + } |
|
| 935 | + |
|
| 936 | + // nope...let's get it. |
|
| 937 | + // not set yet so let's attempt to get it. |
|
| 938 | + $pack_class_name = 'EE_Messages_Template_Pack_' . str_replace( |
|
| 939 | + ' ', |
|
| 940 | + '_', |
|
| 941 | + ucwords( |
|
| 942 | + str_replace('_', ' ', $template_pack_name) |
|
| 943 | + ) |
|
| 944 | + ); |
|
| 945 | + if (! class_exists($pack_class_name) && $template_pack_name !== 'default') { |
|
| 946 | + return self::get_template_pack('default'); |
|
| 947 | + } else { |
|
| 948 | + $template_pack = new $pack_class_name(); |
|
| 949 | + self::$_template_pack_collection->add($template_pack); |
|
| 950 | + return $template_pack; |
|
| 951 | + } |
|
| 952 | + } |
|
| 953 | + |
|
| 954 | + |
|
| 955 | + |
|
| 956 | + |
|
| 957 | + /** |
|
| 958 | + * Globs template packs installed in core and returns the template pack collection with all installed template packs |
|
| 959 | + * in it. |
|
| 960 | + * |
|
| 961 | + * @since 4.9.0 |
|
| 962 | + * |
|
| 963 | + * @return EE_Messages_Template_Pack_Collection |
|
| 964 | + */ |
|
| 965 | + public static function get_template_pack_collection() |
|
| 966 | + { |
|
| 967 | + $new_collection = false; |
|
| 968 | + if (! self::$_template_pack_collection instanceof EE_Messages_Template_Pack_Collection) { |
|
| 969 | + self::$_template_pack_collection = new EE_Messages_Template_Pack_Collection(); |
|
| 970 | + $new_collection = true; |
|
| 971 | + } |
|
| 972 | + |
|
| 973 | + // glob the defaults directory for messages |
|
| 974 | + $templates = glob(EE_LIBRARIES . 'messages/defaults/*', GLOB_ONLYDIR); |
|
| 975 | + foreach ($templates as $template_path) { |
|
| 976 | + // grab folder name |
|
| 977 | + $template = basename($template_path); |
|
| 978 | + |
|
| 979 | + if (! $new_collection) { |
|
| 980 | + // already have it? |
|
| 981 | + if (self::$_template_pack_collection->get_by_name($template) instanceof EE_Messages_Template_Pack) { |
|
| 982 | + continue; |
|
| 983 | + } |
|
| 984 | + } |
|
| 985 | + |
|
| 986 | + // setup classname. |
|
| 987 | + $template_pack_class_name = 'EE_Messages_Template_Pack_' . str_replace( |
|
| 988 | + ' ', |
|
| 989 | + '_', |
|
| 990 | + ucwords( |
|
| 991 | + str_replace( |
|
| 992 | + '_', |
|
| 993 | + ' ', |
|
| 994 | + $template |
|
| 995 | + ) |
|
| 996 | + ) |
|
| 997 | + ); |
|
| 998 | + if (! class_exists($template_pack_class_name)) { |
|
| 999 | + continue; |
|
| 1000 | + } |
|
| 1001 | + self::$_template_pack_collection->add(new $template_pack_class_name()); |
|
| 1002 | + } |
|
| 1003 | + |
|
| 1004 | + /** |
|
| 1005 | + * Filter for plugins to add in any additional template packs |
|
| 1006 | + * Note the filter name here is for backward compat, this used to be found in EED_Messages. |
|
| 1007 | + */ |
|
| 1008 | + $additional_template_packs = apply_filters('FHEE__EED_Messages__get_template_packs__template_packs', array()); |
|
| 1009 | + foreach ((array) $additional_template_packs as $template_pack) { |
|
| 1010 | + if ( |
|
| 1011 | + self::$_template_pack_collection->get_by_name( |
|
| 1012 | + $template_pack->dbref |
|
| 1013 | + ) instanceof EE_Messages_Template_Pack |
|
| 1014 | + ) { |
|
| 1015 | + continue; |
|
| 1016 | + } |
|
| 1017 | + self::$_template_pack_collection->add($template_pack); |
|
| 1018 | + } |
|
| 1019 | + return self::$_template_pack_collection; |
|
| 1020 | + } |
|
| 1021 | + |
|
| 1022 | + |
|
| 1023 | + /** |
|
| 1024 | + * This is a wrapper for the protected _create_new_templates function |
|
| 1025 | + * |
|
| 1026 | + * @param string $messenger_name |
|
| 1027 | + * @param string $message_type_name message type that the templates are being created for |
|
| 1028 | + * @param int $GRP_ID |
|
| 1029 | + * @param bool $global |
|
| 1030 | + * @return array |
|
| 1031 | + * @throws EE_Error |
|
| 1032 | + * @throws ReflectionException |
|
| 1033 | + */ |
|
| 1034 | + public static function create_new_templates($messenger_name, $message_type_name, $GRP_ID = 0, $global = false) |
|
| 1035 | + { |
|
| 1036 | + /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 1037 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 1038 | + $messenger = $Message_Resource_Manager->valid_messenger($messenger_name); |
|
| 1039 | + $message_type = $Message_Resource_Manager->valid_message_type($message_type_name); |
|
| 1040 | + if (! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type, $global)) { |
|
| 1041 | + return array(); |
|
| 1042 | + } |
|
| 1043 | + // whew made it this far! Okay, let's go ahead and create the templates then |
|
| 1044 | + return EEH_MSG_Template::_create_new_templates($messenger, $message_type, $GRP_ID, $global); |
|
| 1045 | + } |
|
| 1046 | + |
|
| 1047 | + |
|
| 1048 | + /** |
|
| 1049 | + * @param EE_messenger $messenger |
|
| 1050 | + * @param EE_message_type $message_type |
|
| 1051 | + * @param $GRP_ID |
|
| 1052 | + * @param $global |
|
| 1053 | + * @return array|mixed |
|
| 1054 | + * @throws EE_Error |
|
| 1055 | + * @throws ReflectionException |
|
| 1056 | + */ |
|
| 1057 | + protected static function _create_new_templates(EE_messenger $messenger, EE_message_type $message_type, $GRP_ID, $global) |
|
| 1058 | + { |
|
| 1059 | + // if we're creating a custom template then we don't need to use the defaults class |
|
| 1060 | + if (! $global) { |
|
| 1061 | + return EEH_MSG_Template::_create_custom_template_group($messenger, $message_type, $GRP_ID); |
|
| 1062 | + } |
|
| 1063 | + /** @type EE_Messages_Template_Defaults $Message_Template_Defaults */ |
|
| 1064 | + $Message_Template_Defaults = EE_Registry::factory( |
|
| 1065 | + 'EE_Messages_Template_Defaults', |
|
| 1066 | + array( $messenger, $message_type, $GRP_ID ) |
|
| 1067 | + ); |
|
| 1068 | + // generate templates |
|
| 1069 | + $success = $Message_Template_Defaults->create_new_templates(); |
|
| 1070 | + |
|
| 1071 | + // if creating the template failed. Then we should deactivate the related message_type for the messenger because |
|
| 1072 | + // its not active if it doesn't have a template. Note this is only happening for GLOBAL template creation |
|
| 1073 | + // attempts. |
|
| 1074 | + if (! $success) { |
|
| 1075 | + /** @var EE_Message_Resource_Manager $message_resource_manager */ |
|
| 1076 | + $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 1077 | + $message_resource_manager->deactivate_message_type_for_messenger($message_type->name, $messenger->name); |
|
| 1078 | + } |
|
| 1079 | + |
|
| 1080 | + /** |
|
| 1081 | + * $success is in an array in the following format |
|
| 1082 | + * array( |
|
| 1083 | + * 'GRP_ID' => $new_grp_id, |
|
| 1084 | + * 'MTP_context' => $first_context_in_new_templates, |
|
| 1085 | + * ) |
|
| 1086 | + */ |
|
| 1087 | + return $success; |
|
| 1088 | + } |
|
| 1089 | + |
|
| 1090 | + |
|
| 1091 | + /** |
|
| 1092 | + * This creates a custom template using the incoming GRP_ID |
|
| 1093 | + * |
|
| 1094 | + * @param EE_messenger $messenger |
|
| 1095 | + * @param EE_message_type $message_type |
|
| 1096 | + * @param int $GRP_ID GRP_ID for the template_group being used as the base |
|
| 1097 | + * @return array $success This will be an array in the format: |
|
| 1098 | + * array( |
|
| 1099 | + * 'GRP_ID' => $new_grp_id, |
|
| 1100 | + * 'MTP_context' => $first_context_in_created_template |
|
| 1101 | + * ) |
|
| 1102 | + * @throws EE_Error |
|
| 1103 | + * @throws ReflectionException |
|
| 1104 | + * @access private |
|
| 1105 | + */ |
|
| 1106 | + private static function _create_custom_template_group(EE_messenger $messenger, EE_message_type $message_type, $GRP_ID) |
|
| 1107 | + { |
|
| 1108 | + // defaults |
|
| 1109 | + $success = array( 'GRP_ID' => null, 'MTP_context' => '' ); |
|
| 1110 | + // get the template group to use as a template from the db. If $GRP_ID is empty then we'll assume the base will be the global template matching the messenger and message type. |
|
| 1111 | + $Message_Template_Group = empty($GRP_ID) |
|
| 1112 | + ? EEM_Message_Template_Group::instance()->get_one( |
|
| 1113 | + array( |
|
| 1114 | + array( |
|
| 1115 | + 'MTP_messenger' => $messenger->name, |
|
| 1116 | + 'MTP_message_type' => $message_type->name, |
|
| 1117 | + 'MTP_is_global' => true |
|
| 1118 | + ) |
|
| 1119 | + ) |
|
| 1120 | + ) |
|
| 1121 | + : EEM_Message_Template_Group::instance()->get_one_by_ID($GRP_ID); |
|
| 1122 | + // if we don't have a mtg at this point then we need to bail. |
|
| 1123 | + if (! $Message_Template_Group instanceof EE_Message_Template_Group) { |
|
| 1124 | + EE_Error::add_error( |
|
| 1125 | + sprintf( |
|
| 1126 | + esc_html__( |
|
| 1127 | + 'Something went wrong with generating the custom template from this group id: %s. This usually happens when there is no matching message template group in the db.', |
|
| 1128 | + 'event_espresso' |
|
| 1129 | + ), |
|
| 1130 | + $GRP_ID |
|
| 1131 | + ), |
|
| 1132 | + __FILE__, |
|
| 1133 | + __FUNCTION__, |
|
| 1134 | + __LINE__ |
|
| 1135 | + ); |
|
| 1136 | + return $success; |
|
| 1137 | + } |
|
| 1138 | + // let's get all the related message_template objects for this group. |
|
| 1139 | + $message_templates = $Message_Template_Group->message_templates(); |
|
| 1140 | + // now we have what we need to setup the new template |
|
| 1141 | + $new_mtg = clone $Message_Template_Group; |
|
| 1142 | + $new_mtg->set('GRP_ID', 0); |
|
| 1143 | + $new_mtg->set('MTP_is_global', false); |
|
| 1144 | + |
|
| 1145 | + /** @var RequestInterface $request */ |
|
| 1146 | + $request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
| 1147 | + $template_name = $request->isAjax() && $request->requestParamIsSet('templateName') |
|
| 1148 | + ? $request->getRequestParam('templateName') |
|
| 1149 | + : sprintf( |
|
| 1150 | + esc_html__('Custom %1$s', 'event_espresso'), |
|
| 1151 | + ucwords($message_type->label['singular']) ?? esc_html__('Template', 'event_espresso') |
|
| 1152 | + ); |
|
| 1153 | + $template_description = $request->isAjax() && $request->requestParamIsSet('templateDescription') |
|
| 1154 | + ? $request->getRequestParam('templateDescription') |
|
| 1155 | + : sprintf( |
|
| 1156 | + esc_html__( |
|
| 1157 | + 'This is a custom template that was created for the %s messenger and %s message type.', |
|
| 1158 | + 'event_espresso' |
|
| 1159 | + ), |
|
| 1160 | + $new_mtg->messenger_obj()->label['singular'], |
|
| 1161 | + $new_mtg->message_type_obj()->label['singular'] |
|
| 1162 | + ); |
|
| 1163 | + $new_mtg->set('MTP_name', $template_name); |
|
| 1164 | + $new_mtg->set('MTP_description', $template_description); |
|
| 1165 | + // remove ALL relations on this template group so they don't get saved! |
|
| 1166 | + $new_mtg->_remove_relations('Message_Template'); |
|
| 1167 | + $new_mtg->save(); |
|
| 1168 | + $success['GRP_ID'] = $new_mtg->ID(); |
|
| 1169 | + $success['template_name'] = $template_name; |
|
| 1170 | + // add new message templates and add relation to. |
|
| 1171 | + foreach ($message_templates as $message_template) { |
|
| 1172 | + if (! $message_template instanceof EE_Message_Template) { |
|
| 1173 | + continue; |
|
| 1174 | + } |
|
| 1175 | + $new_message_template = clone $message_template; |
|
| 1176 | + $new_message_template->set('MTP_ID', 0); |
|
| 1177 | + $new_message_template->set('GRP_ID', $new_mtg->ID()); // relation |
|
| 1178 | + $new_message_template->save(); |
|
| 1179 | + if (empty($success['MTP_context']) && $new_message_template->get('MTP_context') !== 'admin') { |
|
| 1180 | + $success['MTP_context'] = $new_message_template->get('MTP_context'); |
|
| 1181 | + } |
|
| 1182 | + } |
|
| 1183 | + return $success; |
|
| 1184 | + } |
|
| 1185 | + |
|
| 1186 | + |
|
| 1187 | + /** |
|
| 1188 | + * message_type_has_active_templates_for_messenger |
|
| 1189 | + * |
|
| 1190 | + * @param EE_messenger $messenger |
|
| 1191 | + * @param EE_message_type $message_type |
|
| 1192 | + * @param bool $global |
|
| 1193 | + * @return bool |
|
| 1194 | + * @throws EE_Error |
|
| 1195 | + */ |
|
| 1196 | + public static function message_type_has_active_templates_for_messenger( |
|
| 1197 | + EE_messenger $messenger, |
|
| 1198 | + EE_message_type $message_type, |
|
| 1199 | + $global = false |
|
| 1200 | + ) { |
|
| 1201 | + // is given message_type valid for given messenger (if this is not a global save) |
|
| 1202 | + if ($global) { |
|
| 1203 | + return true; |
|
| 1204 | + } |
|
| 1205 | + $active_templates = EEM_Message_Template_Group::instance()->count( |
|
| 1206 | + array( |
|
| 1207 | + array( |
|
| 1208 | + 'MTP_is_active' => true, |
|
| 1209 | + 'MTP_messenger' => $messenger->name, |
|
| 1210 | + 'MTP_message_type' => $message_type->name |
|
| 1211 | + ) |
|
| 1212 | + ) |
|
| 1213 | + ); |
|
| 1214 | + if ($active_templates > 0) { |
|
| 1215 | + return true; |
|
| 1216 | + } |
|
| 1217 | + EE_Error::add_error( |
|
| 1218 | + sprintf( |
|
| 1219 | + esc_html__( |
|
| 1220 | + 'The %1$s message type is not registered with the %2$s messenger. Please visit the Messenger activation page to assign this message type first if you want to use it.', |
|
| 1221 | + 'event_espresso' |
|
| 1222 | + ), |
|
| 1223 | + $message_type->name, |
|
| 1224 | + $messenger->name |
|
| 1225 | + ), |
|
| 1226 | + __FILE__, |
|
| 1227 | + __FUNCTION__, |
|
| 1228 | + __LINE__ |
|
| 1229 | + ); |
|
| 1230 | + return false; |
|
| 1231 | + } |
|
| 1232 | + |
|
| 1233 | + |
|
| 1234 | + /** |
|
| 1235 | + * get_fields |
|
| 1236 | + * This takes a given messenger and message type and returns all the template fields indexed by context (and with field type). |
|
| 1237 | + * |
|
| 1238 | + * @param string $messenger_name name of EE_messenger |
|
| 1239 | + * @param string $message_type_name name of EE_message_type |
|
| 1240 | + * @return array |
|
| 1241 | + * @throws EE_Error |
|
| 1242 | + * @throws ReflectionException |
|
| 1243 | + */ |
|
| 1244 | + public static function get_fields($messenger_name, $message_type_name) |
|
| 1245 | + { |
|
| 1246 | + $template_fields = array(); |
|
| 1247 | + /** @type EE_Message_Resource_Manager $Message_Resource_Manager */ |
|
| 1248 | + $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
|
| 1249 | + $messenger = $Message_Resource_Manager->valid_messenger($messenger_name); |
|
| 1250 | + $message_type = $Message_Resource_Manager->valid_message_type($message_type_name); |
|
| 1251 | + if (! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type)) { |
|
| 1252 | + return array(); |
|
| 1253 | + } |
|
| 1254 | + |
|
| 1255 | + $excluded_fields_for_messenger = $message_type->excludedFieldsForMessenger($messenger_name); |
|
| 1256 | + |
|
| 1257 | + // okay now let's assemble an array with the messenger template fields added to the message_type contexts. |
|
| 1258 | + foreach ($message_type->get_contexts() as $context => $details) { |
|
| 1259 | + foreach ($messenger->get_template_fields() as $field => $value) { |
|
| 1260 | + if (in_array($field, $excluded_fields_for_messenger, true)) { |
|
| 1261 | + continue; |
|
| 1262 | + } |
|
| 1263 | + $template_fields[ $context ][ $field ] = $value; |
|
| 1264 | + } |
|
| 1265 | + } |
|
| 1266 | + if (empty($template_fields)) { |
|
| 1267 | + EE_Error::add_error( |
|
| 1268 | + esc_html__('Something went wrong and we couldn\'t get any templates assembled', 'event_espresso'), |
|
| 1269 | + __FILE__, |
|
| 1270 | + __FUNCTION__, |
|
| 1271 | + __LINE__ |
|
| 1272 | + ); |
|
| 1273 | + return array(); |
|
| 1274 | + } |
|
| 1275 | + return $template_fields; |
|
| 1276 | + } |
|
| 1277 | 1277 | } |
@@ -101,7 +101,7 @@ discard block |
||
| 101 | 101 | $global |
| 102 | 102 | ); |
| 103 | 103 | |
| 104 | - if (! $new_message_template_group) { |
|
| 104 | + if ( ! $new_message_template_group) { |
|
| 105 | 105 | continue; |
| 106 | 106 | } |
| 107 | 107 | $templates[] = $new_message_template_group; |
@@ -136,7 +136,7 @@ discard block |
||
| 136 | 136 | ) |
| 137 | 137 | ) |
| 138 | 138 | ) |
| 139 | - : EEM_Message_Template::instance()->count(array( array( 'GRP_ID' => $GRP_ID ) )); |
|
| 139 | + : EEM_Message_Template::instance()->count(array(array('GRP_ID' => $GRP_ID))); |
|
| 140 | 140 | |
| 141 | 141 | return $count > 0; |
| 142 | 142 | } |
@@ -153,14 +153,14 @@ discard block |
||
| 153 | 153 | */ |
| 154 | 154 | public static function update_to_active($messenger_names, $message_type_names) |
| 155 | 155 | { |
| 156 | - $messenger_names = is_array($messenger_names) ? $messenger_names : array( $messenger_names ); |
|
| 157 | - $message_type_names = is_array($message_type_names) ? $message_type_names : array( $message_type_names ); |
|
| 156 | + $messenger_names = is_array($messenger_names) ? $messenger_names : array($messenger_names); |
|
| 157 | + $message_type_names = is_array($message_type_names) ? $message_type_names : array($message_type_names); |
|
| 158 | 158 | return EEM_Message_Template_Group::instance()->update( |
| 159 | - array( 'MTP_is_active' => 1 ), |
|
| 159 | + array('MTP_is_active' => 1), |
|
| 160 | 160 | array( |
| 161 | 161 | array( |
| 162 | - 'MTP_messenger' => array( 'IN', $messenger_names ), |
|
| 163 | - 'MTP_message_type' => array( 'IN', $message_type_names ) |
|
| 162 | + 'MTP_messenger' => array('IN', $messenger_names), |
|
| 163 | + 'MTP_message_type' => array('IN', $message_type_names) |
|
| 164 | 164 | ) |
| 165 | 165 | ) |
| 166 | 166 | ); |
@@ -248,13 +248,13 @@ discard block |
||
| 248 | 248 | $messenger = $message_resource_manager->get_messenger($messenger); |
| 249 | 249 | |
| 250 | 250 | // if messenger isn't a EE_messenger resource then bail. |
| 251 | - if (! $messenger instanceof EE_messenger) { |
|
| 251 | + if ( ! $messenger instanceof EE_messenger) { |
|
| 252 | 252 | return array(); |
| 253 | 253 | } |
| 254 | 254 | |
| 255 | 255 | // validate class for getting our list of shortcodes |
| 256 | - $classname = 'EE_Messages_' . $messenger_name . '_' . $mt_name . '_Validator'; |
|
| 257 | - if (! class_exists($classname)) { |
|
| 256 | + $classname = 'EE_Messages_'.$messenger_name.'_'.$mt_name.'_Validator'; |
|
| 257 | + if ( ! class_exists($classname)) { |
|
| 258 | 258 | $msg[] = esc_html__('The Validator class was unable to load', 'event_espresso'); |
| 259 | 259 | $msg[] = sprintf( |
| 260 | 260 | esc_html__('The class name compiled was %s. Please check and make sure the spelling and case is correct for the class name and that there is an autoloader in place for this class', 'event_espresso'), |
@@ -270,44 +270,44 @@ discard block |
||
| 270 | 270 | // let's make sure we're only getting the shortcode part of the validators |
| 271 | 271 | $shortcodes = array(); |
| 272 | 272 | foreach ($valid_shortcodes as $field => $validators) { |
| 273 | - $shortcodes[ $field ] = $validators['shortcodes']; |
|
| 273 | + $shortcodes[$field] = $validators['shortcodes']; |
|
| 274 | 274 | } |
| 275 | 275 | $valid_shortcodes = $shortcodes; |
| 276 | 276 | |
| 277 | 277 | // if not all fields let's make sure we ONLY include the shortcodes for the specified fields. |
| 278 | - if (! empty($fields)) { |
|
| 278 | + if ( ! empty($fields)) { |
|
| 279 | 279 | $specified_shortcodes = array(); |
| 280 | 280 | foreach ($fields as $field) { |
| 281 | - if (isset($valid_shortcodes[ $field ])) { |
|
| 282 | - $specified_shortcodes[ $field ] = $valid_shortcodes[ $field ]; |
|
| 281 | + if (isset($valid_shortcodes[$field])) { |
|
| 282 | + $specified_shortcodes[$field] = $valid_shortcodes[$field]; |
|
| 283 | 283 | } |
| 284 | 284 | } |
| 285 | 285 | $valid_shortcodes = $specified_shortcodes; |
| 286 | 286 | } |
| 287 | 287 | |
| 288 | 288 | // if not merged then let's replace the fields with the localized fields |
| 289 | - if (! $merged) { |
|
| 289 | + if ( ! $merged) { |
|
| 290 | 290 | // let's get all the fields for the set messenger so that we can get the localized label and use that in the returned array. |
| 291 | 291 | $field_settings = $messenger->get_template_fields(); |
| 292 | 292 | $localized = array(); |
| 293 | 293 | foreach ($valid_shortcodes as $field => $shortcodes) { |
| 294 | 294 | // get localized field label |
| 295 | - if (isset($field_settings[ $field ])) { |
|
| 295 | + if (isset($field_settings[$field])) { |
|
| 296 | 296 | // possible that this is used as a main field. |
| 297 | - if (empty($field_settings[ $field ])) { |
|
| 298 | - if (isset($field_settings['extra'][ $field ])) { |
|
| 299 | - $_field = $field_settings['extra'][ $field ]['main']['label']; |
|
| 297 | + if (empty($field_settings[$field])) { |
|
| 298 | + if (isset($field_settings['extra'][$field])) { |
|
| 299 | + $_field = $field_settings['extra'][$field]['main']['label']; |
|
| 300 | 300 | } else { |
| 301 | 301 | $_field = $field; |
| 302 | 302 | } |
| 303 | 303 | } else { |
| 304 | - $_field = $field_settings[ $field ]['label']; |
|
| 304 | + $_field = $field_settings[$field]['label']; |
|
| 305 | 305 | } |
| 306 | 306 | } elseif (isset($field_settings['extra'])) { |
| 307 | 307 | // loop through extra "main fields" and see if any of their children have our field |
| 308 | 308 | foreach ($field_settings['extra'] as $fields) { |
| 309 | - if (isset($fields[ $field ])) { |
|
| 310 | - $_field = $fields[ $field ]['label']; |
|
| 309 | + if (isset($fields[$field])) { |
|
| 310 | + $_field = $fields[$field]['label']; |
|
| 311 | 311 | } else { |
| 312 | 312 | $_field = $field; |
| 313 | 313 | } |
@@ -316,7 +316,7 @@ discard block |
||
| 316 | 316 | $_field = $field; |
| 317 | 317 | } |
| 318 | 318 | if (isset($_field)) { |
| 319 | - $localized[ (string) $_field ] = $shortcodes; |
|
| 319 | + $localized[(string) $_field] = $shortcodes; |
|
| 320 | 320 | } |
| 321 | 321 | } |
| 322 | 322 | $valid_shortcodes = $localized; |
@@ -327,10 +327,10 @@ discard block |
||
| 327 | 327 | $merged_codes = array(); |
| 328 | 328 | foreach ($valid_shortcodes as $shortcode) { |
| 329 | 329 | foreach ($shortcode as $code => $label) { |
| 330 | - if (isset($merged_codes[ $code ])) { |
|
| 330 | + if (isset($merged_codes[$code])) { |
|
| 331 | 331 | continue; |
| 332 | 332 | } else { |
| 333 | - $merged_codes[ $code ] = $label; |
|
| 333 | + $merged_codes[$code] = $label; |
|
| 334 | 334 | } |
| 335 | 335 | } |
| 336 | 336 | } |
@@ -481,12 +481,12 @@ discard block |
||
| 481 | 481 | $sending_messenger = '' |
| 482 | 482 | ) { |
| 483 | 483 | // first determine if the url can be to the EE_Message object. |
| 484 | - if (! $message_type->always_generate()) { |
|
| 484 | + if ( ! $message_type->always_generate()) { |
|
| 485 | 485 | return EEH_MSG_Template::generate_browser_trigger($message); |
| 486 | 486 | } |
| 487 | 487 | |
| 488 | 488 | // if $registration object is not valid then exit early because there's nothing that can be generated. |
| 489 | - if (! $registration instanceof EE_Registration) { |
|
| 489 | + if ( ! $registration instanceof EE_Registration) { |
|
| 490 | 490 | throw new EE_Error( |
| 491 | 491 | esc_html__('Incoming value for registration is not a valid EE_Registration object.', 'event_espresso') |
| 492 | 492 | ); |
@@ -494,7 +494,7 @@ discard block |
||
| 494 | 494 | |
| 495 | 495 | // validate given context |
| 496 | 496 | $contexts = $message_type->get_contexts(); |
| 497 | - if ($message->context() !== '' && ! isset($contexts[ $message->context() ])) { |
|
| 497 | + if ($message->context() !== '' && ! isset($contexts[$message->context()])) { |
|
| 498 | 498 | throw new EE_Error( |
| 499 | 499 | sprintf( |
| 500 | 500 | esc_html__('The context %s is not a valid context for %s.', 'event_espresso'), |
@@ -505,11 +505,11 @@ discard block |
||
| 505 | 505 | } |
| 506 | 506 | |
| 507 | 507 | // valid sending messenger but only if sending messenger set. Otherwise generating messenger is used. |
| 508 | - if (! empty($sending_messenger)) { |
|
| 508 | + if ( ! empty($sending_messenger)) { |
|
| 509 | 509 | $with_messengers = $message_type->with_messengers(); |
| 510 | 510 | if ( |
| 511 | - ! isset($with_messengers[ $message->messenger() ]) |
|
| 512 | - || ! in_array($sending_messenger, $with_messengers[ $message->messenger() ]) |
|
| 511 | + ! isset($with_messengers[$message->messenger()]) |
|
| 512 | + || ! in_array($sending_messenger, $with_messengers[$message->messenger()]) |
|
| 513 | 513 | ) { |
| 514 | 514 | throw new EE_Error( |
| 515 | 515 | sprintf( |
@@ -642,7 +642,7 @@ discard block |
||
| 642 | 642 | public static function get_message_action_icon($type) |
| 643 | 643 | { |
| 644 | 644 | $action_icons = self::get_message_action_icons(); |
| 645 | - return isset($action_icons[ $type ]) ? $action_icons[ $type ] : []; |
|
| 645 | + return isset($action_icons[$type]) ? $action_icons[$type] : []; |
|
| 646 | 646 | } |
| 647 | 647 | |
| 648 | 648 | |
@@ -707,7 +707,7 @@ discard block |
||
| 707 | 707 | public static function get_message_action_url($type, EE_Message $message = null, $query_params = array()) |
| 708 | 708 | { |
| 709 | 709 | $action_urls = self::get_message_action_urls($message, $query_params); |
| 710 | - return isset($action_urls[ $type ]) ? $action_urls[ $type ] : ''; |
|
| 710 | + return isset($action_urls[$type]) ? $action_urls[$type] : ''; |
|
| 711 | 711 | } |
| 712 | 712 | |
| 713 | 713 | |
@@ -728,7 +728,7 @@ discard block |
||
| 728 | 728 | EE_Registry::instance()->load_helper('URL'); |
| 729 | 729 | // if $message is not an instance of EE_Message then let's just do a dummy. |
| 730 | 730 | $message = empty($message) ? EE_Message_Factory::create() : $message; |
| 731 | - $action_urls = apply_filters( |
|
| 731 | + $action_urls = apply_filters( |
|
| 732 | 732 | 'FHEE__EEH_MSG_Template__get_message_action_url', |
| 733 | 733 | array( |
| 734 | 734 | 'view' => EEH_MSG_Template::generate_browser_trigger($message), |
@@ -812,24 +812,24 @@ discard block |
||
| 812 | 812 | $url = EEH_MSG_Template::get_message_action_url($type, $message, $query_params); |
| 813 | 813 | $icon_css = EEH_MSG_Template::get_message_action_icon($type); |
| 814 | 814 | $label = $icon_css['label'] ?? null; |
| 815 | - $label = $label ? 'aria-label="' . $label . '"' : ''; |
|
| 815 | + $label = $label ? 'aria-label="'.$label.'"' : ''; |
|
| 816 | 816 | $class = $label ? ' ee-aria-tooltip' : ''; |
| 817 | 817 | |
| 818 | 818 | if (empty($url) || empty($icon_css) || ! isset($icon_css['css_class'])) { |
| 819 | 819 | return ''; |
| 820 | 820 | } |
| 821 | 821 | |
| 822 | - $icon_css_class = $icon_css['css_class'] . apply_filters( |
|
| 822 | + $icon_css_class = $icon_css['css_class'].apply_filters( |
|
| 823 | 823 | 'FHEE__EEH_MSG_Template__get_message_action_link__icon_css_class', |
| 824 | - ' js-ee-message-action-link ee-message-action-link-' . $type, |
|
| 824 | + ' js-ee-message-action-link ee-message-action-link-'.$type, |
|
| 825 | 825 | $type, |
| 826 | 826 | $message, |
| 827 | 827 | $query_params |
| 828 | 828 | ); |
| 829 | 829 | |
| 830 | 830 | return ' |
| 831 | - <a href="' . $url . '" ' . $label . ' class="button button--icon-only' . $class . '"> |
|
| 832 | - <span class="' . esc_attr($icon_css_class) . '"></span> |
|
| 831 | + <a href="' . $url.'" '.$label.' class="button button--icon-only'.$class.'"> |
|
| 832 | + <span class="' . esc_attr($icon_css_class).'"></span> |
|
| 833 | 833 | </a>'; |
| 834 | 834 | } |
| 835 | 835 | |
@@ -871,7 +871,7 @@ discard block |
||
| 871 | 871 | public static function convert_reg_status_to_message_type($reg_status) |
| 872 | 872 | { |
| 873 | 873 | $reg_status_array = self::reg_status_to_message_type_array(); |
| 874 | - return isset($reg_status_array[ $reg_status ]) ? $reg_status_array[ $reg_status ] : ''; |
|
| 874 | + return isset($reg_status_array[$reg_status]) ? $reg_status_array[$reg_status] : ''; |
|
| 875 | 875 | } |
| 876 | 876 | |
| 877 | 877 | |
@@ -909,7 +909,7 @@ discard block |
||
| 909 | 909 | public static function convert_payment_status_to_message_type($payment_status) |
| 910 | 910 | { |
| 911 | 911 | $payment_status_array = self::payment_status_to_message_type_array(); |
| 912 | - return isset($payment_status_array[ $payment_status ]) ? $payment_status_array[ $payment_status ] : ''; |
|
| 912 | + return isset($payment_status_array[$payment_status]) ? $payment_status_array[$payment_status] : ''; |
|
| 913 | 913 | } |
| 914 | 914 | |
| 915 | 915 | |
@@ -922,7 +922,7 @@ discard block |
||
| 922 | 922 | */ |
| 923 | 923 | public static function get_template_pack($template_pack_name) |
| 924 | 924 | { |
| 925 | - if (! self::$_template_pack_collection instanceof EE_Object_Collection) { |
|
| 925 | + if ( ! self::$_template_pack_collection instanceof EE_Object_Collection) { |
|
| 926 | 926 | self::$_template_pack_collection = new EE_Messages_Template_Pack_Collection(); |
| 927 | 927 | } |
| 928 | 928 | |
@@ -935,14 +935,14 @@ discard block |
||
| 935 | 935 | |
| 936 | 936 | // nope...let's get it. |
| 937 | 937 | // not set yet so let's attempt to get it. |
| 938 | - $pack_class_name = 'EE_Messages_Template_Pack_' . str_replace( |
|
| 938 | + $pack_class_name = 'EE_Messages_Template_Pack_'.str_replace( |
|
| 939 | 939 | ' ', |
| 940 | 940 | '_', |
| 941 | 941 | ucwords( |
| 942 | 942 | str_replace('_', ' ', $template_pack_name) |
| 943 | 943 | ) |
| 944 | 944 | ); |
| 945 | - if (! class_exists($pack_class_name) && $template_pack_name !== 'default') { |
|
| 945 | + if ( ! class_exists($pack_class_name) && $template_pack_name !== 'default') { |
|
| 946 | 946 | return self::get_template_pack('default'); |
| 947 | 947 | } else { |
| 948 | 948 | $template_pack = new $pack_class_name(); |
@@ -965,18 +965,18 @@ discard block |
||
| 965 | 965 | public static function get_template_pack_collection() |
| 966 | 966 | { |
| 967 | 967 | $new_collection = false; |
| 968 | - if (! self::$_template_pack_collection instanceof EE_Messages_Template_Pack_Collection) { |
|
| 968 | + if ( ! self::$_template_pack_collection instanceof EE_Messages_Template_Pack_Collection) { |
|
| 969 | 969 | self::$_template_pack_collection = new EE_Messages_Template_Pack_Collection(); |
| 970 | 970 | $new_collection = true; |
| 971 | 971 | } |
| 972 | 972 | |
| 973 | 973 | // glob the defaults directory for messages |
| 974 | - $templates = glob(EE_LIBRARIES . 'messages/defaults/*', GLOB_ONLYDIR); |
|
| 974 | + $templates = glob(EE_LIBRARIES.'messages/defaults/*', GLOB_ONLYDIR); |
|
| 975 | 975 | foreach ($templates as $template_path) { |
| 976 | 976 | // grab folder name |
| 977 | 977 | $template = basename($template_path); |
| 978 | 978 | |
| 979 | - if (! $new_collection) { |
|
| 979 | + if ( ! $new_collection) { |
|
| 980 | 980 | // already have it? |
| 981 | 981 | if (self::$_template_pack_collection->get_by_name($template) instanceof EE_Messages_Template_Pack) { |
| 982 | 982 | continue; |
@@ -984,7 +984,7 @@ discard block |
||
| 984 | 984 | } |
| 985 | 985 | |
| 986 | 986 | // setup classname. |
| 987 | - $template_pack_class_name = 'EE_Messages_Template_Pack_' . str_replace( |
|
| 987 | + $template_pack_class_name = 'EE_Messages_Template_Pack_'.str_replace( |
|
| 988 | 988 | ' ', |
| 989 | 989 | '_', |
| 990 | 990 | ucwords( |
@@ -995,7 +995,7 @@ discard block |
||
| 995 | 995 | ) |
| 996 | 996 | ) |
| 997 | 997 | ); |
| 998 | - if (! class_exists($template_pack_class_name)) { |
|
| 998 | + if ( ! class_exists($template_pack_class_name)) { |
|
| 999 | 999 | continue; |
| 1000 | 1000 | } |
| 1001 | 1001 | self::$_template_pack_collection->add(new $template_pack_class_name()); |
@@ -1037,7 +1037,7 @@ discard block |
||
| 1037 | 1037 | $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
| 1038 | 1038 | $messenger = $Message_Resource_Manager->valid_messenger($messenger_name); |
| 1039 | 1039 | $message_type = $Message_Resource_Manager->valid_message_type($message_type_name); |
| 1040 | - if (! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type, $global)) { |
|
| 1040 | + if ( ! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type, $global)) { |
|
| 1041 | 1041 | return array(); |
| 1042 | 1042 | } |
| 1043 | 1043 | // whew made it this far! Okay, let's go ahead and create the templates then |
@@ -1057,13 +1057,13 @@ discard block |
||
| 1057 | 1057 | protected static function _create_new_templates(EE_messenger $messenger, EE_message_type $message_type, $GRP_ID, $global) |
| 1058 | 1058 | { |
| 1059 | 1059 | // if we're creating a custom template then we don't need to use the defaults class |
| 1060 | - if (! $global) { |
|
| 1060 | + if ( ! $global) { |
|
| 1061 | 1061 | return EEH_MSG_Template::_create_custom_template_group($messenger, $message_type, $GRP_ID); |
| 1062 | 1062 | } |
| 1063 | 1063 | /** @type EE_Messages_Template_Defaults $Message_Template_Defaults */ |
| 1064 | 1064 | $Message_Template_Defaults = EE_Registry::factory( |
| 1065 | 1065 | 'EE_Messages_Template_Defaults', |
| 1066 | - array( $messenger, $message_type, $GRP_ID ) |
|
| 1066 | + array($messenger, $message_type, $GRP_ID) |
|
| 1067 | 1067 | ); |
| 1068 | 1068 | // generate templates |
| 1069 | 1069 | $success = $Message_Template_Defaults->create_new_templates(); |
@@ -1071,7 +1071,7 @@ discard block |
||
| 1071 | 1071 | // if creating the template failed. Then we should deactivate the related message_type for the messenger because |
| 1072 | 1072 | // its not active if it doesn't have a template. Note this is only happening for GLOBAL template creation |
| 1073 | 1073 | // attempts. |
| 1074 | - if (! $success) { |
|
| 1074 | + if ( ! $success) { |
|
| 1075 | 1075 | /** @var EE_Message_Resource_Manager $message_resource_manager */ |
| 1076 | 1076 | $message_resource_manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
| 1077 | 1077 | $message_resource_manager->deactivate_message_type_for_messenger($message_type->name, $messenger->name); |
@@ -1106,7 +1106,7 @@ discard block |
||
| 1106 | 1106 | private static function _create_custom_template_group(EE_messenger $messenger, EE_message_type $message_type, $GRP_ID) |
| 1107 | 1107 | { |
| 1108 | 1108 | // defaults |
| 1109 | - $success = array( 'GRP_ID' => null, 'MTP_context' => '' ); |
|
| 1109 | + $success = array('GRP_ID' => null, 'MTP_context' => ''); |
|
| 1110 | 1110 | // get the template group to use as a template from the db. If $GRP_ID is empty then we'll assume the base will be the global template matching the messenger and message type. |
| 1111 | 1111 | $Message_Template_Group = empty($GRP_ID) |
| 1112 | 1112 | ? EEM_Message_Template_Group::instance()->get_one( |
@@ -1120,7 +1120,7 @@ discard block |
||
| 1120 | 1120 | ) |
| 1121 | 1121 | : EEM_Message_Template_Group::instance()->get_one_by_ID($GRP_ID); |
| 1122 | 1122 | // if we don't have a mtg at this point then we need to bail. |
| 1123 | - if (! $Message_Template_Group instanceof EE_Message_Template_Group) { |
|
| 1123 | + if ( ! $Message_Template_Group instanceof EE_Message_Template_Group) { |
|
| 1124 | 1124 | EE_Error::add_error( |
| 1125 | 1125 | sprintf( |
| 1126 | 1126 | esc_html__( |
@@ -1169,7 +1169,7 @@ discard block |
||
| 1169 | 1169 | $success['template_name'] = $template_name; |
| 1170 | 1170 | // add new message templates and add relation to. |
| 1171 | 1171 | foreach ($message_templates as $message_template) { |
| 1172 | - if (! $message_template instanceof EE_Message_Template) { |
|
| 1172 | + if ( ! $message_template instanceof EE_Message_Template) { |
|
| 1173 | 1173 | continue; |
| 1174 | 1174 | } |
| 1175 | 1175 | $new_message_template = clone $message_template; |
@@ -1248,7 +1248,7 @@ discard block |
||
| 1248 | 1248 | $Message_Resource_Manager = EE_Registry::instance()->load_lib('Message_Resource_Manager'); |
| 1249 | 1249 | $messenger = $Message_Resource_Manager->valid_messenger($messenger_name); |
| 1250 | 1250 | $message_type = $Message_Resource_Manager->valid_message_type($message_type_name); |
| 1251 | - if (! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type)) { |
|
| 1251 | + if ( ! EEH_MSG_Template::message_type_has_active_templates_for_messenger($messenger, $message_type)) { |
|
| 1252 | 1252 | return array(); |
| 1253 | 1253 | } |
| 1254 | 1254 | |
@@ -1260,7 +1260,7 @@ discard block |
||
| 1260 | 1260 | if (in_array($field, $excluded_fields_for_messenger, true)) { |
| 1261 | 1261 | continue; |
| 1262 | 1262 | } |
| 1263 | - $template_fields[ $context ][ $field ] = $value; |
|
| 1263 | + $template_fields[$context][$field] = $value; |
|
| 1264 | 1264 | } |
| 1265 | 1265 | } |
| 1266 | 1266 | if (empty($template_fields)) { |
@@ -17,681 +17,681 @@ |
||
| 17 | 17 | */ |
| 18 | 18 | class EEH_Event_Query |
| 19 | 19 | { |
| 20 | - /** |
|
| 21 | - * Start Date |
|
| 22 | - * |
|
| 23 | - * @var $_event_query_month |
|
| 24 | - */ |
|
| 25 | - protected static $_event_query_month; |
|
| 26 | - |
|
| 27 | - /** |
|
| 28 | - * Category |
|
| 29 | - * |
|
| 30 | - * @var $_event_query_category |
|
| 31 | - */ |
|
| 32 | - protected static $_event_query_category; |
|
| 33 | - |
|
| 34 | - /** |
|
| 35 | - * whether to display expired events in the event list |
|
| 36 | - * |
|
| 37 | - * @var bool $_show_expired |
|
| 38 | - */ |
|
| 39 | - protected static $_event_query_show_expired = false; |
|
| 40 | - |
|
| 41 | - /** |
|
| 42 | - * list of params for controlling how the query results are ordered |
|
| 43 | - * |
|
| 44 | - * @var array $_event_query_orderby |
|
| 45 | - */ |
|
| 46 | - protected static $_event_query_orderby = []; |
|
| 47 | - |
|
| 48 | - /** |
|
| 49 | - * direction list is sorted |
|
| 50 | - * |
|
| 51 | - * @var string $_event_query_sort |
|
| 52 | - */ |
|
| 53 | - protected static $_event_query_sort; |
|
| 54 | - |
|
| 55 | - /** |
|
| 56 | - * list of params used to build the query's various clauses |
|
| 57 | - * |
|
| 58 | - * @var $_query_params |
|
| 59 | - */ |
|
| 60 | - protected static $_query_params = []; |
|
| 61 | - |
|
| 62 | - |
|
| 63 | - /** |
|
| 64 | - * @return void |
|
| 65 | - */ |
|
| 66 | - public static function add_query_filters() |
|
| 67 | - { |
|
| 68 | - // add query filters |
|
| 69 | - add_action('pre_get_posts', ['EEH_Event_Query', 'filter_query_parts'], 10, 1); |
|
| 70 | - } |
|
| 71 | - |
|
| 72 | - |
|
| 73 | - /** |
|
| 74 | - * @param WP_Query $WP_Query |
|
| 75 | - * @return bool |
|
| 76 | - */ |
|
| 77 | - public static function apply_query_filters(WP_Query $WP_Query) |
|
| 78 | - { |
|
| 79 | - return ( |
|
| 80 | - isset($WP_Query->query['post_type']) |
|
| 81 | - && $WP_Query->query['post_type'] === 'espresso_events' |
|
| 82 | - ) |
|
| 83 | - || apply_filters('FHEE__EEH_Event_Query__apply_query_filters', false); |
|
| 84 | - } |
|
| 85 | - |
|
| 86 | - |
|
| 87 | - /** |
|
| 88 | - * @param WP_Query $WP_Query |
|
| 89 | - */ |
|
| 90 | - public static function filter_query_parts(WP_Query $WP_Query) |
|
| 91 | - { |
|
| 92 | - // ONLY add our filters if this isn't the main wp_query, |
|
| 93 | - // because if this is the main wp_query we already have |
|
| 94 | - // our cpt strategies take care of adding things in. |
|
| 95 | - if ($WP_Query instanceof WP_Query && ! $WP_Query->is_main_query()) { |
|
| 96 | - // build event list query |
|
| 97 | - add_filter('posts_fields', ['EEH_Event_Query', 'posts_fields'], 10, 2); |
|
| 98 | - add_filter('posts_join', ['EEH_Event_Query', 'posts_join'], 10, 2); |
|
| 99 | - add_filter('posts_where', ['EEH_Event_Query', 'posts_where'], 10, 2); |
|
| 100 | - add_filter('posts_orderby', ['EEH_Event_Query', 'posts_orderby'], 10, 2); |
|
| 101 | - add_filter('posts_clauses_request', ['EEH_Event_Query', 'posts_clauses'], 10, 2); |
|
| 102 | - } |
|
| 103 | - } |
|
| 104 | - |
|
| 105 | - |
|
| 106 | - /** |
|
| 107 | - * @param string $month |
|
| 108 | - * @param string $category |
|
| 109 | - * @param bool $show_expired |
|
| 110 | - * @param array|string $orderby |
|
| 111 | - * @param string $sort |
|
| 112 | - * @throws InvalidArgumentException |
|
| 113 | - * @throws InvalidDataTypeException |
|
| 114 | - * @throws InvalidInterfaceException |
|
| 115 | - */ |
|
| 116 | - public static function set_query_params( |
|
| 117 | - $month = '', |
|
| 118 | - $category = '', |
|
| 119 | - $show_expired = false, |
|
| 120 | - $orderby = 'start_date', |
|
| 121 | - $sort = 'ASC' |
|
| 122 | - ) { |
|
| 123 | - self::$_query_params = []; |
|
| 124 | - EEH_Event_Query::$_event_query_month = EEH_Event_Query::_display_month($month); |
|
| 125 | - EEH_Event_Query::$_event_query_category = EEH_Event_Query::_event_category_slug($category); |
|
| 126 | - EEH_Event_Query::$_event_query_show_expired = EEH_Event_Query::_show_expired($show_expired); |
|
| 127 | - EEH_Event_Query::$_event_query_orderby = EEH_Event_Query::_orderby($orderby); |
|
| 128 | - EEH_Event_Query::$_event_query_sort = EEH_Event_Query::_sort($sort); |
|
| 129 | - } |
|
| 130 | - |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * what month should the event list display events for? |
|
| 134 | - * |
|
| 135 | - * @param string $month |
|
| 136 | - * @return string |
|
| 137 | - * @throws InvalidArgumentException |
|
| 138 | - * @throws InvalidDataTypeException |
|
| 139 | - * @throws InvalidInterfaceException |
|
| 140 | - */ |
|
| 141 | - private static function _display_month($month = '') |
|
| 142 | - { |
|
| 143 | - return self::getRequest()->getRequestParam('event_query_month', $month); |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - |
|
| 147 | - /** |
|
| 148 | - * @param string $category |
|
| 149 | - * @return string |
|
| 150 | - * @throws InvalidArgumentException |
|
| 151 | - * @throws InvalidDataTypeException |
|
| 152 | - * @throws InvalidInterfaceException |
|
| 153 | - */ |
|
| 154 | - private static function _event_category_slug($category = '') |
|
| 155 | - { |
|
| 156 | - return self::getRequest()->getRequestParam('event_query_category', $category); |
|
| 157 | - } |
|
| 158 | - |
|
| 159 | - |
|
| 160 | - /** |
|
| 161 | - * @param bool $show_expired |
|
| 162 | - * @return bool |
|
| 163 | - * @throws InvalidArgumentException |
|
| 164 | - * @throws InvalidDataTypeException |
|
| 165 | - * @throws InvalidInterfaceException |
|
| 166 | - */ |
|
| 167 | - private static function _show_expired($show_expired = false) |
|
| 168 | - { |
|
| 169 | - // override default expired option if set via filter |
|
| 170 | - return self::getRequest()->getRequestParam('event_query_show_expired', $show_expired, 'bool'); |
|
| 171 | - } |
|
| 172 | - |
|
| 173 | - |
|
| 174 | - /** |
|
| 175 | - * @param array|string $orderby |
|
| 176 | - * @return array |
|
| 177 | - * @throws InvalidArgumentException |
|
| 178 | - * @throws InvalidDataTypeException |
|
| 179 | - * @throws InvalidInterfaceException |
|
| 180 | - */ |
|
| 181 | - private static function _orderby($orderby = 'start_date') |
|
| 182 | - { |
|
| 183 | - $event_query_orderby = self::getRequest()->getRequestParam( |
|
| 184 | - 'event_query_orderby', |
|
| 185 | - (array) $orderby, |
|
| 186 | - DataType::STRING, |
|
| 187 | - true |
|
| 188 | - ); |
|
| 189 | - $event_query_orderby = is_array($event_query_orderby) |
|
| 190 | - ? $event_query_orderby |
|
| 191 | - : explode(',', $event_query_orderby); |
|
| 192 | - $event_query_orderby = array_map('trim', $event_query_orderby); |
|
| 193 | - return array_map('sanitize_text_field', $event_query_orderby); |
|
| 194 | - } |
|
| 195 | - |
|
| 196 | - |
|
| 197 | - /** |
|
| 198 | - * @param string $sort |
|
| 199 | - * @return string |
|
| 200 | - * @throws InvalidArgumentException |
|
| 201 | - * @throws InvalidDataTypeException |
|
| 202 | - * @throws InvalidInterfaceException |
|
| 203 | - */ |
|
| 204 | - private static function _sort($sort = 'ASC') |
|
| 205 | - { |
|
| 206 | - $sort = self::getRequest()->getRequestParam('event_query_sort', $sort); |
|
| 207 | - return in_array($sort, ['ASC', 'asc', 'DESC', 'desc'], true) |
|
| 208 | - ? strtoupper($sort) |
|
| 209 | - : 'ASC'; |
|
| 210 | - } |
|
| 211 | - |
|
| 212 | - |
|
| 213 | - /** |
|
| 214 | - * Filters the clauses for the WP_Query object |
|
| 215 | - * |
|
| 216 | - * @param array $clauses array of clauses |
|
| 217 | - * @param WP_Query $wp_query |
|
| 218 | - * @return array array of clauses |
|
| 219 | - */ |
|
| 220 | - public static function posts_clauses($clauses, WP_Query $wp_query) |
|
| 221 | - { |
|
| 222 | - if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 223 | - global $wpdb; |
|
| 224 | - $clauses['groupby'] = $wpdb->posts . '.ID '; |
|
| 225 | - } |
|
| 226 | - return $clauses; |
|
| 227 | - } |
|
| 228 | - |
|
| 229 | - |
|
| 230 | - /** |
|
| 231 | - * @param string $SQL |
|
| 232 | - * @param WP_Query $wp_query |
|
| 233 | - * @return string |
|
| 234 | - * @throws EE_Error |
|
| 235 | - * @throws InvalidArgumentException |
|
| 236 | - * @throws InvalidDataTypeException |
|
| 237 | - * @throws InvalidInterfaceException |
|
| 238 | - */ |
|
| 239 | - public static function posts_fields($SQL, WP_Query $wp_query) |
|
| 240 | - { |
|
| 241 | - if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 242 | - // adds something like ", wp_esp_datetime.* " to WP Query SELECT statement |
|
| 243 | - $SQL .= EEH_Event_Query::posts_fields_sql_for_orderby(EEH_Event_Query::$_event_query_orderby); |
|
| 244 | - } |
|
| 245 | - return $SQL; |
|
| 246 | - } |
|
| 247 | - |
|
| 248 | - |
|
| 249 | - /** |
|
| 250 | - * @param array $orderby_params |
|
| 251 | - * @return string |
|
| 252 | - * @throws EE_Error |
|
| 253 | - * @throws InvalidArgumentException |
|
| 254 | - * @throws InvalidDataTypeException |
|
| 255 | - * @throws InvalidInterfaceException |
|
| 256 | - */ |
|
| 257 | - public static function posts_fields_sql_for_orderby(array $orderby_params = []) |
|
| 258 | - { |
|
| 259 | - $SQL = ', MIN( ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start ) as event_start_date '; |
|
| 260 | - foreach ($orderby_params as $orderby) { |
|
| 261 | - switch ($orderby) { |
|
| 262 | - case 'ticket_start': |
|
| 263 | - $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_start_date'; |
|
| 264 | - break; |
|
| 265 | - case 'ticket_end': |
|
| 266 | - $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_end_date'; |
|
| 267 | - break; |
|
| 268 | - case 'venue_title': |
|
| 269 | - $SQL .= ', Venue.post_title AS venue_title'; |
|
| 270 | - break; |
|
| 271 | - case 'city': |
|
| 272 | - $SQL .= ', ' . EEM_Venue::instance()->second_table() . '.VNU_city'; |
|
| 273 | - break; |
|
| 274 | - case 'state': |
|
| 275 | - $SQL .= ', ' . EEM_State::instance()->table() . '.STA_name'; |
|
| 276 | - break; |
|
| 277 | - } |
|
| 278 | - } |
|
| 279 | - return $SQL; |
|
| 280 | - } |
|
| 281 | - |
|
| 282 | - |
|
| 283 | - /** |
|
| 284 | - * @param string $SQL |
|
| 285 | - * @param WP_Query $wp_query |
|
| 286 | - * @return string |
|
| 287 | - * @throws EE_Error |
|
| 288 | - * @throws InvalidArgumentException |
|
| 289 | - * @throws InvalidDataTypeException |
|
| 290 | - * @throws InvalidInterfaceException |
|
| 291 | - */ |
|
| 292 | - public static function posts_join($SQL, WP_Query $wp_query) |
|
| 293 | - { |
|
| 294 | - if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 295 | - // Category |
|
| 296 | - $SQL = EEH_Event_Query::posts_join_sql_for_show_expired($SQL, EEH_Event_Query::$_event_query_show_expired); |
|
| 297 | - $SQL = EEH_Event_Query::posts_join_sql_for_terms($SQL, EEH_Event_Query::$_event_query_category); |
|
| 298 | - $SQL = EEH_Event_Query::posts_join_for_orderby($SQL, EEH_Event_Query::$_event_query_orderby); |
|
| 299 | - } |
|
| 300 | - return $SQL; |
|
| 301 | - } |
|
| 302 | - |
|
| 303 | - |
|
| 304 | - /** |
|
| 305 | - * @param string $SQL |
|
| 306 | - * @param boolean $show_expired if TRUE, then displayed past events |
|
| 307 | - * @return string |
|
| 308 | - * @throws EE_Error |
|
| 309 | - * @throws InvalidArgumentException |
|
| 310 | - * @throws InvalidDataTypeException |
|
| 311 | - * @throws InvalidInterfaceException |
|
| 312 | - */ |
|
| 313 | - public static function posts_join_sql_for_show_expired($SQL = '', $show_expired = false) |
|
| 314 | - { |
|
| 315 | - if (! $show_expired) { |
|
| 316 | - $join = EEM_Event::instance()->table() . '.ID = '; |
|
| 317 | - $join .= EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
| 318 | - // don't add if this is already in the SQL |
|
| 319 | - if (strpos($SQL, $join) === false) { |
|
| 320 | - $SQL .= ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' ) '; |
|
| 321 | - } |
|
| 322 | - } |
|
| 323 | - return $SQL; |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - |
|
| 327 | - /** |
|
| 328 | - * @param string $SQL |
|
| 329 | - * @param string $join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get |
|
| 330 | - * used for anything yet |
|
| 331 | - * @return string |
|
| 332 | - */ |
|
| 333 | - public static function posts_join_sql_for_terms($SQL = '', $join_terms = '') |
|
| 334 | - { |
|
| 335 | - if (! empty($join_terms)) { |
|
| 336 | - global $wpdb; |
|
| 337 | - $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
|
| 338 | - $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
|
| 339 | - $SQL .= " LEFT JOIN $wpdb->terms ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) "; |
|
| 340 | - } |
|
| 341 | - return $SQL; |
|
| 342 | - } |
|
| 343 | - |
|
| 344 | - |
|
| 345 | - /** |
|
| 346 | - * usage: $SQL .= EEH_Event_Query::posts_join_for_orderby( $orderby_params ); |
|
| 347 | - * |
|
| 348 | - * @param string $SQL |
|
| 349 | - * @param array $orderby_params |
|
| 350 | - * @return string |
|
| 351 | - * @throws EE_Error |
|
| 352 | - * @throws InvalidArgumentException |
|
| 353 | - * @throws InvalidDataTypeException |
|
| 354 | - * @throws InvalidInterfaceException |
|
| 355 | - */ |
|
| 356 | - public static function posts_join_for_orderby($SQL = '', array $orderby_params = []) |
|
| 357 | - { |
|
| 358 | - foreach ($orderby_params as $orderby) { |
|
| 359 | - switch ($orderby) { |
|
| 360 | - case 'ticket_start': |
|
| 361 | - case 'ticket_end': |
|
| 362 | - $SQL .= EEH_Event_Query::_posts_join_for_datetime( |
|
| 363 | - $SQL, |
|
| 364 | - EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Datetime::instance()->primary_key_name() |
|
| 365 | - ); |
|
| 366 | - $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table(); |
|
| 367 | - $SQL .= ' ON ('; |
|
| 368 | - $SQL .= EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name(); |
|
| 369 | - $SQL .= ' = '; |
|
| 370 | - $SQL .= EEM_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name(); |
|
| 371 | - $SQL .= ' )'; |
|
| 372 | - break; |
|
| 373 | - case 'venue_title': |
|
| 374 | - case 'city': |
|
| 375 | - $SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL); |
|
| 376 | - break; |
|
| 377 | - case 'state': |
|
| 378 | - $SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL); |
|
| 379 | - $SQL .= EEH_Event_Query::_posts_join_for_venue_state($SQL); |
|
| 380 | - break; |
|
| 381 | - case 'start_date': |
|
| 382 | - default: |
|
| 383 | - $SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Event::instance()->table() . '.ID'); |
|
| 384 | - break; |
|
| 385 | - } |
|
| 386 | - } |
|
| 387 | - return $SQL; |
|
| 388 | - } |
|
| 389 | - |
|
| 390 | - |
|
| 391 | - /** |
|
| 392 | - * @param string $SQL |
|
| 393 | - * @param string $join |
|
| 394 | - * @return string |
|
| 395 | - * @throws EE_Error |
|
| 396 | - * @throws InvalidArgumentException |
|
| 397 | - * @throws InvalidDataTypeException |
|
| 398 | - * @throws InvalidInterfaceException |
|
| 399 | - */ |
|
| 400 | - protected static function _posts_join_for_datetime($SQL = '', $join = '') |
|
| 401 | - { |
|
| 402 | - if (! empty($join)) { |
|
| 403 | - $join .= ' = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
| 404 | - if (strpos($SQL, $join) === false) { |
|
| 405 | - return ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' )'; |
|
| 406 | - } |
|
| 407 | - } |
|
| 408 | - return ''; |
|
| 409 | - } |
|
| 410 | - |
|
| 411 | - |
|
| 412 | - /** |
|
| 413 | - * @param string $SQL |
|
| 414 | - * @return string |
|
| 415 | - * @throws EE_Error |
|
| 416 | - * @throws InvalidArgumentException |
|
| 417 | - * @throws InvalidDataTypeException |
|
| 418 | - * @throws InvalidInterfaceException |
|
| 419 | - * @throws ReflectionException |
|
| 420 | - */ |
|
| 421 | - protected static function _posts_join_for_event_venue(string $SQL = ''): string |
|
| 422 | - { |
|
| 423 | - // grab venue table PK name & event_meta table name |
|
| 424 | - $VNU_ID = EEM_Venue::instance()->primary_key_name(); |
|
| 425 | - $event_meta = EEM_Event::instance()->second_table(); |
|
| 426 | - // generate conditions for: Event <=> Venue JOIN clause |
|
| 427 | - $event_venue_join = "Venue.ID = $event_meta.$VNU_ID"; |
|
| 428 | - // don't add joins if they have already been added |
|
| 429 | - if (strpos($SQL, $event_venue_join) === false) { |
|
| 430 | - global $wpdb; |
|
| 431 | - // grab wp_posts (event), venue, and venue_meta table names |
|
| 432 | - $wp_posts = $wpdb->posts; |
|
| 433 | - $venue = EEM_Venue::instance()->table(); |
|
| 434 | - $venue_meta = EEM_Venue::instance()->second_table(); |
|
| 435 | - // generate JOIN clause for: Event <=> Event Meta |
|
| 436 | - $venue_SQL = " LEFT JOIN $event_meta ON ( $wp_posts.ID = $event_meta.EVT_ID )"; |
|
| 437 | - // generate JOIN clause for: Event Meta <=> Venue |
|
| 438 | - $venue_SQL .= " LEFT JOIN $venue AS Venue ON ( $event_venue_join )"; |
|
| 439 | - // generate JOIN clause for: Venue <=> Venue Meta |
|
| 440 | - $venue_SQL .= " LEFT JOIN $venue_meta ON ( Venue.ID = $venue_meta.$VNU_ID )"; |
|
| 441 | - unset($venue, $VNU_ID, $event_meta, $venue_meta, $event_venue_join); |
|
| 442 | - return $venue_SQL; |
|
| 443 | - } |
|
| 444 | - unset($VNU_ID, $event_meta, $event_venue_join); |
|
| 445 | - return ''; |
|
| 446 | - } |
|
| 447 | - |
|
| 448 | - |
|
| 449 | - /** |
|
| 450 | - * @param string $SQL |
|
| 451 | - * @return string |
|
| 452 | - * @throws EE_Error |
|
| 453 | - * @throws InvalidArgumentException |
|
| 454 | - * @throws InvalidDataTypeException |
|
| 455 | - * @throws InvalidInterfaceException |
|
| 456 | - */ |
|
| 457 | - protected static function _posts_join_for_venue_state($SQL = '') |
|
| 458 | - { |
|
| 459 | - // Venue Meta table name |
|
| 460 | - $venue_meta_table = EEM_Venue::instance()->second_table(); |
|
| 461 | - // State table name |
|
| 462 | - $state_table = EEM_State::instance()->table(); |
|
| 463 | - // State table pk |
|
| 464 | - $state_table_pk = EEM_State::instance()->primary_key_name(); |
|
| 465 | - // verify vars |
|
| 466 | - if ($venue_meta_table && $state_table && $state_table_pk) { |
|
| 467 | - // like: wp_esp_venue_meta.STA_ID = wp_esp_state.STA_ID |
|
| 468 | - $join = "$venue_meta_table.$state_table_pk = $state_table.$state_table_pk"; |
|
| 469 | - // don't add join if it has already been added |
|
| 470 | - if (strpos($SQL, $join) === false) { |
|
| 471 | - unset($state_table_pk, $venue_meta_table, $venue_table_pk); |
|
| 472 | - return " LEFT JOIN $state_table ON ( $join )"; |
|
| 473 | - } |
|
| 474 | - } |
|
| 475 | - unset($join, $state_table, $state_table_pk, $venue_meta_table, $venue_table_pk); |
|
| 476 | - return ''; |
|
| 477 | - } |
|
| 478 | - |
|
| 479 | - |
|
| 480 | - /** |
|
| 481 | - * @param string $SQL |
|
| 482 | - * @param WP_Query $wp_query |
|
| 483 | - * @return string |
|
| 484 | - * @throws EE_Error |
|
| 485 | - * @throws InvalidArgumentException |
|
| 486 | - * @throws InvalidDataTypeException |
|
| 487 | - * @throws InvalidInterfaceException |
|
| 488 | - */ |
|
| 489 | - public static function posts_where($SQL, WP_Query $wp_query) |
|
| 490 | - { |
|
| 491 | - if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 492 | - // Show Expired ? |
|
| 493 | - $SQL .= EEH_Event_Query::posts_where_sql_for_show_expired(EEH_Event_Query::$_event_query_show_expired); |
|
| 494 | - // Category |
|
| 495 | - $SQL .= EEH_Event_Query::posts_where_sql_for_event_category_slug(EEH_Event_Query::$_event_query_category); |
|
| 496 | - // Start Date |
|
| 497 | - $SQL .= EEH_Event_Query::posts_where_sql_for_event_list_month(EEH_Event_Query::$_event_query_month); |
|
| 498 | - // Trashed DateTimes |
|
| 499 | - $SQL .= EEH_Event_Query::posts_where_sql_for_non_trashed_datetimes(); |
|
| 500 | - } |
|
| 501 | - return $SQL; |
|
| 502 | - } |
|
| 503 | - |
|
| 504 | - |
|
| 505 | - /** |
|
| 506 | - * @param boolean $show_expired if TRUE, then displayed past events |
|
| 507 | - * @return string |
|
| 508 | - * @throws EE_Error |
|
| 509 | - * @throws InvalidArgumentException |
|
| 510 | - * @throws InvalidDataTypeException |
|
| 511 | - * @throws InvalidInterfaceException |
|
| 512 | - */ |
|
| 513 | - public static function posts_where_sql_for_show_expired($show_expired = false) |
|
| 514 | - { |
|
| 515 | - return ! $show_expired |
|
| 516 | - ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > \'' . current_time('mysql', true) . '\' ' |
|
| 517 | - : ''; |
|
| 518 | - } |
|
| 519 | - |
|
| 520 | - |
|
| 521 | - /** |
|
| 522 | - * @param boolean $event_category_slug |
|
| 523 | - * @return string |
|
| 524 | - */ |
|
| 525 | - public static function posts_where_sql_for_event_category_slug($event_category_slug = null) |
|
| 526 | - { |
|
| 527 | - global $wpdb; |
|
| 528 | - if (! empty($event_category_slug)) { |
|
| 529 | - $event_category_slugs_array = array_map('trim', explode(',', $event_category_slug)); |
|
| 530 | - $event_category_slugs_prepare = implode(', ', array_fill(0, count($event_category_slugs_array), '%s')); |
|
| 531 | - return $wpdb->prepare( |
|
| 532 | - " AND {$wpdb->terms}.slug IN ({$event_category_slugs_prepare}) ", |
|
| 533 | - $event_category_slugs_array |
|
| 534 | - ); |
|
| 535 | - } |
|
| 536 | - return ''; |
|
| 537 | - } |
|
| 538 | - |
|
| 539 | - |
|
| 540 | - /** |
|
| 541 | - * @param boolean $month |
|
| 542 | - * @return string |
|
| 543 | - * @throws EE_Error |
|
| 544 | - * @throws InvalidArgumentException |
|
| 545 | - * @throws InvalidDataTypeException |
|
| 546 | - * @throws InvalidInterfaceException |
|
| 547 | - */ |
|
| 548 | - public static function posts_where_sql_for_event_list_month($month = null) |
|
| 549 | - { |
|
| 550 | - $SQL = ''; |
|
| 551 | - if (! empty($month)) { |
|
| 552 | - $datetime_table = EEM_Datetime::instance()->table(); |
|
| 553 | - // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
|
| 554 | - $SQL = " AND {$datetime_table}.DTT_EVT_start <= '"; |
|
| 555 | - $SQL .= date('Y-m-t 23:59:59', EEH_DTT_Helper::first_of_month_timestamp($month)) . "'"; |
|
| 556 | - // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
|
| 557 | - $SQL .= " AND {$datetime_table}.DTT_EVT_end >= '"; |
|
| 558 | - $SQL .= date('Y-m-01 0:0:00', EEH_DTT_Helper::first_of_month_timestamp($month)) . "' "; |
|
| 559 | - } |
|
| 560 | - return $SQL; |
|
| 561 | - } |
|
| 562 | - |
|
| 563 | - /** |
|
| 564 | - * @return string |
|
| 565 | - * @throws EE_Error |
|
| 566 | - * @throws InvalidArgumentException |
|
| 567 | - * @throws InvalidDataTypeException |
|
| 568 | - * @throws InvalidInterfaceException |
|
| 569 | - */ |
|
| 570 | - public static function posts_where_sql_for_non_trashed_datetimes() |
|
| 571 | - { |
|
| 572 | - return ' AND ' . EEM_Datetime::instance()->table() . '.DTT_deleted = 0'; |
|
| 573 | - } |
|
| 574 | - |
|
| 575 | - |
|
| 576 | - |
|
| 577 | - /** |
|
| 578 | - * @param string $SQL |
|
| 579 | - * @param WP_Query $wp_query |
|
| 580 | - * @return string |
|
| 581 | - * @throws EE_Error |
|
| 582 | - * @throws InvalidArgumentException |
|
| 583 | - * @throws InvalidDataTypeException |
|
| 584 | - * @throws InvalidInterfaceException |
|
| 585 | - */ |
|
| 586 | - public static function posts_orderby($SQL, WP_Query $wp_query) |
|
| 587 | - { |
|
| 588 | - if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 589 | - $SQL = EEH_Event_Query::posts_orderby_sql( |
|
| 590 | - EEH_Event_Query::$_event_query_orderby, |
|
| 591 | - EEH_Event_Query::$_event_query_sort |
|
| 592 | - ); |
|
| 593 | - } |
|
| 594 | - return $SQL; |
|
| 595 | - } |
|
| 596 | - |
|
| 597 | - |
|
| 598 | - /** |
|
| 599 | - * posts_orderby_sql |
|
| 600 | - * possible parameters: |
|
| 601 | - * ID |
|
| 602 | - * start_date |
|
| 603 | - * end_date |
|
| 604 | - * event_name |
|
| 605 | - * category_slug |
|
| 606 | - * ticket_start |
|
| 607 | - * ticket_end |
|
| 608 | - * venue_title |
|
| 609 | - * city |
|
| 610 | - * state |
|
| 611 | - * **IMPORTANT** |
|
| 612 | - * make sure to also send the $orderby_params array to the posts_join_for_orderby() method |
|
| 613 | - * or else some of the table references below will result in MySQL errors |
|
| 614 | - * |
|
| 615 | - * @param array $orderby_params |
|
| 616 | - * @param string $sort |
|
| 617 | - * @return string |
|
| 618 | - * @throws EE_Error |
|
| 619 | - * @throws InvalidArgumentException |
|
| 620 | - * @throws InvalidDataTypeException |
|
| 621 | - * @throws InvalidInterfaceException |
|
| 622 | - */ |
|
| 623 | - public static function posts_orderby_sql(array $orderby_params = [], $sort = 'ASC') |
|
| 624 | - { |
|
| 625 | - global $wpdb; |
|
| 626 | - $SQL = ''; |
|
| 627 | - $counter = 0; |
|
| 628 | - $sort = in_array($sort, ['ASC', 'asc', 'DESC', 'desc'], true) |
|
| 629 | - ? strtoupper($sort) |
|
| 630 | - : 'ASC'; |
|
| 631 | - // make sure 'orderby' is set in query params |
|
| 632 | - if (! isset(self::$_query_params['orderby'])) { |
|
| 633 | - self::$_query_params['orderby'] = []; |
|
| 634 | - } |
|
| 635 | - // loop thru $orderby_params (type cast as array) |
|
| 636 | - foreach ($orderby_params as $orderby) { |
|
| 637 | - // check if we have already added this param |
|
| 638 | - if (isset(self::$_query_params['orderby'][ $orderby ])) { |
|
| 639 | - // if so then remove from the $orderby_params so that the count() method below is accurate |
|
| 640 | - unset($orderby_params[ $orderby ]); |
|
| 641 | - // then bump ahead to the next param |
|
| 642 | - continue; |
|
| 643 | - } |
|
| 644 | - // this will ad a comma depending on whether this is the first or last param |
|
| 645 | - $glue = $counter === 0 || $counter === count($orderby_params) ? ' ' : ', '; |
|
| 646 | - // ok what's we dealing with? |
|
| 647 | - switch ($orderby) { |
|
| 648 | - case 'id': |
|
| 649 | - case 'ID': |
|
| 650 | - $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
| 651 | - break; |
|
| 652 | - case 'end_date': |
|
| 653 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
| 654 | - break; |
|
| 655 | - case 'event_name': |
|
| 656 | - $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
| 657 | - break; |
|
| 658 | - case 'category_slug': |
|
| 659 | - $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
| 660 | - break; |
|
| 661 | - case 'ticket_start': |
|
| 662 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
| 663 | - break; |
|
| 664 | - case 'ticket_end': |
|
| 665 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
| 666 | - break; |
|
| 667 | - case 'venue_title': |
|
| 668 | - $SQL .= $glue . 'venue_title ' . $sort; |
|
| 669 | - break; |
|
| 670 | - case 'city': |
|
| 671 | - $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
| 672 | - break; |
|
| 673 | - case 'state': |
|
| 674 | - $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
| 675 | - break; |
|
| 676 | - case 'start_date': |
|
| 677 | - default: |
|
| 678 | - $SQL .= $glue . ' event_start_date ' . $sort; |
|
| 679 | - break; |
|
| 680 | - } |
|
| 681 | - // add to array of orderby params that have been added |
|
| 682 | - self::$_query_params['orderby'][ $orderby ] = true; |
|
| 683 | - $counter++; |
|
| 684 | - } |
|
| 685 | - return $SQL; |
|
| 686 | - } |
|
| 687 | - |
|
| 688 | - |
|
| 689 | - /** |
|
| 690 | - * @return RequestInterface |
|
| 691 | - * @since 4.10.14.p |
|
| 692 | - */ |
|
| 693 | - private static function getRequest() |
|
| 694 | - { |
|
| 695 | - return LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
| 696 | - } |
|
| 20 | + /** |
|
| 21 | + * Start Date |
|
| 22 | + * |
|
| 23 | + * @var $_event_query_month |
|
| 24 | + */ |
|
| 25 | + protected static $_event_query_month; |
|
| 26 | + |
|
| 27 | + /** |
|
| 28 | + * Category |
|
| 29 | + * |
|
| 30 | + * @var $_event_query_category |
|
| 31 | + */ |
|
| 32 | + protected static $_event_query_category; |
|
| 33 | + |
|
| 34 | + /** |
|
| 35 | + * whether to display expired events in the event list |
|
| 36 | + * |
|
| 37 | + * @var bool $_show_expired |
|
| 38 | + */ |
|
| 39 | + protected static $_event_query_show_expired = false; |
|
| 40 | + |
|
| 41 | + /** |
|
| 42 | + * list of params for controlling how the query results are ordered |
|
| 43 | + * |
|
| 44 | + * @var array $_event_query_orderby |
|
| 45 | + */ |
|
| 46 | + protected static $_event_query_orderby = []; |
|
| 47 | + |
|
| 48 | + /** |
|
| 49 | + * direction list is sorted |
|
| 50 | + * |
|
| 51 | + * @var string $_event_query_sort |
|
| 52 | + */ |
|
| 53 | + protected static $_event_query_sort; |
|
| 54 | + |
|
| 55 | + /** |
|
| 56 | + * list of params used to build the query's various clauses |
|
| 57 | + * |
|
| 58 | + * @var $_query_params |
|
| 59 | + */ |
|
| 60 | + protected static $_query_params = []; |
|
| 61 | + |
|
| 62 | + |
|
| 63 | + /** |
|
| 64 | + * @return void |
|
| 65 | + */ |
|
| 66 | + public static function add_query_filters() |
|
| 67 | + { |
|
| 68 | + // add query filters |
|
| 69 | + add_action('pre_get_posts', ['EEH_Event_Query', 'filter_query_parts'], 10, 1); |
|
| 70 | + } |
|
| 71 | + |
|
| 72 | + |
|
| 73 | + /** |
|
| 74 | + * @param WP_Query $WP_Query |
|
| 75 | + * @return bool |
|
| 76 | + */ |
|
| 77 | + public static function apply_query_filters(WP_Query $WP_Query) |
|
| 78 | + { |
|
| 79 | + return ( |
|
| 80 | + isset($WP_Query->query['post_type']) |
|
| 81 | + && $WP_Query->query['post_type'] === 'espresso_events' |
|
| 82 | + ) |
|
| 83 | + || apply_filters('FHEE__EEH_Event_Query__apply_query_filters', false); |
|
| 84 | + } |
|
| 85 | + |
|
| 86 | + |
|
| 87 | + /** |
|
| 88 | + * @param WP_Query $WP_Query |
|
| 89 | + */ |
|
| 90 | + public static function filter_query_parts(WP_Query $WP_Query) |
|
| 91 | + { |
|
| 92 | + // ONLY add our filters if this isn't the main wp_query, |
|
| 93 | + // because if this is the main wp_query we already have |
|
| 94 | + // our cpt strategies take care of adding things in. |
|
| 95 | + if ($WP_Query instanceof WP_Query && ! $WP_Query->is_main_query()) { |
|
| 96 | + // build event list query |
|
| 97 | + add_filter('posts_fields', ['EEH_Event_Query', 'posts_fields'], 10, 2); |
|
| 98 | + add_filter('posts_join', ['EEH_Event_Query', 'posts_join'], 10, 2); |
|
| 99 | + add_filter('posts_where', ['EEH_Event_Query', 'posts_where'], 10, 2); |
|
| 100 | + add_filter('posts_orderby', ['EEH_Event_Query', 'posts_orderby'], 10, 2); |
|
| 101 | + add_filter('posts_clauses_request', ['EEH_Event_Query', 'posts_clauses'], 10, 2); |
|
| 102 | + } |
|
| 103 | + } |
|
| 104 | + |
|
| 105 | + |
|
| 106 | + /** |
|
| 107 | + * @param string $month |
|
| 108 | + * @param string $category |
|
| 109 | + * @param bool $show_expired |
|
| 110 | + * @param array|string $orderby |
|
| 111 | + * @param string $sort |
|
| 112 | + * @throws InvalidArgumentException |
|
| 113 | + * @throws InvalidDataTypeException |
|
| 114 | + * @throws InvalidInterfaceException |
|
| 115 | + */ |
|
| 116 | + public static function set_query_params( |
|
| 117 | + $month = '', |
|
| 118 | + $category = '', |
|
| 119 | + $show_expired = false, |
|
| 120 | + $orderby = 'start_date', |
|
| 121 | + $sort = 'ASC' |
|
| 122 | + ) { |
|
| 123 | + self::$_query_params = []; |
|
| 124 | + EEH_Event_Query::$_event_query_month = EEH_Event_Query::_display_month($month); |
|
| 125 | + EEH_Event_Query::$_event_query_category = EEH_Event_Query::_event_category_slug($category); |
|
| 126 | + EEH_Event_Query::$_event_query_show_expired = EEH_Event_Query::_show_expired($show_expired); |
|
| 127 | + EEH_Event_Query::$_event_query_orderby = EEH_Event_Query::_orderby($orderby); |
|
| 128 | + EEH_Event_Query::$_event_query_sort = EEH_Event_Query::_sort($sort); |
|
| 129 | + } |
|
| 130 | + |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * what month should the event list display events for? |
|
| 134 | + * |
|
| 135 | + * @param string $month |
|
| 136 | + * @return string |
|
| 137 | + * @throws InvalidArgumentException |
|
| 138 | + * @throws InvalidDataTypeException |
|
| 139 | + * @throws InvalidInterfaceException |
|
| 140 | + */ |
|
| 141 | + private static function _display_month($month = '') |
|
| 142 | + { |
|
| 143 | + return self::getRequest()->getRequestParam('event_query_month', $month); |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + |
|
| 147 | + /** |
|
| 148 | + * @param string $category |
|
| 149 | + * @return string |
|
| 150 | + * @throws InvalidArgumentException |
|
| 151 | + * @throws InvalidDataTypeException |
|
| 152 | + * @throws InvalidInterfaceException |
|
| 153 | + */ |
|
| 154 | + private static function _event_category_slug($category = '') |
|
| 155 | + { |
|
| 156 | + return self::getRequest()->getRequestParam('event_query_category', $category); |
|
| 157 | + } |
|
| 158 | + |
|
| 159 | + |
|
| 160 | + /** |
|
| 161 | + * @param bool $show_expired |
|
| 162 | + * @return bool |
|
| 163 | + * @throws InvalidArgumentException |
|
| 164 | + * @throws InvalidDataTypeException |
|
| 165 | + * @throws InvalidInterfaceException |
|
| 166 | + */ |
|
| 167 | + private static function _show_expired($show_expired = false) |
|
| 168 | + { |
|
| 169 | + // override default expired option if set via filter |
|
| 170 | + return self::getRequest()->getRequestParam('event_query_show_expired', $show_expired, 'bool'); |
|
| 171 | + } |
|
| 172 | + |
|
| 173 | + |
|
| 174 | + /** |
|
| 175 | + * @param array|string $orderby |
|
| 176 | + * @return array |
|
| 177 | + * @throws InvalidArgumentException |
|
| 178 | + * @throws InvalidDataTypeException |
|
| 179 | + * @throws InvalidInterfaceException |
|
| 180 | + */ |
|
| 181 | + private static function _orderby($orderby = 'start_date') |
|
| 182 | + { |
|
| 183 | + $event_query_orderby = self::getRequest()->getRequestParam( |
|
| 184 | + 'event_query_orderby', |
|
| 185 | + (array) $orderby, |
|
| 186 | + DataType::STRING, |
|
| 187 | + true |
|
| 188 | + ); |
|
| 189 | + $event_query_orderby = is_array($event_query_orderby) |
|
| 190 | + ? $event_query_orderby |
|
| 191 | + : explode(',', $event_query_orderby); |
|
| 192 | + $event_query_orderby = array_map('trim', $event_query_orderby); |
|
| 193 | + return array_map('sanitize_text_field', $event_query_orderby); |
|
| 194 | + } |
|
| 195 | + |
|
| 196 | + |
|
| 197 | + /** |
|
| 198 | + * @param string $sort |
|
| 199 | + * @return string |
|
| 200 | + * @throws InvalidArgumentException |
|
| 201 | + * @throws InvalidDataTypeException |
|
| 202 | + * @throws InvalidInterfaceException |
|
| 203 | + */ |
|
| 204 | + private static function _sort($sort = 'ASC') |
|
| 205 | + { |
|
| 206 | + $sort = self::getRequest()->getRequestParam('event_query_sort', $sort); |
|
| 207 | + return in_array($sort, ['ASC', 'asc', 'DESC', 'desc'], true) |
|
| 208 | + ? strtoupper($sort) |
|
| 209 | + : 'ASC'; |
|
| 210 | + } |
|
| 211 | + |
|
| 212 | + |
|
| 213 | + /** |
|
| 214 | + * Filters the clauses for the WP_Query object |
|
| 215 | + * |
|
| 216 | + * @param array $clauses array of clauses |
|
| 217 | + * @param WP_Query $wp_query |
|
| 218 | + * @return array array of clauses |
|
| 219 | + */ |
|
| 220 | + public static function posts_clauses($clauses, WP_Query $wp_query) |
|
| 221 | + { |
|
| 222 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 223 | + global $wpdb; |
|
| 224 | + $clauses['groupby'] = $wpdb->posts . '.ID '; |
|
| 225 | + } |
|
| 226 | + return $clauses; |
|
| 227 | + } |
|
| 228 | + |
|
| 229 | + |
|
| 230 | + /** |
|
| 231 | + * @param string $SQL |
|
| 232 | + * @param WP_Query $wp_query |
|
| 233 | + * @return string |
|
| 234 | + * @throws EE_Error |
|
| 235 | + * @throws InvalidArgumentException |
|
| 236 | + * @throws InvalidDataTypeException |
|
| 237 | + * @throws InvalidInterfaceException |
|
| 238 | + */ |
|
| 239 | + public static function posts_fields($SQL, WP_Query $wp_query) |
|
| 240 | + { |
|
| 241 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 242 | + // adds something like ", wp_esp_datetime.* " to WP Query SELECT statement |
|
| 243 | + $SQL .= EEH_Event_Query::posts_fields_sql_for_orderby(EEH_Event_Query::$_event_query_orderby); |
|
| 244 | + } |
|
| 245 | + return $SQL; |
|
| 246 | + } |
|
| 247 | + |
|
| 248 | + |
|
| 249 | + /** |
|
| 250 | + * @param array $orderby_params |
|
| 251 | + * @return string |
|
| 252 | + * @throws EE_Error |
|
| 253 | + * @throws InvalidArgumentException |
|
| 254 | + * @throws InvalidDataTypeException |
|
| 255 | + * @throws InvalidInterfaceException |
|
| 256 | + */ |
|
| 257 | + public static function posts_fields_sql_for_orderby(array $orderby_params = []) |
|
| 258 | + { |
|
| 259 | + $SQL = ', MIN( ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start ) as event_start_date '; |
|
| 260 | + foreach ($orderby_params as $orderby) { |
|
| 261 | + switch ($orderby) { |
|
| 262 | + case 'ticket_start': |
|
| 263 | + $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_start_date'; |
|
| 264 | + break; |
|
| 265 | + case 'ticket_end': |
|
| 266 | + $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_end_date'; |
|
| 267 | + break; |
|
| 268 | + case 'venue_title': |
|
| 269 | + $SQL .= ', Venue.post_title AS venue_title'; |
|
| 270 | + break; |
|
| 271 | + case 'city': |
|
| 272 | + $SQL .= ', ' . EEM_Venue::instance()->second_table() . '.VNU_city'; |
|
| 273 | + break; |
|
| 274 | + case 'state': |
|
| 275 | + $SQL .= ', ' . EEM_State::instance()->table() . '.STA_name'; |
|
| 276 | + break; |
|
| 277 | + } |
|
| 278 | + } |
|
| 279 | + return $SQL; |
|
| 280 | + } |
|
| 281 | + |
|
| 282 | + |
|
| 283 | + /** |
|
| 284 | + * @param string $SQL |
|
| 285 | + * @param WP_Query $wp_query |
|
| 286 | + * @return string |
|
| 287 | + * @throws EE_Error |
|
| 288 | + * @throws InvalidArgumentException |
|
| 289 | + * @throws InvalidDataTypeException |
|
| 290 | + * @throws InvalidInterfaceException |
|
| 291 | + */ |
|
| 292 | + public static function posts_join($SQL, WP_Query $wp_query) |
|
| 293 | + { |
|
| 294 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 295 | + // Category |
|
| 296 | + $SQL = EEH_Event_Query::posts_join_sql_for_show_expired($SQL, EEH_Event_Query::$_event_query_show_expired); |
|
| 297 | + $SQL = EEH_Event_Query::posts_join_sql_for_terms($SQL, EEH_Event_Query::$_event_query_category); |
|
| 298 | + $SQL = EEH_Event_Query::posts_join_for_orderby($SQL, EEH_Event_Query::$_event_query_orderby); |
|
| 299 | + } |
|
| 300 | + return $SQL; |
|
| 301 | + } |
|
| 302 | + |
|
| 303 | + |
|
| 304 | + /** |
|
| 305 | + * @param string $SQL |
|
| 306 | + * @param boolean $show_expired if TRUE, then displayed past events |
|
| 307 | + * @return string |
|
| 308 | + * @throws EE_Error |
|
| 309 | + * @throws InvalidArgumentException |
|
| 310 | + * @throws InvalidDataTypeException |
|
| 311 | + * @throws InvalidInterfaceException |
|
| 312 | + */ |
|
| 313 | + public static function posts_join_sql_for_show_expired($SQL = '', $show_expired = false) |
|
| 314 | + { |
|
| 315 | + if (! $show_expired) { |
|
| 316 | + $join = EEM_Event::instance()->table() . '.ID = '; |
|
| 317 | + $join .= EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
| 318 | + // don't add if this is already in the SQL |
|
| 319 | + if (strpos($SQL, $join) === false) { |
|
| 320 | + $SQL .= ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' ) '; |
|
| 321 | + } |
|
| 322 | + } |
|
| 323 | + return $SQL; |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + |
|
| 327 | + /** |
|
| 328 | + * @param string $SQL |
|
| 329 | + * @param string $join_terms pass TRUE or term string, doesn't really matter since this value doesn't really get |
|
| 330 | + * used for anything yet |
|
| 331 | + * @return string |
|
| 332 | + */ |
|
| 333 | + public static function posts_join_sql_for_terms($SQL = '', $join_terms = '') |
|
| 334 | + { |
|
| 335 | + if (! empty($join_terms)) { |
|
| 336 | + global $wpdb; |
|
| 337 | + $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
|
| 338 | + $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
|
| 339 | + $SQL .= " LEFT JOIN $wpdb->terms ON ($wpdb->terms.term_id = $wpdb->term_taxonomy.term_id) "; |
|
| 340 | + } |
|
| 341 | + return $SQL; |
|
| 342 | + } |
|
| 343 | + |
|
| 344 | + |
|
| 345 | + /** |
|
| 346 | + * usage: $SQL .= EEH_Event_Query::posts_join_for_orderby( $orderby_params ); |
|
| 347 | + * |
|
| 348 | + * @param string $SQL |
|
| 349 | + * @param array $orderby_params |
|
| 350 | + * @return string |
|
| 351 | + * @throws EE_Error |
|
| 352 | + * @throws InvalidArgumentException |
|
| 353 | + * @throws InvalidDataTypeException |
|
| 354 | + * @throws InvalidInterfaceException |
|
| 355 | + */ |
|
| 356 | + public static function posts_join_for_orderby($SQL = '', array $orderby_params = []) |
|
| 357 | + { |
|
| 358 | + foreach ($orderby_params as $orderby) { |
|
| 359 | + switch ($orderby) { |
|
| 360 | + case 'ticket_start': |
|
| 361 | + case 'ticket_end': |
|
| 362 | + $SQL .= EEH_Event_Query::_posts_join_for_datetime( |
|
| 363 | + $SQL, |
|
| 364 | + EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Datetime::instance()->primary_key_name() |
|
| 365 | + ); |
|
| 366 | + $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table(); |
|
| 367 | + $SQL .= ' ON ('; |
|
| 368 | + $SQL .= EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name(); |
|
| 369 | + $SQL .= ' = '; |
|
| 370 | + $SQL .= EEM_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name(); |
|
| 371 | + $SQL .= ' )'; |
|
| 372 | + break; |
|
| 373 | + case 'venue_title': |
|
| 374 | + case 'city': |
|
| 375 | + $SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL); |
|
| 376 | + break; |
|
| 377 | + case 'state': |
|
| 378 | + $SQL .= EEH_Event_Query::_posts_join_for_event_venue($SQL); |
|
| 379 | + $SQL .= EEH_Event_Query::_posts_join_for_venue_state($SQL); |
|
| 380 | + break; |
|
| 381 | + case 'start_date': |
|
| 382 | + default: |
|
| 383 | + $SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Event::instance()->table() . '.ID'); |
|
| 384 | + break; |
|
| 385 | + } |
|
| 386 | + } |
|
| 387 | + return $SQL; |
|
| 388 | + } |
|
| 389 | + |
|
| 390 | + |
|
| 391 | + /** |
|
| 392 | + * @param string $SQL |
|
| 393 | + * @param string $join |
|
| 394 | + * @return string |
|
| 395 | + * @throws EE_Error |
|
| 396 | + * @throws InvalidArgumentException |
|
| 397 | + * @throws InvalidDataTypeException |
|
| 398 | + * @throws InvalidInterfaceException |
|
| 399 | + */ |
|
| 400 | + protected static function _posts_join_for_datetime($SQL = '', $join = '') |
|
| 401 | + { |
|
| 402 | + if (! empty($join)) { |
|
| 403 | + $join .= ' = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
| 404 | + if (strpos($SQL, $join) === false) { |
|
| 405 | + return ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' )'; |
|
| 406 | + } |
|
| 407 | + } |
|
| 408 | + return ''; |
|
| 409 | + } |
|
| 410 | + |
|
| 411 | + |
|
| 412 | + /** |
|
| 413 | + * @param string $SQL |
|
| 414 | + * @return string |
|
| 415 | + * @throws EE_Error |
|
| 416 | + * @throws InvalidArgumentException |
|
| 417 | + * @throws InvalidDataTypeException |
|
| 418 | + * @throws InvalidInterfaceException |
|
| 419 | + * @throws ReflectionException |
|
| 420 | + */ |
|
| 421 | + protected static function _posts_join_for_event_venue(string $SQL = ''): string |
|
| 422 | + { |
|
| 423 | + // grab venue table PK name & event_meta table name |
|
| 424 | + $VNU_ID = EEM_Venue::instance()->primary_key_name(); |
|
| 425 | + $event_meta = EEM_Event::instance()->second_table(); |
|
| 426 | + // generate conditions for: Event <=> Venue JOIN clause |
|
| 427 | + $event_venue_join = "Venue.ID = $event_meta.$VNU_ID"; |
|
| 428 | + // don't add joins if they have already been added |
|
| 429 | + if (strpos($SQL, $event_venue_join) === false) { |
|
| 430 | + global $wpdb; |
|
| 431 | + // grab wp_posts (event), venue, and venue_meta table names |
|
| 432 | + $wp_posts = $wpdb->posts; |
|
| 433 | + $venue = EEM_Venue::instance()->table(); |
|
| 434 | + $venue_meta = EEM_Venue::instance()->second_table(); |
|
| 435 | + // generate JOIN clause for: Event <=> Event Meta |
|
| 436 | + $venue_SQL = " LEFT JOIN $event_meta ON ( $wp_posts.ID = $event_meta.EVT_ID )"; |
|
| 437 | + // generate JOIN clause for: Event Meta <=> Venue |
|
| 438 | + $venue_SQL .= " LEFT JOIN $venue AS Venue ON ( $event_venue_join )"; |
|
| 439 | + // generate JOIN clause for: Venue <=> Venue Meta |
|
| 440 | + $venue_SQL .= " LEFT JOIN $venue_meta ON ( Venue.ID = $venue_meta.$VNU_ID )"; |
|
| 441 | + unset($venue, $VNU_ID, $event_meta, $venue_meta, $event_venue_join); |
|
| 442 | + return $venue_SQL; |
|
| 443 | + } |
|
| 444 | + unset($VNU_ID, $event_meta, $event_venue_join); |
|
| 445 | + return ''; |
|
| 446 | + } |
|
| 447 | + |
|
| 448 | + |
|
| 449 | + /** |
|
| 450 | + * @param string $SQL |
|
| 451 | + * @return string |
|
| 452 | + * @throws EE_Error |
|
| 453 | + * @throws InvalidArgumentException |
|
| 454 | + * @throws InvalidDataTypeException |
|
| 455 | + * @throws InvalidInterfaceException |
|
| 456 | + */ |
|
| 457 | + protected static function _posts_join_for_venue_state($SQL = '') |
|
| 458 | + { |
|
| 459 | + // Venue Meta table name |
|
| 460 | + $venue_meta_table = EEM_Venue::instance()->second_table(); |
|
| 461 | + // State table name |
|
| 462 | + $state_table = EEM_State::instance()->table(); |
|
| 463 | + // State table pk |
|
| 464 | + $state_table_pk = EEM_State::instance()->primary_key_name(); |
|
| 465 | + // verify vars |
|
| 466 | + if ($venue_meta_table && $state_table && $state_table_pk) { |
|
| 467 | + // like: wp_esp_venue_meta.STA_ID = wp_esp_state.STA_ID |
|
| 468 | + $join = "$venue_meta_table.$state_table_pk = $state_table.$state_table_pk"; |
|
| 469 | + // don't add join if it has already been added |
|
| 470 | + if (strpos($SQL, $join) === false) { |
|
| 471 | + unset($state_table_pk, $venue_meta_table, $venue_table_pk); |
|
| 472 | + return " LEFT JOIN $state_table ON ( $join )"; |
|
| 473 | + } |
|
| 474 | + } |
|
| 475 | + unset($join, $state_table, $state_table_pk, $venue_meta_table, $venue_table_pk); |
|
| 476 | + return ''; |
|
| 477 | + } |
|
| 478 | + |
|
| 479 | + |
|
| 480 | + /** |
|
| 481 | + * @param string $SQL |
|
| 482 | + * @param WP_Query $wp_query |
|
| 483 | + * @return string |
|
| 484 | + * @throws EE_Error |
|
| 485 | + * @throws InvalidArgumentException |
|
| 486 | + * @throws InvalidDataTypeException |
|
| 487 | + * @throws InvalidInterfaceException |
|
| 488 | + */ |
|
| 489 | + public static function posts_where($SQL, WP_Query $wp_query) |
|
| 490 | + { |
|
| 491 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 492 | + // Show Expired ? |
|
| 493 | + $SQL .= EEH_Event_Query::posts_where_sql_for_show_expired(EEH_Event_Query::$_event_query_show_expired); |
|
| 494 | + // Category |
|
| 495 | + $SQL .= EEH_Event_Query::posts_where_sql_for_event_category_slug(EEH_Event_Query::$_event_query_category); |
|
| 496 | + // Start Date |
|
| 497 | + $SQL .= EEH_Event_Query::posts_where_sql_for_event_list_month(EEH_Event_Query::$_event_query_month); |
|
| 498 | + // Trashed DateTimes |
|
| 499 | + $SQL .= EEH_Event_Query::posts_where_sql_for_non_trashed_datetimes(); |
|
| 500 | + } |
|
| 501 | + return $SQL; |
|
| 502 | + } |
|
| 503 | + |
|
| 504 | + |
|
| 505 | + /** |
|
| 506 | + * @param boolean $show_expired if TRUE, then displayed past events |
|
| 507 | + * @return string |
|
| 508 | + * @throws EE_Error |
|
| 509 | + * @throws InvalidArgumentException |
|
| 510 | + * @throws InvalidDataTypeException |
|
| 511 | + * @throws InvalidInterfaceException |
|
| 512 | + */ |
|
| 513 | + public static function posts_where_sql_for_show_expired($show_expired = false) |
|
| 514 | + { |
|
| 515 | + return ! $show_expired |
|
| 516 | + ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > \'' . current_time('mysql', true) . '\' ' |
|
| 517 | + : ''; |
|
| 518 | + } |
|
| 519 | + |
|
| 520 | + |
|
| 521 | + /** |
|
| 522 | + * @param boolean $event_category_slug |
|
| 523 | + * @return string |
|
| 524 | + */ |
|
| 525 | + public static function posts_where_sql_for_event_category_slug($event_category_slug = null) |
|
| 526 | + { |
|
| 527 | + global $wpdb; |
|
| 528 | + if (! empty($event_category_slug)) { |
|
| 529 | + $event_category_slugs_array = array_map('trim', explode(',', $event_category_slug)); |
|
| 530 | + $event_category_slugs_prepare = implode(', ', array_fill(0, count($event_category_slugs_array), '%s')); |
|
| 531 | + return $wpdb->prepare( |
|
| 532 | + " AND {$wpdb->terms}.slug IN ({$event_category_slugs_prepare}) ", |
|
| 533 | + $event_category_slugs_array |
|
| 534 | + ); |
|
| 535 | + } |
|
| 536 | + return ''; |
|
| 537 | + } |
|
| 538 | + |
|
| 539 | + |
|
| 540 | + /** |
|
| 541 | + * @param boolean $month |
|
| 542 | + * @return string |
|
| 543 | + * @throws EE_Error |
|
| 544 | + * @throws InvalidArgumentException |
|
| 545 | + * @throws InvalidDataTypeException |
|
| 546 | + * @throws InvalidInterfaceException |
|
| 547 | + */ |
|
| 548 | + public static function posts_where_sql_for_event_list_month($month = null) |
|
| 549 | + { |
|
| 550 | + $SQL = ''; |
|
| 551 | + if (! empty($month)) { |
|
| 552 | + $datetime_table = EEM_Datetime::instance()->table(); |
|
| 553 | + // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
|
| 554 | + $SQL = " AND {$datetime_table}.DTT_EVT_start <= '"; |
|
| 555 | + $SQL .= date('Y-m-t 23:59:59', EEH_DTT_Helper::first_of_month_timestamp($month)) . "'"; |
|
| 556 | + // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
|
| 557 | + $SQL .= " AND {$datetime_table}.DTT_EVT_end >= '"; |
|
| 558 | + $SQL .= date('Y-m-01 0:0:00', EEH_DTT_Helper::first_of_month_timestamp($month)) . "' "; |
|
| 559 | + } |
|
| 560 | + return $SQL; |
|
| 561 | + } |
|
| 562 | + |
|
| 563 | + /** |
|
| 564 | + * @return string |
|
| 565 | + * @throws EE_Error |
|
| 566 | + * @throws InvalidArgumentException |
|
| 567 | + * @throws InvalidDataTypeException |
|
| 568 | + * @throws InvalidInterfaceException |
|
| 569 | + */ |
|
| 570 | + public static function posts_where_sql_for_non_trashed_datetimes() |
|
| 571 | + { |
|
| 572 | + return ' AND ' . EEM_Datetime::instance()->table() . '.DTT_deleted = 0'; |
|
| 573 | + } |
|
| 574 | + |
|
| 575 | + |
|
| 576 | + |
|
| 577 | + /** |
|
| 578 | + * @param string $SQL |
|
| 579 | + * @param WP_Query $wp_query |
|
| 580 | + * @return string |
|
| 581 | + * @throws EE_Error |
|
| 582 | + * @throws InvalidArgumentException |
|
| 583 | + * @throws InvalidDataTypeException |
|
| 584 | + * @throws InvalidInterfaceException |
|
| 585 | + */ |
|
| 586 | + public static function posts_orderby($SQL, WP_Query $wp_query) |
|
| 587 | + { |
|
| 588 | + if (EEH_Event_Query::apply_query_filters($wp_query)) { |
|
| 589 | + $SQL = EEH_Event_Query::posts_orderby_sql( |
|
| 590 | + EEH_Event_Query::$_event_query_orderby, |
|
| 591 | + EEH_Event_Query::$_event_query_sort |
|
| 592 | + ); |
|
| 593 | + } |
|
| 594 | + return $SQL; |
|
| 595 | + } |
|
| 596 | + |
|
| 597 | + |
|
| 598 | + /** |
|
| 599 | + * posts_orderby_sql |
|
| 600 | + * possible parameters: |
|
| 601 | + * ID |
|
| 602 | + * start_date |
|
| 603 | + * end_date |
|
| 604 | + * event_name |
|
| 605 | + * category_slug |
|
| 606 | + * ticket_start |
|
| 607 | + * ticket_end |
|
| 608 | + * venue_title |
|
| 609 | + * city |
|
| 610 | + * state |
|
| 611 | + * **IMPORTANT** |
|
| 612 | + * make sure to also send the $orderby_params array to the posts_join_for_orderby() method |
|
| 613 | + * or else some of the table references below will result in MySQL errors |
|
| 614 | + * |
|
| 615 | + * @param array $orderby_params |
|
| 616 | + * @param string $sort |
|
| 617 | + * @return string |
|
| 618 | + * @throws EE_Error |
|
| 619 | + * @throws InvalidArgumentException |
|
| 620 | + * @throws InvalidDataTypeException |
|
| 621 | + * @throws InvalidInterfaceException |
|
| 622 | + */ |
|
| 623 | + public static function posts_orderby_sql(array $orderby_params = [], $sort = 'ASC') |
|
| 624 | + { |
|
| 625 | + global $wpdb; |
|
| 626 | + $SQL = ''; |
|
| 627 | + $counter = 0; |
|
| 628 | + $sort = in_array($sort, ['ASC', 'asc', 'DESC', 'desc'], true) |
|
| 629 | + ? strtoupper($sort) |
|
| 630 | + : 'ASC'; |
|
| 631 | + // make sure 'orderby' is set in query params |
|
| 632 | + if (! isset(self::$_query_params['orderby'])) { |
|
| 633 | + self::$_query_params['orderby'] = []; |
|
| 634 | + } |
|
| 635 | + // loop thru $orderby_params (type cast as array) |
|
| 636 | + foreach ($orderby_params as $orderby) { |
|
| 637 | + // check if we have already added this param |
|
| 638 | + if (isset(self::$_query_params['orderby'][ $orderby ])) { |
|
| 639 | + // if so then remove from the $orderby_params so that the count() method below is accurate |
|
| 640 | + unset($orderby_params[ $orderby ]); |
|
| 641 | + // then bump ahead to the next param |
|
| 642 | + continue; |
|
| 643 | + } |
|
| 644 | + // this will ad a comma depending on whether this is the first or last param |
|
| 645 | + $glue = $counter === 0 || $counter === count($orderby_params) ? ' ' : ', '; |
|
| 646 | + // ok what's we dealing with? |
|
| 647 | + switch ($orderby) { |
|
| 648 | + case 'id': |
|
| 649 | + case 'ID': |
|
| 650 | + $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
| 651 | + break; |
|
| 652 | + case 'end_date': |
|
| 653 | + $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
| 654 | + break; |
|
| 655 | + case 'event_name': |
|
| 656 | + $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
| 657 | + break; |
|
| 658 | + case 'category_slug': |
|
| 659 | + $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
| 660 | + break; |
|
| 661 | + case 'ticket_start': |
|
| 662 | + $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
| 663 | + break; |
|
| 664 | + case 'ticket_end': |
|
| 665 | + $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
| 666 | + break; |
|
| 667 | + case 'venue_title': |
|
| 668 | + $SQL .= $glue . 'venue_title ' . $sort; |
|
| 669 | + break; |
|
| 670 | + case 'city': |
|
| 671 | + $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
| 672 | + break; |
|
| 673 | + case 'state': |
|
| 674 | + $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
| 675 | + break; |
|
| 676 | + case 'start_date': |
|
| 677 | + default: |
|
| 678 | + $SQL .= $glue . ' event_start_date ' . $sort; |
|
| 679 | + break; |
|
| 680 | + } |
|
| 681 | + // add to array of orderby params that have been added |
|
| 682 | + self::$_query_params['orderby'][ $orderby ] = true; |
|
| 683 | + $counter++; |
|
| 684 | + } |
|
| 685 | + return $SQL; |
|
| 686 | + } |
|
| 687 | + |
|
| 688 | + |
|
| 689 | + /** |
|
| 690 | + * @return RequestInterface |
|
| 691 | + * @since 4.10.14.p |
|
| 692 | + */ |
|
| 693 | + private static function getRequest() |
|
| 694 | + { |
|
| 695 | + return LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
| 696 | + } |
|
| 697 | 697 | } |
@@ -221,7 +221,7 @@ discard block |
||
| 221 | 221 | { |
| 222 | 222 | if (EEH_Event_Query::apply_query_filters($wp_query)) { |
| 223 | 223 | global $wpdb; |
| 224 | - $clauses['groupby'] = $wpdb->posts . '.ID '; |
|
| 224 | + $clauses['groupby'] = $wpdb->posts.'.ID '; |
|
| 225 | 225 | } |
| 226 | 226 | return $clauses; |
| 227 | 227 | } |
@@ -256,23 +256,23 @@ discard block |
||
| 256 | 256 | */ |
| 257 | 257 | public static function posts_fields_sql_for_orderby(array $orderby_params = []) |
| 258 | 258 | { |
| 259 | - $SQL = ', MIN( ' . EEM_Datetime::instance()->table() . '.DTT_EVT_start ) as event_start_date '; |
|
| 259 | + $SQL = ', MIN( '.EEM_Datetime::instance()->table().'.DTT_EVT_start ) as event_start_date '; |
|
| 260 | 260 | foreach ($orderby_params as $orderby) { |
| 261 | 261 | switch ($orderby) { |
| 262 | 262 | case 'ticket_start': |
| 263 | - $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_start_date'; |
|
| 263 | + $SQL .= ', '.EEM_Ticket::instance()->table().'.TKT_start_date'; |
|
| 264 | 264 | break; |
| 265 | 265 | case 'ticket_end': |
| 266 | - $SQL .= ', ' . EEM_Ticket::instance()->table() . '.TKT_end_date'; |
|
| 266 | + $SQL .= ', '.EEM_Ticket::instance()->table().'.TKT_end_date'; |
|
| 267 | 267 | break; |
| 268 | 268 | case 'venue_title': |
| 269 | 269 | $SQL .= ', Venue.post_title AS venue_title'; |
| 270 | 270 | break; |
| 271 | 271 | case 'city': |
| 272 | - $SQL .= ', ' . EEM_Venue::instance()->second_table() . '.VNU_city'; |
|
| 272 | + $SQL .= ', '.EEM_Venue::instance()->second_table().'.VNU_city'; |
|
| 273 | 273 | break; |
| 274 | 274 | case 'state': |
| 275 | - $SQL .= ', ' . EEM_State::instance()->table() . '.STA_name'; |
|
| 275 | + $SQL .= ', '.EEM_State::instance()->table().'.STA_name'; |
|
| 276 | 276 | break; |
| 277 | 277 | } |
| 278 | 278 | } |
@@ -312,12 +312,12 @@ discard block |
||
| 312 | 312 | */ |
| 313 | 313 | public static function posts_join_sql_for_show_expired($SQL = '', $show_expired = false) |
| 314 | 314 | { |
| 315 | - if (! $show_expired) { |
|
| 316 | - $join = EEM_Event::instance()->table() . '.ID = '; |
|
| 317 | - $join .= EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
| 315 | + if ( ! $show_expired) { |
|
| 316 | + $join = EEM_Event::instance()->table().'.ID = '; |
|
| 317 | + $join .= EEM_Datetime::instance()->table().'.'.EEM_Event::instance()->primary_key_name(); |
|
| 318 | 318 | // don't add if this is already in the SQL |
| 319 | 319 | if (strpos($SQL, $join) === false) { |
| 320 | - $SQL .= ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' ) '; |
|
| 320 | + $SQL .= ' INNER JOIN '.EEM_Datetime::instance()->table().' ON ( '.$join.' ) '; |
|
| 321 | 321 | } |
| 322 | 322 | } |
| 323 | 323 | return $SQL; |
@@ -332,7 +332,7 @@ discard block |
||
| 332 | 332 | */ |
| 333 | 333 | public static function posts_join_sql_for_terms($SQL = '', $join_terms = '') |
| 334 | 334 | { |
| 335 | - if (! empty($join_terms)) { |
|
| 335 | + if ( ! empty($join_terms)) { |
|
| 336 | 336 | global $wpdb; |
| 337 | 337 | $SQL .= " LEFT JOIN $wpdb->term_relationships ON ($wpdb->posts.ID = $wpdb->term_relationships.object_id)"; |
| 338 | 338 | $SQL .= " LEFT JOIN $wpdb->term_taxonomy ON ($wpdb->term_relationships.term_taxonomy_id = $wpdb->term_taxonomy.term_taxonomy_id)"; |
@@ -361,13 +361,13 @@ discard block |
||
| 361 | 361 | case 'ticket_end': |
| 362 | 362 | $SQL .= EEH_Event_Query::_posts_join_for_datetime( |
| 363 | 363 | $SQL, |
| 364 | - EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Datetime::instance()->primary_key_name() |
|
| 364 | + EEM_Datetime_Ticket::instance()->table().'.'.EEM_Datetime::instance()->primary_key_name() |
|
| 365 | 365 | ); |
| 366 | - $SQL .= ' LEFT JOIN ' . EEM_Ticket::instance()->table(); |
|
| 366 | + $SQL .= ' LEFT JOIN '.EEM_Ticket::instance()->table(); |
|
| 367 | 367 | $SQL .= ' ON ('; |
| 368 | - $SQL .= EEM_Datetime_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name(); |
|
| 368 | + $SQL .= EEM_Datetime_Ticket::instance()->table().'.'.EEM_Ticket::instance()->primary_key_name(); |
|
| 369 | 369 | $SQL .= ' = '; |
| 370 | - $SQL .= EEM_Ticket::instance()->table() . '.' . EEM_Ticket::instance()->primary_key_name(); |
|
| 370 | + $SQL .= EEM_Ticket::instance()->table().'.'.EEM_Ticket::instance()->primary_key_name(); |
|
| 371 | 371 | $SQL .= ' )'; |
| 372 | 372 | break; |
| 373 | 373 | case 'venue_title': |
@@ -380,7 +380,7 @@ discard block |
||
| 380 | 380 | break; |
| 381 | 381 | case 'start_date': |
| 382 | 382 | default: |
| 383 | - $SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Event::instance()->table() . '.ID'); |
|
| 383 | + $SQL .= EEH_Event_Query::_posts_join_for_datetime($SQL, EEM_Event::instance()->table().'.ID'); |
|
| 384 | 384 | break; |
| 385 | 385 | } |
| 386 | 386 | } |
@@ -399,10 +399,10 @@ discard block |
||
| 399 | 399 | */ |
| 400 | 400 | protected static function _posts_join_for_datetime($SQL = '', $join = '') |
| 401 | 401 | { |
| 402 | - if (! empty($join)) { |
|
| 403 | - $join .= ' = ' . EEM_Datetime::instance()->table() . '.' . EEM_Event::instance()->primary_key_name(); |
|
| 402 | + if ( ! empty($join)) { |
|
| 403 | + $join .= ' = '.EEM_Datetime::instance()->table().'.'.EEM_Event::instance()->primary_key_name(); |
|
| 404 | 404 | if (strpos($SQL, $join) === false) { |
| 405 | - return ' INNER JOIN ' . EEM_Datetime::instance()->table() . ' ON ( ' . $join . ' )'; |
|
| 405 | + return ' INNER JOIN '.EEM_Datetime::instance()->table().' ON ( '.$join.' )'; |
|
| 406 | 406 | } |
| 407 | 407 | } |
| 408 | 408 | return ''; |
@@ -513,7 +513,7 @@ discard block |
||
| 513 | 513 | public static function posts_where_sql_for_show_expired($show_expired = false) |
| 514 | 514 | { |
| 515 | 515 | return ! $show_expired |
| 516 | - ? ' AND ' . EEM_Datetime::instance()->table() . '.DTT_EVT_end > \'' . current_time('mysql', true) . '\' ' |
|
| 516 | + ? ' AND '.EEM_Datetime::instance()->table().'.DTT_EVT_end > \''.current_time('mysql', true).'\' ' |
|
| 517 | 517 | : ''; |
| 518 | 518 | } |
| 519 | 519 | |
@@ -525,7 +525,7 @@ discard block |
||
| 525 | 525 | public static function posts_where_sql_for_event_category_slug($event_category_slug = null) |
| 526 | 526 | { |
| 527 | 527 | global $wpdb; |
| 528 | - if (! empty($event_category_slug)) { |
|
| 528 | + if ( ! empty($event_category_slug)) { |
|
| 529 | 529 | $event_category_slugs_array = array_map('trim', explode(',', $event_category_slug)); |
| 530 | 530 | $event_category_slugs_prepare = implode(', ', array_fill(0, count($event_category_slugs_array), '%s')); |
| 531 | 531 | return $wpdb->prepare( |
@@ -548,14 +548,14 @@ discard block |
||
| 548 | 548 | public static function posts_where_sql_for_event_list_month($month = null) |
| 549 | 549 | { |
| 550 | 550 | $SQL = ''; |
| 551 | - if (! empty($month)) { |
|
| 551 | + if ( ! empty($month)) { |
|
| 552 | 552 | $datetime_table = EEM_Datetime::instance()->table(); |
| 553 | 553 | // event start date is LESS than the end of the month ( so nothing that doesn't start until next month ) |
| 554 | 554 | $SQL = " AND {$datetime_table}.DTT_EVT_start <= '"; |
| 555 | - $SQL .= date('Y-m-t 23:59:59', EEH_DTT_Helper::first_of_month_timestamp($month)) . "'"; |
|
| 555 | + $SQL .= date('Y-m-t 23:59:59', EEH_DTT_Helper::first_of_month_timestamp($month))."'"; |
|
| 556 | 556 | // event end date is GREATER than the start of the month ( so nothing that ended before this month ) |
| 557 | 557 | $SQL .= " AND {$datetime_table}.DTT_EVT_end >= '"; |
| 558 | - $SQL .= date('Y-m-01 0:0:00', EEH_DTT_Helper::first_of_month_timestamp($month)) . "' "; |
|
| 558 | + $SQL .= date('Y-m-01 0:0:00', EEH_DTT_Helper::first_of_month_timestamp($month))."' "; |
|
| 559 | 559 | } |
| 560 | 560 | return $SQL; |
| 561 | 561 | } |
@@ -569,7 +569,7 @@ discard block |
||
| 569 | 569 | */ |
| 570 | 570 | public static function posts_where_sql_for_non_trashed_datetimes() |
| 571 | 571 | { |
| 572 | - return ' AND ' . EEM_Datetime::instance()->table() . '.DTT_deleted = 0'; |
|
| 572 | + return ' AND '.EEM_Datetime::instance()->table().'.DTT_deleted = 0'; |
|
| 573 | 573 | } |
| 574 | 574 | |
| 575 | 575 | |
@@ -629,15 +629,15 @@ discard block |
||
| 629 | 629 | ? strtoupper($sort) |
| 630 | 630 | : 'ASC'; |
| 631 | 631 | // make sure 'orderby' is set in query params |
| 632 | - if (! isset(self::$_query_params['orderby'])) { |
|
| 632 | + if ( ! isset(self::$_query_params['orderby'])) { |
|
| 633 | 633 | self::$_query_params['orderby'] = []; |
| 634 | 634 | } |
| 635 | 635 | // loop thru $orderby_params (type cast as array) |
| 636 | 636 | foreach ($orderby_params as $orderby) { |
| 637 | 637 | // check if we have already added this param |
| 638 | - if (isset(self::$_query_params['orderby'][ $orderby ])) { |
|
| 638 | + if (isset(self::$_query_params['orderby'][$orderby])) { |
|
| 639 | 639 | // if so then remove from the $orderby_params so that the count() method below is accurate |
| 640 | - unset($orderby_params[ $orderby ]); |
|
| 640 | + unset($orderby_params[$orderby]); |
|
| 641 | 641 | // then bump ahead to the next param |
| 642 | 642 | continue; |
| 643 | 643 | } |
@@ -647,39 +647,39 @@ discard block |
||
| 647 | 647 | switch ($orderby) { |
| 648 | 648 | case 'id': |
| 649 | 649 | case 'ID': |
| 650 | - $SQL .= $glue . $wpdb->posts . '.ID ' . $sort; |
|
| 650 | + $SQL .= $glue.$wpdb->posts.'.ID '.$sort; |
|
| 651 | 651 | break; |
| 652 | 652 | case 'end_date': |
| 653 | - $SQL .= $glue . EEM_Datetime::instance()->table() . '.DTT_EVT_end ' . $sort; |
|
| 653 | + $SQL .= $glue.EEM_Datetime::instance()->table().'.DTT_EVT_end '.$sort; |
|
| 654 | 654 | break; |
| 655 | 655 | case 'event_name': |
| 656 | - $SQL .= $glue . $wpdb->posts . '.post_title ' . $sort; |
|
| 656 | + $SQL .= $glue.$wpdb->posts.'.post_title '.$sort; |
|
| 657 | 657 | break; |
| 658 | 658 | case 'category_slug': |
| 659 | - $SQL .= $glue . $wpdb->terms . '.slug ' . $sort; |
|
| 659 | + $SQL .= $glue.$wpdb->terms.'.slug '.$sort; |
|
| 660 | 660 | break; |
| 661 | 661 | case 'ticket_start': |
| 662 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_start_date ' . $sort; |
|
| 662 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_start_date '.$sort; |
|
| 663 | 663 | break; |
| 664 | 664 | case 'ticket_end': |
| 665 | - $SQL .= $glue . EEM_Ticket::instance()->table() . '.TKT_end_date ' . $sort; |
|
| 665 | + $SQL .= $glue.EEM_Ticket::instance()->table().'.TKT_end_date '.$sort; |
|
| 666 | 666 | break; |
| 667 | 667 | case 'venue_title': |
| 668 | - $SQL .= $glue . 'venue_title ' . $sort; |
|
| 668 | + $SQL .= $glue.'venue_title '.$sort; |
|
| 669 | 669 | break; |
| 670 | 670 | case 'city': |
| 671 | - $SQL .= $glue . EEM_Venue::instance()->second_table() . '.VNU_city ' . $sort; |
|
| 671 | + $SQL .= $glue.EEM_Venue::instance()->second_table().'.VNU_city '.$sort; |
|
| 672 | 672 | break; |
| 673 | 673 | case 'state': |
| 674 | - $SQL .= $glue . EEM_State::instance()->table() . '.STA_name ' . $sort; |
|
| 674 | + $SQL .= $glue.EEM_State::instance()->table().'.STA_name '.$sort; |
|
| 675 | 675 | break; |
| 676 | 676 | case 'start_date': |
| 677 | 677 | default: |
| 678 | - $SQL .= $glue . ' event_start_date ' . $sort; |
|
| 678 | + $SQL .= $glue.' event_start_date '.$sort; |
|
| 679 | 679 | break; |
| 680 | 680 | } |
| 681 | 681 | // add to array of orderby params that have been added |
| 682 | - self::$_query_params['orderby'][ $orderby ] = true; |
|
| 682 | + self::$_query_params['orderby'][$orderby] = true; |
|
| 683 | 683 | $counter++; |
| 684 | 684 | } |
| 685 | 685 | return $SQL; |
@@ -20,1146 +20,1146 @@ |
||
| 20 | 20 | */ |
| 21 | 21 | class EE_Dependency_Map |
| 22 | 22 | { |
| 23 | - /** |
|
| 24 | - * This means that the requested class dependency is not present in the dependency map |
|
| 25 | - */ |
|
| 26 | - const not_registered = 0; |
|
| 27 | - |
|
| 28 | - /** |
|
| 29 | - * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class. |
|
| 30 | - */ |
|
| 31 | - const load_new_object = 1; |
|
| 32 | - |
|
| 33 | - /** |
|
| 34 | - * This instructs class loaders to return a previously instantiated and cached object for the requested class. |
|
| 35 | - * IF a previously instantiated object does not exist, a new one will be created and added to the cache. |
|
| 36 | - */ |
|
| 37 | - const load_from_cache = 2; |
|
| 38 | - |
|
| 39 | - /** |
|
| 40 | - * When registering a dependency, |
|
| 41 | - * this indicates to keep any existing dependencies that already exist, |
|
| 42 | - * and simply discard any new dependencies declared in the incoming data |
|
| 43 | - */ |
|
| 44 | - const KEEP_EXISTING_DEPENDENCIES = 0; |
|
| 45 | - |
|
| 46 | - /** |
|
| 47 | - * When registering a dependency, |
|
| 48 | - * this indicates to overwrite any existing dependencies that already exist using the incoming data |
|
| 49 | - */ |
|
| 50 | - const OVERWRITE_DEPENDENCIES = 1; |
|
| 51 | - |
|
| 52 | - protected static ?EE_Dependency_Map $_instance = null; |
|
| 53 | - |
|
| 54 | - private ClassInterfaceCache $class_cache; |
|
| 55 | - |
|
| 56 | - protected ?RequestInterface $request = null; |
|
| 57 | - |
|
| 58 | - protected ?LegacyRequestInterface $legacy_request = null; |
|
| 59 | - |
|
| 60 | - protected ?ResponseInterface $response = null; |
|
| 61 | - |
|
| 62 | - protected ?LoaderInterface $loader = null; |
|
| 63 | - |
|
| 64 | - protected array $_dependency_map = []; |
|
| 65 | - |
|
| 66 | - protected array $_class_loaders = []; |
|
| 67 | - |
|
| 68 | - |
|
| 69 | - /** |
|
| 70 | - * EE_Dependency_Map constructor. |
|
| 71 | - * |
|
| 72 | - * @param ClassInterfaceCache $class_cache |
|
| 73 | - */ |
|
| 74 | - protected function __construct(ClassInterfaceCache $class_cache) |
|
| 75 | - { |
|
| 76 | - $this->class_cache = $class_cache; |
|
| 77 | - do_action('EE_Dependency_Map____construct', $this); |
|
| 78 | - } |
|
| 79 | - |
|
| 80 | - |
|
| 81 | - /** |
|
| 82 | - * @return void |
|
| 83 | - * @throws InvalidAliasException |
|
| 84 | - */ |
|
| 85 | - public function initialize() |
|
| 86 | - { |
|
| 87 | - $this->_register_core_dependencies(); |
|
| 88 | - $this->_register_core_class_loaders(); |
|
| 89 | - $this->_register_core_aliases(); |
|
| 90 | - } |
|
| 91 | - |
|
| 92 | - |
|
| 93 | - /** |
|
| 94 | - * @singleton method used to instantiate class object |
|
| 95 | - * @param ClassInterfaceCache|null $class_cache |
|
| 96 | - * @return EE_Dependency_Map |
|
| 97 | - */ |
|
| 98 | - public static function instance(ClassInterfaceCache $class_cache = null): EE_Dependency_Map |
|
| 99 | - { |
|
| 100 | - // check if class object is instantiated, and instantiated properly |
|
| 101 | - if ( |
|
| 102 | - ! EE_Dependency_Map::$_instance instanceof EE_Dependency_Map |
|
| 103 | - && $class_cache instanceof ClassInterfaceCache |
|
| 104 | - ) { |
|
| 105 | - EE_Dependency_Map::$_instance = new EE_Dependency_Map($class_cache); |
|
| 106 | - } |
|
| 107 | - return EE_Dependency_Map::$_instance; |
|
| 108 | - } |
|
| 109 | - |
|
| 110 | - |
|
| 111 | - /** |
|
| 112 | - * @param RequestInterface $request |
|
| 113 | - */ |
|
| 114 | - public function setRequest(RequestInterface $request) |
|
| 115 | - { |
|
| 116 | - $this->request = $request; |
|
| 117 | - } |
|
| 118 | - |
|
| 119 | - |
|
| 120 | - /** |
|
| 121 | - * @param LegacyRequestInterface $legacy_request |
|
| 122 | - */ |
|
| 123 | - public function setLegacyRequest(LegacyRequestInterface $legacy_request) |
|
| 124 | - { |
|
| 125 | - $this->legacy_request = $legacy_request; |
|
| 126 | - } |
|
| 127 | - |
|
| 128 | - |
|
| 129 | - /** |
|
| 130 | - * @param ResponseInterface $response |
|
| 131 | - */ |
|
| 132 | - public function setResponse(ResponseInterface $response) |
|
| 133 | - { |
|
| 134 | - $this->response = $response; |
|
| 135 | - } |
|
| 136 | - |
|
| 137 | - |
|
| 138 | - /** |
|
| 139 | - * @param LoaderInterface $loader |
|
| 140 | - */ |
|
| 141 | - public function setLoader(LoaderInterface $loader) |
|
| 142 | - { |
|
| 143 | - $this->loader = $loader; |
|
| 144 | - } |
|
| 145 | - |
|
| 146 | - |
|
| 147 | - /** |
|
| 148 | - * @param string $class |
|
| 149 | - * @param array $dependencies |
|
| 150 | - * @param int $overwrite |
|
| 151 | - * @return bool |
|
| 152 | - */ |
|
| 153 | - public static function register_dependencies( |
|
| 154 | - string $class, |
|
| 155 | - array $dependencies, |
|
| 156 | - int $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES |
|
| 157 | - ): bool { |
|
| 158 | - return EE_Dependency_Map::$_instance->registerDependencies($class, $dependencies, $overwrite); |
|
| 159 | - } |
|
| 160 | - |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * Assigns an array of class names and corresponding load sources (new or cached) |
|
| 164 | - * to the class specified by the first parameter. |
|
| 165 | - * IMPORTANT !!! |
|
| 166 | - * The order of elements in the incoming $dependencies array MUST match |
|
| 167 | - * the order of the constructor parameters for the class in question. |
|
| 168 | - * This is especially important when overriding any existing dependencies that are registered. |
|
| 169 | - * the third parameter controls whether any duplicate dependencies are overwritten or not. |
|
| 170 | - * |
|
| 171 | - * @param string $class |
|
| 172 | - * @param array $dependencies |
|
| 173 | - * @param int $overwrite |
|
| 174 | - * @return bool |
|
| 175 | - */ |
|
| 176 | - public function registerDependencies( |
|
| 177 | - string $class, |
|
| 178 | - array $dependencies, |
|
| 179 | - int $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES |
|
| 180 | - ): bool { |
|
| 181 | - if (empty($dependencies)) { |
|
| 182 | - return false; |
|
| 183 | - } |
|
| 184 | - $class = trim($class, '\\'); |
|
| 185 | - $registered = false; |
|
| 186 | - if (empty(EE_Dependency_Map::$_instance->_dependency_map[ $class ])) { |
|
| 187 | - EE_Dependency_Map::$_instance->_dependency_map[ $class ] = []; |
|
| 188 | - } |
|
| 189 | - // we need to make sure that any aliases used when registering a dependency |
|
| 190 | - // get resolved to the correct class name |
|
| 191 | - foreach ($dependencies as $dependency => $load_source) { |
|
| 192 | - $alias = EE_Dependency_Map::$_instance->getFqnForAlias($dependency); |
|
| 193 | - if ( |
|
| 194 | - $overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES |
|
| 195 | - || ! isset( |
|
| 196 | - EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $dependency ], |
|
| 197 | - EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $alias ] |
|
| 198 | - ) |
|
| 199 | - ) { |
|
| 200 | - unset($dependencies[ $dependency ]); |
|
| 201 | - $dependencies[ $alias ] = $load_source; |
|
| 202 | - $registered = true; |
|
| 203 | - } |
|
| 204 | - } |
|
| 205 | - // now add our two lists of dependencies together. |
|
| 206 | - // using Union (+=) favours the arrays in precedence from left to right, |
|
| 207 | - // so $dependencies is NOT overwritten because it is listed first |
|
| 208 | - // ie: with A = B + C, entries in B take precedence over duplicate entries in C |
|
| 209 | - // Union is way faster than array_merge() but should be used with caution... |
|
| 210 | - // especially with numerically indexed arrays |
|
| 211 | - $dependencies += EE_Dependency_Map::$_instance->_dependency_map[ $class ]; |
|
| 212 | - // now we need to ensure that the resulting dependencies |
|
| 213 | - // array only has the entries that are required for the class |
|
| 214 | - // so first count how many dependencies were originally registered for the class |
|
| 215 | - $dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]); |
|
| 216 | - // if that count is non-zero (meaning dependencies were already registered) |
|
| 217 | - EE_Dependency_Map::$_instance->_dependency_map[ $class ] = $dependency_count |
|
| 218 | - // then truncate the final array to match that count |
|
| 219 | - ? array_slice($dependencies, 0, $dependency_count) |
|
| 220 | - // otherwise just take the incoming array because nothing previously existed |
|
| 221 | - : $dependencies; |
|
| 222 | - return $registered |
|
| 223 | - || count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]) === count($dependencies); |
|
| 224 | - } |
|
| 225 | - |
|
| 226 | - |
|
| 227 | - /** |
|
| 228 | - * @param string $class_name |
|
| 229 | - * @param callable|string $loader |
|
| 230 | - * @param bool $overwrite |
|
| 231 | - * @return bool |
|
| 232 | - * @throws DomainException |
|
| 233 | - */ |
|
| 234 | - public static function register_class_loader( |
|
| 235 | - string $class_name, |
|
| 236 | - $loader = 'load_core', |
|
| 237 | - bool $overwrite = false |
|
| 238 | - ): bool { |
|
| 239 | - return EE_Dependency_Map::$_instance->registerClassLoader($class_name, $loader, $overwrite); |
|
| 240 | - } |
|
| 241 | - |
|
| 242 | - |
|
| 243 | - /** |
|
| 244 | - * @param string $class_name |
|
| 245 | - * @param Closure|string $loader |
|
| 246 | - * @param bool $overwrite |
|
| 247 | - * @return bool |
|
| 248 | - * @throws DomainException |
|
| 249 | - */ |
|
| 250 | - public function registerClassLoader(string $class_name, $loader = 'load_core', bool $overwrite = false): bool |
|
| 251 | - { |
|
| 252 | - if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) { |
|
| 253 | - throw new DomainException( |
|
| 254 | - esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso') |
|
| 255 | - ); |
|
| 256 | - } |
|
| 257 | - // check that loader is callable or method starts with "load_" and exists in EE_Registry |
|
| 258 | - if ( |
|
| 259 | - ! is_callable($loader) |
|
| 260 | - && ( |
|
| 261 | - strpos($loader, 'load_') !== 0 |
|
| 262 | - || ! method_exists('EE_Registry', $loader) |
|
| 263 | - ) |
|
| 264 | - ) { |
|
| 265 | - throw new DomainException( |
|
| 266 | - sprintf( |
|
| 267 | - esc_html__( |
|
| 268 | - '"%1$s" is not a valid loader method on EE_Registry.', |
|
| 269 | - 'event_espresso' |
|
| 270 | - ), |
|
| 271 | - $loader |
|
| 272 | - ) |
|
| 273 | - ); |
|
| 274 | - } |
|
| 275 | - $class_name = EE_Dependency_Map::$_instance->getFqnForAlias($class_name); |
|
| 276 | - if ($overwrite || ! isset(EE_Dependency_Map::$_instance->_class_loaders[ $class_name ])) { |
|
| 277 | - EE_Dependency_Map::$_instance->_class_loaders[ $class_name ] = $loader; |
|
| 278 | - return true; |
|
| 279 | - } |
|
| 280 | - return false; |
|
| 281 | - } |
|
| 282 | - |
|
| 283 | - |
|
| 284 | - /** |
|
| 285 | - * @return array |
|
| 286 | - */ |
|
| 287 | - public function dependency_map(): array |
|
| 288 | - { |
|
| 289 | - return $this->_dependency_map; |
|
| 290 | - } |
|
| 291 | - |
|
| 292 | - |
|
| 293 | - /** |
|
| 294 | - * returns TRUE if dependency map contains a listing for the provided class name |
|
| 295 | - * |
|
| 296 | - * @param string $class_name |
|
| 297 | - * @return boolean |
|
| 298 | - */ |
|
| 299 | - public function has(string $class_name = ''): bool |
|
| 300 | - { |
|
| 301 | - // all legacy models have the same dependencies |
|
| 302 | - if (strpos($class_name, 'EEM_') === 0) { |
|
| 303 | - $class_name = 'LEGACY_MODELS'; |
|
| 304 | - } |
|
| 305 | - return isset($this->_dependency_map[ $class_name ]); |
|
| 306 | - } |
|
| 307 | - |
|
| 308 | - |
|
| 309 | - /** |
|
| 310 | - * returns TRUE if dependency map contains a listing for the provided class name AND dependency |
|
| 311 | - * |
|
| 312 | - * @param string $class_name |
|
| 313 | - * @param string $dependency |
|
| 314 | - * @return bool |
|
| 315 | - */ |
|
| 316 | - public function has_dependency_for_class(string $class_name = '', string $dependency = ''): bool |
|
| 317 | - { |
|
| 318 | - // all legacy models have the same dependencies |
|
| 319 | - if (strpos($class_name, 'EEM_') === 0) { |
|
| 320 | - $class_name = 'LEGACY_MODELS'; |
|
| 321 | - } |
|
| 322 | - $dependency = $this->getFqnForAlias($dependency, $class_name); |
|
| 323 | - return isset($this->_dependency_map[ $class_name ][ $dependency ]); |
|
| 324 | - } |
|
| 325 | - |
|
| 326 | - |
|
| 327 | - /** |
|
| 328 | - * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned |
|
| 329 | - * |
|
| 330 | - * @param string $class_name |
|
| 331 | - * @param string $dependency |
|
| 332 | - * @return int |
|
| 333 | - */ |
|
| 334 | - public function loading_strategy_for_class_dependency(string $class_name = '', string $dependency = ''): int |
|
| 335 | - { |
|
| 336 | - // all legacy models have the same dependencies |
|
| 337 | - if (strpos($class_name, 'EEM_') === 0) { |
|
| 338 | - $class_name = 'LEGACY_MODELS'; |
|
| 339 | - } |
|
| 340 | - $dependency = $this->getFqnForAlias($dependency); |
|
| 341 | - return $this->has_dependency_for_class($class_name, $dependency) |
|
| 342 | - ? $this->_dependency_map[ $class_name ][ $dependency ] |
|
| 343 | - : EE_Dependency_Map::not_registered; |
|
| 344 | - } |
|
| 345 | - |
|
| 346 | - |
|
| 347 | - /** |
|
| 348 | - * @param string $class_name |
|
| 349 | - * @return string | Closure |
|
| 350 | - */ |
|
| 351 | - public function class_loader(string $class_name) |
|
| 352 | - { |
|
| 353 | - // all legacy models use load_model() |
|
| 354 | - if (strpos($class_name, 'EEM_') === 0) { |
|
| 355 | - return 'load_model'; |
|
| 356 | - } |
|
| 357 | - // EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc |
|
| 358 | - // perform strpos() first to avoid loading regex every time we load a class |
|
| 359 | - if ( |
|
| 360 | - strpos($class_name, 'EE_CPT_') === 0 |
|
| 361 | - && preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name) |
|
| 362 | - ) { |
|
| 363 | - return 'load_core'; |
|
| 364 | - } |
|
| 365 | - $class_name = $this->getFqnForAlias($class_name); |
|
| 366 | - return $this->_class_loaders[ $class_name ] ?? ''; |
|
| 367 | - } |
|
| 368 | - |
|
| 369 | - |
|
| 370 | - /** |
|
| 371 | - * @return array |
|
| 372 | - */ |
|
| 373 | - public function class_loaders(): array |
|
| 374 | - { |
|
| 375 | - return $this->_class_loaders; |
|
| 376 | - } |
|
| 377 | - |
|
| 378 | - |
|
| 379 | - /** |
|
| 380 | - * adds an alias for a classname |
|
| 381 | - * |
|
| 382 | - * @param string $fqcn the class name that should be used (concrete class to replace interface) |
|
| 383 | - * @param string $alias the class name that would be type hinted for (abstract parent or interface) |
|
| 384 | - * @param string $for_class the class that has the dependency (is type hinting for the interface) |
|
| 385 | - * @throws InvalidAliasException |
|
| 386 | - */ |
|
| 387 | - public function add_alias(string $fqcn, string $alias, string $for_class = '') |
|
| 388 | - { |
|
| 389 | - $this->class_cache->addAlias($fqcn, $alias, $for_class); |
|
| 390 | - } |
|
| 391 | - |
|
| 392 | - |
|
| 393 | - /** |
|
| 394 | - * Returns TRUE if the provided fully qualified name IS an alias |
|
| 395 | - * WHY? |
|
| 396 | - * Because if a class is type hinting for a concretion, |
|
| 397 | - * then why would we need to find another class to supply it? |
|
| 398 | - * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`, |
|
| 399 | - * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`. |
|
| 400 | - * Don't go looking for some substitute. |
|
| 401 | - * Whereas if a class is type hinting for an interface... |
|
| 402 | - * then we need to find an actual class to use. |
|
| 403 | - * So the interface IS the alias for some other FQN, |
|
| 404 | - * and we need to find out if `Fully/Qualified/Namespace/SomeInterface` |
|
| 405 | - * represents some other class. |
|
| 406 | - * |
|
| 407 | - * @param string $fqn |
|
| 408 | - * @param string $for_class |
|
| 409 | - * @return bool |
|
| 410 | - */ |
|
| 411 | - public function isAlias(string $fqn = '', string $for_class = ''): bool |
|
| 412 | - { |
|
| 413 | - return $this->class_cache->isAlias($fqn, $for_class); |
|
| 414 | - } |
|
| 415 | - |
|
| 416 | - |
|
| 417 | - /** |
|
| 418 | - * Returns a FQN for provided alias if one exists, otherwise returns the original $alias |
|
| 419 | - * functions recursively, so that multiple aliases can be used to drill down to a FQN |
|
| 420 | - * for example: |
|
| 421 | - * if the following two entries were added to the _aliases array: |
|
| 422 | - * array( |
|
| 423 | - * 'interface_alias' => 'some\namespace\interface' |
|
| 424 | - * 'some\namespace\interface' => 'some\namespace\classname' |
|
| 425 | - * ) |
|
| 426 | - * then one could use EE_Registry::instance()->create( 'interface_alias' ) |
|
| 427 | - * to load an instance of 'some\namespace\classname' |
|
| 428 | - * |
|
| 429 | - * @param string $alias |
|
| 430 | - * @param string $for_class |
|
| 431 | - * @return string |
|
| 432 | - */ |
|
| 433 | - public function getFqnForAlias(string $alias = '', string $for_class = ''): string |
|
| 434 | - { |
|
| 435 | - return $this->class_cache->getFqnForAlias($alias, $for_class); |
|
| 436 | - } |
|
| 437 | - |
|
| 438 | - |
|
| 439 | - /** |
|
| 440 | - * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache, |
|
| 441 | - * if one exists, or whether a new object should be generated every time the requested class is loaded. |
|
| 442 | - * This is done by using the following class constants: |
|
| 443 | - * EE_Dependency_Map::load_from_cache - loads previously instantiated object |
|
| 444 | - * EE_Dependency_Map::load_new_object - generates a new object every time |
|
| 445 | - */ |
|
| 446 | - protected function _register_core_dependencies() |
|
| 447 | - { |
|
| 448 | - $this->_dependency_map = [ |
|
| 449 | - 'EE_Admin' => [ |
|
| 450 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 451 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 452 | - ], |
|
| 453 | - 'EE_Request_Handler' => [ |
|
| 454 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 455 | - 'EventEspresso\core\services\request\Response' => EE_Dependency_Map::load_from_cache, |
|
| 456 | - ], |
|
| 457 | - 'EE_System' => [ |
|
| 458 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 459 | - 'EE_Maintenance_Mode' => EE_Dependency_Map::load_from_cache, |
|
| 460 | - 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 461 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 462 | - 'EventEspresso\core\services\routing\Router' => EE_Dependency_Map::load_from_cache, |
|
| 463 | - ], |
|
| 464 | - 'EE_Session' => [ |
|
| 465 | - 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
| 466 | - 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
| 467 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 468 | - 'EventEspresso\core\services\session\SessionStartHandler' => EE_Dependency_Map::load_from_cache, |
|
| 469 | - 'EventEspresso\core\services\encryption\Base64Encoder' => EE_Dependency_Map::load_from_cache, |
|
| 470 | - ], |
|
| 471 | - 'EventEspresso\core\services\session\SessionStartHandler' => [ |
|
| 472 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache |
|
| 473 | - ], |
|
| 474 | - 'EE_Cart' => [ |
|
| 475 | - 'EE_Session' => EE_Dependency_Map::load_from_cache, |
|
| 476 | - ], |
|
| 477 | - 'EE_Messenger_Collection_Loader' => [ |
|
| 478 | - 'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object, |
|
| 479 | - ], |
|
| 480 | - 'EE_Message_Type_Collection_Loader' => [ |
|
| 481 | - 'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object, |
|
| 482 | - ], |
|
| 483 | - 'EE_Message_Resource_Manager' => [ |
|
| 484 | - 'EE_Messenger_Collection_Loader' => EE_Dependency_Map::load_new_object, |
|
| 485 | - 'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object, |
|
| 486 | - 'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache, |
|
| 487 | - ], |
|
| 488 | - 'EE_Message_Factory' => [ |
|
| 489 | - 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 490 | - ], |
|
| 491 | - 'EE_messages' => [ |
|
| 492 | - 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 493 | - ], |
|
| 494 | - 'EE_Messages_Generator' => [ |
|
| 495 | - 'EE_Messages_Queue' => EE_Dependency_Map::load_new_object, |
|
| 496 | - 'EE_Messages_Data_Handler_Collection' => EE_Dependency_Map::load_new_object, |
|
| 497 | - 'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object, |
|
| 498 | - 'EEH_Parse_Shortcodes' => EE_Dependency_Map::load_from_cache, |
|
| 499 | - ], |
|
| 500 | - 'EE_Messages_Processor' => [ |
|
| 501 | - 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 502 | - ], |
|
| 503 | - 'EE_Messages_Queue' => [ |
|
| 504 | - 'EE_Message_Repository' => EE_Dependency_Map::load_new_object, |
|
| 505 | - ], |
|
| 506 | - 'EE_Messages_Template_Defaults' => [ |
|
| 507 | - 'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache, |
|
| 508 | - 'EEM_Message_Template' => EE_Dependency_Map::load_from_cache, |
|
| 509 | - ], |
|
| 510 | - 'EE_Message_To_Generate_From_Request' => [ |
|
| 511 | - 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 512 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 513 | - ], |
|
| 514 | - 'EventEspresso\core\services\commands\CommandBus' => [ |
|
| 515 | - 'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache, |
|
| 516 | - ], |
|
| 517 | - 'EventEspresso\services\commands\CommandHandler' => [ |
|
| 518 | - 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 519 | - 'CommandBusInterface' => EE_Dependency_Map::load_from_cache, |
|
| 520 | - ], |
|
| 521 | - 'EventEspresso\core\services\commands\CommandHandlerManager' => [ |
|
| 522 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 523 | - ], |
|
| 524 | - 'EventEspresso\core\services\commands\CompositeCommandHandler' => [ |
|
| 525 | - 'EventEspresso\core\services\commands\CommandBus' => EE_Dependency_Map::load_from_cache, |
|
| 526 | - 'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache, |
|
| 527 | - ], |
|
| 528 | - 'EventEspresso\core\services\commands\CommandFactory' => [ |
|
| 529 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 530 | - ], |
|
| 531 | - 'EventEspresso\core\services\commands\middleware\CapChecker' => [ |
|
| 532 | - 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 533 | - ], |
|
| 534 | - 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => [ |
|
| 535 | - 'EE_Capabilities' => EE_Dependency_Map::load_from_cache, |
|
| 536 | - ], |
|
| 537 | - 'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker' => [ |
|
| 538 | - 'EE_Capabilities' => EE_Dependency_Map::load_from_cache, |
|
| 539 | - ], |
|
| 540 | - 'EventEspresso\core\domain\services\commands\registration\CreateRegistrationCommandHandler' => [ |
|
| 541 | - 'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 542 | - ], |
|
| 543 | - 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationDetailsCommandHandler' => [ |
|
| 544 | - 'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 545 | - ], |
|
| 546 | - 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationPaymentsCommandHandler' => [ |
|
| 547 | - 'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 548 | - ], |
|
| 549 | - 'EventEspresso\core\domain\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler' => [ |
|
| 550 | - 'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 551 | - ], |
|
| 552 | - 'EventEspresso\core\domain\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => [ |
|
| 553 | - 'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 554 | - ], |
|
| 555 | - 'EventEspresso\core\domain\services\commands\ticket\CreateTicketLineItemCommandHandler' => [ |
|
| 556 | - 'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 557 | - ], |
|
| 558 | - 'EventEspresso\core\domain\services\commands\ticket\CancelTicketLineItemCommandHandler' => [ |
|
| 559 | - 'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 560 | - ], |
|
| 561 | - 'EventEspresso\core\domain\services\registration\CancelRegistrationService' => [ |
|
| 562 | - 'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 563 | - ], |
|
| 564 | - 'EventEspresso\core\domain\services\commands\attendee\CreateAttendeeCommandHandler' => [ |
|
| 565 | - 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
| 566 | - ], |
|
| 567 | - 'EventEspresso\core\domain\values\session\SessionLifespan' => [ |
|
| 568 | - 'EventEspresso\core\domain\values\session\SessionLifespanOption' => EE_Dependency_Map::load_from_cache, |
|
| 569 | - ], |
|
| 570 | - 'EventEspresso\caffeinated\admin\extend\registration_form\forms\SessionLifespanForm' => [ |
|
| 571 | - 'EventEspresso\core\domain\values\session\SessionLifespanOption' => EE_Dependency_Map::load_from_cache, |
|
| 572 | - ], |
|
| 573 | - 'EventEspresso\caffeinated\admin\extend\registration_form\forms\SessionLifespanFormHandler' => [ |
|
| 574 | - 'EventEspresso\core\domain\values\session\SessionLifespanOption' => EE_Dependency_Map::load_from_cache, |
|
| 575 | - ], |
|
| 576 | - 'EventEspresso\core\services\database\TableManager' => [ |
|
| 577 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 578 | - ], |
|
| 579 | - 'EE_Data_Migration_Class_Base' => [ |
|
| 580 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 581 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 582 | - ], |
|
| 583 | - 'EE_DMS_Core_4_1_0' => [ |
|
| 584 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 585 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 586 | - ], |
|
| 587 | - 'EE_DMS_Core_4_2_0' => [ |
|
| 588 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 589 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 590 | - ], |
|
| 591 | - 'EE_DMS_Core_4_3_0' => [ |
|
| 592 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 593 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 594 | - ], |
|
| 595 | - 'EE_DMS_Core_4_4_0' => [ |
|
| 596 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 597 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 598 | - ], |
|
| 599 | - 'EE_DMS_Core_4_5_0' => [ |
|
| 600 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 601 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 602 | - ], |
|
| 603 | - 'EE_DMS_Core_4_6_0' => [ |
|
| 604 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 605 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 606 | - ], |
|
| 607 | - 'EE_DMS_Core_4_7_0' => [ |
|
| 608 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 609 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 610 | - ], |
|
| 611 | - 'EE_DMS_Core_4_8_0' => [ |
|
| 612 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 613 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 614 | - ], |
|
| 615 | - 'EE_DMS_Core_4_9_0' => [ |
|
| 616 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 617 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 618 | - ], |
|
| 619 | - 'EE_DMS_Core_4_10_0' => [ |
|
| 620 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 621 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 622 | - 'EE_DMS_Core_4_9_0' => EE_Dependency_Map::load_from_cache, |
|
| 623 | - ], |
|
| 624 | - 'EE_DMS_Core_5_0_0' => [ |
|
| 625 | - 'EE_DMS_Core_4_10_0' => EE_Dependency_Map::load_from_cache, |
|
| 626 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 627 | - 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 628 | - ], |
|
| 629 | - 'EventEspresso\core\services\assets\I18nRegistry' => [ |
|
| 630 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 631 | - ], |
|
| 632 | - 'EventEspresso\core\services\assets\Registry' => [ |
|
| 633 | - 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
| 634 | - 'EventEspresso\core\services\assets\AssetManifest' => EE_Dependency_Map::load_from_cache, |
|
| 635 | - ], |
|
| 636 | - 'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled' => [ |
|
| 637 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 638 | - ], |
|
| 639 | - 'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout' => [ |
|
| 640 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 641 | - ], |
|
| 642 | - 'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees' => [ |
|
| 643 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 644 | - ], |
|
| 645 | - 'EventEspresso\core\domain\entities\shortcodes\EspressoEvents' => [ |
|
| 646 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 647 | - ], |
|
| 648 | - 'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou' => [ |
|
| 649 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 650 | - ], |
|
| 651 | - 'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector' => [ |
|
| 652 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 653 | - ], |
|
| 654 | - 'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage' => [ |
|
| 655 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 656 | - ], |
|
| 657 | - 'EventEspresso\core\services\cache\BasicCacheManager' => [ |
|
| 658 | - 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
| 659 | - ], |
|
| 660 | - 'EventEspresso\core\services\cache\PostRelatedCacheManager' => [ |
|
| 661 | - 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
| 662 | - ], |
|
| 663 | - 'EventEspresso\core\domain\services\validation\email\EmailValidationService' => [ |
|
| 664 | - 'EE_Registration_Config' => EE_Dependency_Map::load_from_cache, |
|
| 665 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 666 | - ], |
|
| 667 | - 'EventEspresso\core\domain\values\EmailAddress' => [ |
|
| 668 | - null, |
|
| 669 | - 'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache, |
|
| 670 | - ], |
|
| 671 | - 'EventEspresso\core\services\orm\ModelFieldFactory' => [ |
|
| 672 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 673 | - ], |
|
| 674 | - 'LEGACY_MODELS' => [ |
|
| 675 | - null, |
|
| 676 | - 'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache, |
|
| 677 | - ], |
|
| 678 | - 'EE_Module_Request_Router' => [ |
|
| 679 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 680 | - ], |
|
| 681 | - 'EE_Registration_Processor' => [ |
|
| 682 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 683 | - ], |
|
| 684 | - 'EventEspresso\core\services\notifications\PersistentAdminNoticeManager' => [ |
|
| 685 | - 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 686 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 687 | - ], |
|
| 688 | - 'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha' => [ |
|
| 689 | - 'EE_Registration_Config' => EE_Dependency_Map::load_from_cache, |
|
| 690 | - 'EE_Session' => EE_Dependency_Map::load_from_cache, |
|
| 691 | - ], |
|
| 692 | - 'EventEspresso\modules\ticket_selector\DisplayTicketSelector' => [ |
|
| 693 | - 'EventEspresso\core\domain\entities\users\CurrentUser' => EE_Dependency_Map::load_from_cache, |
|
| 694 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 695 | - 'EE_Ticket_Selector_Config' => EE_Dependency_Map::load_from_cache, |
|
| 696 | - ], |
|
| 697 | - 'EventEspresso\modules\ticket_selector\ProcessTicketSelector' => [ |
|
| 698 | - 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 699 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 700 | - 'EE_Session' => EE_Dependency_Map::load_from_cache, |
|
| 701 | - 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
|
| 702 | - 'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache, |
|
| 703 | - ], |
|
| 704 | - 'EventEspresso\modules\ticket_selector\ProcessTicketSelectorPostData' => [ |
|
| 705 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 706 | - 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
| 707 | - ], |
|
| 708 | - 'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => [ |
|
| 709 | - 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
| 710 | - ], |
|
| 711 | - 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => [ |
|
| 712 | - 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 713 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 714 | - ], |
|
| 715 | - 'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes' => [ |
|
| 716 | - 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 717 | - ], |
|
| 718 | - 'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies' => [ |
|
| 719 | - 'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 720 | - ], |
|
| 721 | - 'EE_CPT_Strategy' => [ |
|
| 722 | - 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 723 | - 'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 724 | - ], |
|
| 725 | - 'EventEspresso\core\services\loaders\ObjectIdentifier' => [ |
|
| 726 | - 'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache, |
|
| 727 | - ], |
|
| 728 | - 'EventEspresso\core\CPTs\CptQueryModifier' => [ |
|
| 729 | - null, |
|
| 730 | - null, |
|
| 731 | - null, |
|
| 732 | - 'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache, |
|
| 733 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 734 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 735 | - ], |
|
| 736 | - 'EventEspresso\core\services\dependencies\DependencyResolver' => [ |
|
| 737 | - 'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache, |
|
| 738 | - 'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache, |
|
| 739 | - 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 740 | - ], |
|
| 741 | - 'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => [ |
|
| 742 | - 'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache, |
|
| 743 | - 'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache, |
|
| 744 | - 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 745 | - ], |
|
| 746 | - 'EventEspresso\core\services\routing\RouteMatchSpecificationFactory' => [ |
|
| 747 | - 'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache, |
|
| 748 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 749 | - ], |
|
| 750 | - 'EventEspresso\core\services\routing\RouteMatchSpecificationManager' => [ |
|
| 751 | - 'EventEspresso\core\services\routing\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache, |
|
| 752 | - 'EventEspresso\core\services\routing\RouteMatchSpecificationFactory' => EE_Dependency_Map::load_from_cache, |
|
| 753 | - ], |
|
| 754 | - 'EventEspresso\core\services\request\files\FilesDataHandler' => [ |
|
| 755 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 756 | - ], |
|
| 757 | - 'EventEspresso\core\libraries\batch\BatchRequestProcessor' => [ |
|
| 758 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 759 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 760 | - ], |
|
| 761 | - 'EventEspresso\core\domain\services\converters\RestApiSpoofer' => [ |
|
| 762 | - 'WP_REST_Server' => EE_Dependency_Map::load_from_cache, |
|
| 763 | - 'EED_Core_Rest_Api' => EE_Dependency_Map::load_from_cache, |
|
| 764 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache, |
|
| 765 | - null, |
|
| 766 | - ], |
|
| 767 | - 'EventEspresso\core\services\routing\RouteHandler' => [ |
|
| 768 | - 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 769 | - 'EventEspresso\core\services\json\JsonDataNodeHandler' => EE_Dependency_Map::load_from_cache, |
|
| 770 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 771 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 772 | - 'EventEspresso\core\services\routing\RouteCollection' => EE_Dependency_Map::load_from_cache, |
|
| 773 | - ], |
|
| 774 | - 'EventEspresso\core\services\json\JsonDataNodeHandler' => [ |
|
| 775 | - 'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache, |
|
| 776 | - ], |
|
| 777 | - 'EventEspresso\core\services\routing\Router' => [ |
|
| 778 | - 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 779 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 780 | - 'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache, |
|
| 781 | - ], |
|
| 782 | - 'EventEspresso\core\services\assets\AssetManifest' => [ |
|
| 783 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 784 | - ], |
|
| 785 | - 'EventEspresso\core\services\assets\AssetManifestFactory' => [ |
|
| 786 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 787 | - ], |
|
| 788 | - 'EventEspresso\core\services\assets\BaristaFactory' => [ |
|
| 789 | - 'EventEspresso\core\services\assets\AssetManifestFactory' => EE_Dependency_Map::load_from_cache, |
|
| 790 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 791 | - ], |
|
| 792 | - 'EventEspresso\core\domain\services\capabilities\FeatureFlagsConfig' => [ |
|
| 793 | - 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 794 | - 'EventEspresso\core\services\json\JsonDataHandler' => EE_Dependency_Map::load_from_cache, |
|
| 795 | - ], |
|
| 796 | - 'EventEspresso\core\domain\services\capabilities\FeatureFlags' => [ |
|
| 797 | - 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 798 | - 'EventEspresso\core\domain\services\capabilities\FeatureFlagsConfig' => EE_Dependency_Map::load_from_cache, |
|
| 799 | - ], |
|
| 800 | - 'EventEspresso\core\services\addon\AddonManager' => [ |
|
| 801 | - 'EventEspresso\core\services\addon\AddonCollection' => EE_Dependency_Map::load_from_cache, |
|
| 802 | - 'EventEspresso\core\Psr4Autoloader' => EE_Dependency_Map::load_from_cache, |
|
| 803 | - 'EventEspresso\core\services\addon\api\v1\RegisterAddon' => EE_Dependency_Map::load_from_cache, |
|
| 804 | - 'EventEspresso\core\services\addon\api\IncompatibleAddonHandler' => EE_Dependency_Map::load_from_cache, |
|
| 805 | - 'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler' => EE_Dependency_Map::load_from_cache, |
|
| 806 | - ], |
|
| 807 | - 'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler' => [ |
|
| 808 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 809 | - ], |
|
| 810 | - 'EventEspresso\core\libraries\batch\JobHandlers\ExecuteBatchDeletion' => [ |
|
| 811 | - 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 812 | - ], |
|
| 813 | - 'EventEspresso\core\libraries\batch\JobHandlers\PreviewEventDeletion' => [ |
|
| 814 | - 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 815 | - ], |
|
| 816 | - 'EventEspresso\core\domain\services\admin\events\data\PreviewDeletion' => [ |
|
| 817 | - 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 818 | - 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
| 819 | - 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
| 820 | - 'EEM_Registration' => EE_Dependency_Map::load_from_cache, |
|
| 821 | - ], |
|
| 822 | - 'EventEspresso\core\domain\services\admin\events\data\ConfirmDeletion' => [ |
|
| 823 | - 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 824 | - ], |
|
| 825 | - 'EventEspresso\core\services\request\CurrentPage' => [ |
|
| 826 | - 'EE_CPT_Strategy' => EE_Dependency_Map::load_from_cache, |
|
| 827 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 828 | - ], |
|
| 829 | - 'EventEspresso\core\services\shortcodes\LegacyShortcodesManager' => [ |
|
| 830 | - 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 831 | - 'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache, |
|
| 832 | - ], |
|
| 833 | - 'EventEspresso\core\services\shortcodes\ShortcodesManager' => [ |
|
| 834 | - 'EventEspresso\core\services\shortcodes\LegacyShortcodesManager' => EE_Dependency_Map::load_from_cache, |
|
| 835 | - 'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache, |
|
| 836 | - ], |
|
| 837 | - 'EventEspresso\core\domain\entities\users\CurrentUser' => [ |
|
| 838 | - 'EventEspresso\core\domain\entities\users\EventManagers' => EE_Dependency_Map::load_from_cache, |
|
| 839 | - ], |
|
| 840 | - 'EventEspresso\core\services\form\meta\InputTypes' => [ |
|
| 841 | - 'EventEspresso\core\services\form\meta\inputs\Block' => EE_Dependency_Map::load_from_cache, |
|
| 842 | - 'EventEspresso\core\services\form\meta\inputs\Button' => EE_Dependency_Map::load_from_cache, |
|
| 843 | - 'EventEspresso\core\services\form\meta\inputs\DateTime' => EE_Dependency_Map::load_from_cache, |
|
| 844 | - 'EventEspresso\core\services\form\meta\inputs\Input' => EE_Dependency_Map::load_from_cache, |
|
| 845 | - 'EventEspresso\core\services\form\meta\inputs\Number' => EE_Dependency_Map::load_from_cache, |
|
| 846 | - 'EventEspresso\core\services\form\meta\inputs\Phone' => EE_Dependency_Map::load_from_cache, |
|
| 847 | - 'EventEspresso\core\services\form\meta\inputs\Select' => EE_Dependency_Map::load_from_cache, |
|
| 848 | - 'EventEspresso\core\services\form\meta\inputs\Text' => EE_Dependency_Map::load_from_cache, |
|
| 849 | - ], |
|
| 850 | - 'EventEspresso\core\domain\services\registration\form\v1\RegFormDependencyHandler' => [ |
|
| 851 | - 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 852 | - ], |
|
| 853 | - 'EventEspresso\core\services\calculators\LineItemCalculator' => [ |
|
| 854 | - 'EventEspresso\core\services\helpers\DecimalValues' => EE_Dependency_Map::load_from_cache, |
|
| 855 | - ], |
|
| 856 | - 'EventEspresso\core\services\helpers\DecimalValues' => [ |
|
| 857 | - 'EE_Currency_Config' => EE_Dependency_Map::load_from_cache, |
|
| 858 | - ], |
|
| 859 | - 'EE_Brewing_Regular' => [ |
|
| 860 | - 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 861 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 862 | - 'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache, |
|
| 863 | - 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 864 | - ], |
|
| 865 | - 'EventEspresso\core\domain\services\messages\MessageTemplateRequestData' => [ |
|
| 866 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 867 | - ], |
|
| 868 | - 'EventEspresso\core\domain\services\messages\MessageTemplateValidator' => [ |
|
| 869 | - 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 870 | - ], |
|
| 871 | - 'EventEspresso\core\domain\services\messages\MessageTemplateManager' => [ |
|
| 872 | - 'EEM_Message_Template' => EE_Dependency_Map::load_from_cache, |
|
| 873 | - 'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache, |
|
| 874 | - 'EventEspresso\core\domain\services\messages\MessageTemplateRequestData' => EE_Dependency_Map::load_from_cache, |
|
| 875 | - 'EventEspresso\core\domain\services\messages\MessageTemplateValidator' => EE_Dependency_Map::load_from_cache, |
|
| 876 | - 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 877 | - ], |
|
| 878 | - 'EventEspresso\core\services\request\sanitizers\RequestSanitizer' => [ |
|
| 879 | - 'EventEspresso\core\domain\services\validation\email\strategies\Basic' => EE_Dependency_Map::load_from_cache, |
|
| 880 | - ], |
|
| 881 | - ]; |
|
| 882 | - } |
|
| 883 | - |
|
| 884 | - |
|
| 885 | - /** |
|
| 886 | - * Registers how core classes are loaded. |
|
| 887 | - * This can either be done by simply providing the name of one of the EE_Registry loader methods such as: |
|
| 888 | - * 'EE_Request_Handler' => 'load_core' |
|
| 889 | - * 'EE_Messages_Queue' => 'load_lib' |
|
| 890 | - * 'EEH_Debug_Tools' => 'load_helper' |
|
| 891 | - * or, if greater control is required, by providing a custom closure. For example: |
|
| 892 | - * 'Some_Class' => function () { |
|
| 893 | - * return new Some_Class(); |
|
| 894 | - * }, |
|
| 895 | - * This is required for instantiating dependencies |
|
| 896 | - * where an interface has been type hinted in a class constructor. For example: |
|
| 897 | - * 'Required_Interface' => function () { |
|
| 898 | - * return new A_Class_That_Implements_Required_Interface(); |
|
| 899 | - * }, |
|
| 900 | - */ |
|
| 901 | - protected function _register_core_class_loaders() |
|
| 902 | - { |
|
| 903 | - $this->_class_loaders = [ |
|
| 904 | - // load_core |
|
| 905 | - 'EE_Dependency_Map' => function () { |
|
| 906 | - return $this; |
|
| 907 | - }, |
|
| 908 | - 'EE_Capabilities' => 'load_core', |
|
| 909 | - 'EE_Encryption' => 'load_core', |
|
| 910 | - 'EE_Front_Controller' => 'load_core', |
|
| 911 | - 'EE_Module_Request_Router' => 'load_core', |
|
| 912 | - 'EE_Registry' => 'load_core', |
|
| 913 | - 'EE_Request' => function () { |
|
| 914 | - return $this->legacy_request; |
|
| 915 | - }, |
|
| 916 | - 'EventEspresso\core\services\request\Request' => function () { |
|
| 917 | - return $this->request; |
|
| 918 | - }, |
|
| 919 | - 'EventEspresso\core\services\request\Response' => function () { |
|
| 920 | - return $this->response; |
|
| 921 | - }, |
|
| 922 | - 'EE_Base' => 'load_core', |
|
| 923 | - 'EE_Request_Handler' => 'load_core', |
|
| 924 | - 'EE_Session' => 'load_core', |
|
| 925 | - 'EE_Cron_Tasks' => 'load_core', |
|
| 926 | - 'EE_System' => 'load_core', |
|
| 927 | - 'EE_Maintenance_Mode' => 'load_core', |
|
| 928 | - 'EE_Register_CPTs' => 'load_core', |
|
| 929 | - 'EE_Admin' => 'load_core', |
|
| 930 | - 'EE_CPT_Strategy' => 'load_core', |
|
| 931 | - // load_class |
|
| 932 | - 'EE_Registration_Processor' => 'load_class', |
|
| 933 | - // load_lib |
|
| 934 | - 'EE_Message_Resource_Manager' => 'load_lib', |
|
| 935 | - 'EE_Message_Type_Collection' => 'load_lib', |
|
| 936 | - 'EE_Message_Type_Collection_Loader' => 'load_lib', |
|
| 937 | - 'EE_Messenger_Collection' => 'load_lib', |
|
| 938 | - 'EE_Messenger_Collection_Loader' => 'load_lib', |
|
| 939 | - 'EE_Messages_Processor' => 'load_lib', |
|
| 940 | - 'EE_Message_Repository' => 'load_lib', |
|
| 941 | - 'EE_Messages_Queue' => 'load_lib', |
|
| 942 | - 'EE_Messages_Data_Handler_Collection' => 'load_lib', |
|
| 943 | - 'EE_Message_Template_Group_Collection' => 'load_lib', |
|
| 944 | - 'EE_Payment_Method_Manager' => 'load_lib', |
|
| 945 | - 'EE_Payment_Processor' => 'load_core', |
|
| 946 | - 'EE_DMS_Core_4_1_0' => 'load_dms', |
|
| 947 | - 'EE_DMS_Core_4_2_0' => 'load_dms', |
|
| 948 | - 'EE_DMS_Core_4_3_0' => 'load_dms', |
|
| 949 | - 'EE_DMS_Core_4_5_0' => 'load_dms', |
|
| 950 | - 'EE_DMS_Core_4_6_0' => 'load_dms', |
|
| 951 | - 'EE_DMS_Core_4_7_0' => 'load_dms', |
|
| 952 | - 'EE_DMS_Core_4_8_0' => 'load_dms', |
|
| 953 | - 'EE_DMS_Core_4_9_0' => 'load_dms', |
|
| 954 | - 'EE_DMS_Core_4_10_0' => 'load_dms', |
|
| 955 | - 'EE_DMS_Core_5_0_0' => 'load_dms', |
|
| 956 | - 'EE_Messages_Generator' => static function () { |
|
| 957 | - return EE_Registry::instance()->load_lib( |
|
| 958 | - 'Messages_Generator', |
|
| 959 | - [], |
|
| 960 | - false, |
|
| 961 | - false |
|
| 962 | - ); |
|
| 963 | - }, |
|
| 964 | - 'EE_Messages_Template_Defaults' => static function ($arguments = []) { |
|
| 965 | - return EE_Registry::instance()->load_lib( |
|
| 966 | - 'Messages_Template_Defaults', |
|
| 967 | - $arguments, |
|
| 968 | - false, |
|
| 969 | - false |
|
| 970 | - ); |
|
| 971 | - }, |
|
| 972 | - // load_helper |
|
| 973 | - 'EEH_Parse_Shortcodes' => static function () { |
|
| 974 | - if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) { |
|
| 975 | - return new EEH_Parse_Shortcodes(); |
|
| 976 | - } |
|
| 977 | - return null; |
|
| 978 | - }, |
|
| 979 | - 'EE_Template_Config' => static function () { |
|
| 980 | - return EE_Config::instance()->template_settings; |
|
| 981 | - }, |
|
| 982 | - 'EE_Currency_Config' => static function () { |
|
| 983 | - return EE_Currency_Config::getCurrencyConfig(); |
|
| 984 | - }, |
|
| 985 | - 'EE_Registration_Config' => static function () { |
|
| 986 | - return EE_Config::instance()->registration; |
|
| 987 | - }, |
|
| 988 | - 'EE_Core_Config' => static function () { |
|
| 989 | - return EE_Config::instance()->core; |
|
| 990 | - }, |
|
| 991 | - 'EventEspresso\core\services\loaders\Loader' => static function () { |
|
| 992 | - return LoaderFactory::getLoader(); |
|
| 993 | - }, |
|
| 994 | - 'EE_Network_Config' => static function () { |
|
| 995 | - return EE_Network_Config::instance(); |
|
| 996 | - }, |
|
| 997 | - 'EE_Config' => static function () { |
|
| 998 | - return EE_Config::instance(); |
|
| 999 | - }, |
|
| 1000 | - 'EventEspresso\core\domain\Domain' => static function () { |
|
| 1001 | - return DomainFactory::getEventEspressoCoreDomain(); |
|
| 1002 | - }, |
|
| 1003 | - 'EE_Admin_Config' => static function () { |
|
| 1004 | - return EE_Config::instance()->admin; |
|
| 1005 | - }, |
|
| 1006 | - 'EE_Organization_Config' => static function () { |
|
| 1007 | - return EE_Config::instance()->organization; |
|
| 1008 | - }, |
|
| 1009 | - 'EE_Network_Core_Config' => static function () { |
|
| 1010 | - return EE_Network_Config::instance()->core; |
|
| 1011 | - }, |
|
| 1012 | - 'EE_Environment_Config' => static function () { |
|
| 1013 | - return EE_Config::instance()->environment; |
|
| 1014 | - }, |
|
| 1015 | - 'EED_Core_Rest_Api' => static function () { |
|
| 1016 | - return EED_Core_Rest_Api::instance(); |
|
| 1017 | - }, |
|
| 1018 | - 'WP_REST_Server' => static function () { |
|
| 1019 | - return rest_get_server(); |
|
| 1020 | - }, |
|
| 1021 | - 'EventEspresso\core\Psr4Autoloader' => static function () { |
|
| 1022 | - return EE_Psr4AutoloaderInit::psr4_loader(); |
|
| 1023 | - }, |
|
| 1024 | - 'EE_Ticket_Selector_Config' => function () { |
|
| 1025 | - return EE_Config::instance()->template_settings->EED_Ticket_Selector; |
|
| 1026 | - }, |
|
| 1027 | - ]; |
|
| 1028 | - } |
|
| 1029 | - |
|
| 1030 | - |
|
| 1031 | - /** |
|
| 1032 | - * can be used for supplying alternate names for classes, |
|
| 1033 | - * or for connecting interface names to instantiable classes |
|
| 1034 | - * |
|
| 1035 | - * @throws InvalidAliasException |
|
| 1036 | - */ |
|
| 1037 | - protected function _register_core_aliases() |
|
| 1038 | - { |
|
| 1039 | - $aliases = [ |
|
| 1040 | - 'CommandBusInterface' => 'EventEspresso\core\services\commands\CommandBusInterface', |
|
| 1041 | - 'EventEspresso\core\services\commands\CommandBusInterface' => 'EventEspresso\core\services\commands\CommandBus', |
|
| 1042 | - 'CommandHandlerManagerInterface' => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface', |
|
| 1043 | - 'EventEspresso\core\services\commands\CommandHandlerManagerInterface' => 'EventEspresso\core\services\commands\CommandHandlerManager', |
|
| 1044 | - 'CapChecker' => 'EventEspresso\core\services\commands\middleware\CapChecker', |
|
| 1045 | - 'AddActionHook' => 'EventEspresso\core\services\commands\middleware\AddActionHook', |
|
| 1046 | - 'CapabilitiesChecker' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker', |
|
| 1047 | - 'CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface', |
|
| 1048 | - 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker', |
|
| 1049 | - 'CreateRegistrationService' => 'EventEspresso\core\domain\services\registration\CreateRegistrationService', |
|
| 1050 | - 'CreateRegistrationCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CreateRegistrationCommand', |
|
| 1051 | - 'CopyRegistrationDetailsCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationDetailsCommand', |
|
| 1052 | - 'CopyRegistrationPaymentsCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationPaymentsCommand', |
|
| 1053 | - 'CancelRegistrationAndTicketLineItemCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler', |
|
| 1054 | - 'UpdateRegistrationAndTransactionAfterChangeCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler', |
|
| 1055 | - 'CreateTicketLineItemCommandHandler' => 'EventEspresso\core\domain\services\commands\ticket\CreateTicketLineItemCommand', |
|
| 1056 | - 'CreateTransactionCommandHandler' => 'EventEspresso\core\domain\services\commands\transaction\CreateTransactionCommandHandler', |
|
| 1057 | - 'CreateAttendeeCommandHandler' => 'EventEspresso\core\domain\services\commands\attendee\CreateAttendeeCommandHandler', |
|
| 1058 | - 'TableManager' => 'EventEspresso\core\services\database\TableManager', |
|
| 1059 | - 'TableAnalysis' => 'EventEspresso\core\services\database\TableAnalysis', |
|
| 1060 | - 'EspressoShortcode' => 'EventEspresso\core\services\shortcodes\EspressoShortcode', |
|
| 1061 | - 'ShortcodeInterface' => 'EventEspresso\core\services\shortcodes\ShortcodeInterface', |
|
| 1062 | - 'EventEspresso\core\services\shortcodes\ShortcodeInterface' => 'EventEspresso\core\services\shortcodes\EspressoShortcode', |
|
| 1063 | - 'EventEspresso\core\services\cache\CacheStorageInterface' => 'EventEspresso\core\services\cache\TransientCacheStorage', |
|
| 1064 | - 'LoaderInterface' => 'EventEspresso\core\services\loaders\LoaderInterface', |
|
| 1065 | - 'EventEspresso\core\services\loaders\LoaderInterface' => 'EventEspresso\core\services\loaders\Loader', |
|
| 1066 | - 'CommandFactoryInterface' => 'EventEspresso\core\services\commands\CommandFactoryInterface', |
|
| 1067 | - 'EventEspresso\core\services\commands\CommandFactoryInterface' => 'EventEspresso\core\services\commands\CommandFactory', |
|
| 1068 | - 'EmailValidatorInterface' => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface', |
|
| 1069 | - 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface' => 'EventEspresso\core\domain\services\validation\email\EmailValidationService', |
|
| 1070 | - 'NoticeConverterInterface' => 'EventEspresso\core\services\notices\NoticeConverterInterface', |
|
| 1071 | - 'EventEspresso\core\services\notices\NoticeConverterInterface' => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors', |
|
| 1072 | - 'NoticesContainerInterface' => 'EventEspresso\core\services\notices\NoticesContainerInterface', |
|
| 1073 | - 'EventEspresso\core\services\notices\NoticesContainerInterface' => 'EventEspresso\core\services\notices\NoticesContainer', |
|
| 1074 | - 'EventEspresso\core\services\request\RequestInterface' => 'EventEspresso\core\services\request\Request', |
|
| 1075 | - 'EventEspresso\core\services\request\ResponseInterface' => 'EventEspresso\core\services\request\Response', |
|
| 1076 | - 'EventEspresso\core\domain\DomainInterface' => 'EventEspresso\core\domain\Domain', |
|
| 1077 | - 'Registration_Processor' => 'EE_Registration_Processor', |
|
| 1078 | - 'EventEspresso\core\services\assets\AssetManifestInterface' => 'EventEspresso\core\services\assets\AssetManifest', |
|
| 1079 | - ]; |
|
| 1080 | - foreach ($aliases as $alias => $fqn) { |
|
| 1081 | - if (is_array($fqn)) { |
|
| 1082 | - foreach ($fqn as $class => $for_class) { |
|
| 1083 | - $this->class_cache->addAlias($class, $alias, $for_class); |
|
| 1084 | - } |
|
| 1085 | - continue; |
|
| 1086 | - } |
|
| 1087 | - $this->class_cache->addAlias($fqn, $alias); |
|
| 1088 | - } |
|
| 1089 | - if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) { |
|
| 1090 | - $this->class_cache->addAlias( |
|
| 1091 | - 'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices', |
|
| 1092 | - 'EventEspresso\core\services\notices\NoticeConverterInterface' |
|
| 1093 | - ); |
|
| 1094 | - } |
|
| 1095 | - } |
|
| 1096 | - |
|
| 1097 | - |
|
| 1098 | - public function debug($for_class = '') |
|
| 1099 | - { |
|
| 1100 | - if (method_exists($this->class_cache, 'debug')) { |
|
| 1101 | - $this->class_cache->debug($for_class); |
|
| 1102 | - } |
|
| 1103 | - } |
|
| 1104 | - |
|
| 1105 | - |
|
| 1106 | - /** |
|
| 1107 | - * This is used to reset the internal map and class_loaders to their original default state at the beginning of the |
|
| 1108 | - * request Primarily used by unit tests. |
|
| 1109 | - */ |
|
| 1110 | - public function reset() |
|
| 1111 | - { |
|
| 1112 | - $this->_register_core_class_loaders(); |
|
| 1113 | - $this->_register_core_dependencies(); |
|
| 1114 | - } |
|
| 1115 | - |
|
| 1116 | - |
|
| 1117 | - /** |
|
| 1118 | - * PLZ NOTE: a better name for this method would be is_alias() |
|
| 1119 | - * because it returns TRUE if the provided fully qualified name IS an alias |
|
| 1120 | - * WHY? |
|
| 1121 | - * Because if a class is type hinting for a concretion, |
|
| 1122 | - * then why would we need to find another class to supply it? |
|
| 1123 | - * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`, |
|
| 1124 | - * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`. |
|
| 1125 | - * Don't go looking for some substitute. |
|
| 1126 | - * Whereas if a class is type hinting for an interface... |
|
| 1127 | - * then we need to find an actual class to use. |
|
| 1128 | - * So the interface IS the alias for some other FQN, |
|
| 1129 | - * and we need to find out if `Fully/Qualified/Namespace/SomeInterface` |
|
| 1130 | - * represents some other class. |
|
| 1131 | - * |
|
| 1132 | - * @param string $fqn |
|
| 1133 | - * @param string $for_class |
|
| 1134 | - * @return bool |
|
| 1135 | - * @deprecated 4.9.62.p |
|
| 1136 | - */ |
|
| 1137 | - public function has_alias(string $fqn = '', string $for_class = ''): bool |
|
| 1138 | - { |
|
| 1139 | - return $this->isAlias($fqn, $for_class); |
|
| 1140 | - } |
|
| 1141 | - |
|
| 1142 | - |
|
| 1143 | - /** |
|
| 1144 | - * PLZ NOTE: a better name for this method would be get_fqn_for_alias() |
|
| 1145 | - * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias |
|
| 1146 | - * functions recursively, so that multiple aliases can be used to drill down to a FQN |
|
| 1147 | - * for example: |
|
| 1148 | - * if the following two entries were added to the _aliases array: |
|
| 1149 | - * array( |
|
| 1150 | - * 'interface_alias' => 'some\namespace\interface' |
|
| 1151 | - * 'some\namespace\interface' => 'some\namespace\classname' |
|
| 1152 | - * ) |
|
| 1153 | - * then one could use EE_Registry::instance()->create( 'interface_alias' ) |
|
| 1154 | - * to load an instance of 'some\namespace\classname' |
|
| 1155 | - * |
|
| 1156 | - * @param string $alias |
|
| 1157 | - * @param string $for_class |
|
| 1158 | - * @return string |
|
| 1159 | - * @deprecated 4.9.62.p |
|
| 1160 | - */ |
|
| 1161 | - public function get_alias(string $alias = '', string $for_class = ''): string |
|
| 1162 | - { |
|
| 1163 | - return $this->getFqnForAlias($alias, $for_class); |
|
| 1164 | - } |
|
| 23 | + /** |
|
| 24 | + * This means that the requested class dependency is not present in the dependency map |
|
| 25 | + */ |
|
| 26 | + const not_registered = 0; |
|
| 27 | + |
|
| 28 | + /** |
|
| 29 | + * This instructs class loaders to ALWAYS return a newly instantiated object for the requested class. |
|
| 30 | + */ |
|
| 31 | + const load_new_object = 1; |
|
| 32 | + |
|
| 33 | + /** |
|
| 34 | + * This instructs class loaders to return a previously instantiated and cached object for the requested class. |
|
| 35 | + * IF a previously instantiated object does not exist, a new one will be created and added to the cache. |
|
| 36 | + */ |
|
| 37 | + const load_from_cache = 2; |
|
| 38 | + |
|
| 39 | + /** |
|
| 40 | + * When registering a dependency, |
|
| 41 | + * this indicates to keep any existing dependencies that already exist, |
|
| 42 | + * and simply discard any new dependencies declared in the incoming data |
|
| 43 | + */ |
|
| 44 | + const KEEP_EXISTING_DEPENDENCIES = 0; |
|
| 45 | + |
|
| 46 | + /** |
|
| 47 | + * When registering a dependency, |
|
| 48 | + * this indicates to overwrite any existing dependencies that already exist using the incoming data |
|
| 49 | + */ |
|
| 50 | + const OVERWRITE_DEPENDENCIES = 1; |
|
| 51 | + |
|
| 52 | + protected static ?EE_Dependency_Map $_instance = null; |
|
| 53 | + |
|
| 54 | + private ClassInterfaceCache $class_cache; |
|
| 55 | + |
|
| 56 | + protected ?RequestInterface $request = null; |
|
| 57 | + |
|
| 58 | + protected ?LegacyRequestInterface $legacy_request = null; |
|
| 59 | + |
|
| 60 | + protected ?ResponseInterface $response = null; |
|
| 61 | + |
|
| 62 | + protected ?LoaderInterface $loader = null; |
|
| 63 | + |
|
| 64 | + protected array $_dependency_map = []; |
|
| 65 | + |
|
| 66 | + protected array $_class_loaders = []; |
|
| 67 | + |
|
| 68 | + |
|
| 69 | + /** |
|
| 70 | + * EE_Dependency_Map constructor. |
|
| 71 | + * |
|
| 72 | + * @param ClassInterfaceCache $class_cache |
|
| 73 | + */ |
|
| 74 | + protected function __construct(ClassInterfaceCache $class_cache) |
|
| 75 | + { |
|
| 76 | + $this->class_cache = $class_cache; |
|
| 77 | + do_action('EE_Dependency_Map____construct', $this); |
|
| 78 | + } |
|
| 79 | + |
|
| 80 | + |
|
| 81 | + /** |
|
| 82 | + * @return void |
|
| 83 | + * @throws InvalidAliasException |
|
| 84 | + */ |
|
| 85 | + public function initialize() |
|
| 86 | + { |
|
| 87 | + $this->_register_core_dependencies(); |
|
| 88 | + $this->_register_core_class_loaders(); |
|
| 89 | + $this->_register_core_aliases(); |
|
| 90 | + } |
|
| 91 | + |
|
| 92 | + |
|
| 93 | + /** |
|
| 94 | + * @singleton method used to instantiate class object |
|
| 95 | + * @param ClassInterfaceCache|null $class_cache |
|
| 96 | + * @return EE_Dependency_Map |
|
| 97 | + */ |
|
| 98 | + public static function instance(ClassInterfaceCache $class_cache = null): EE_Dependency_Map |
|
| 99 | + { |
|
| 100 | + // check if class object is instantiated, and instantiated properly |
|
| 101 | + if ( |
|
| 102 | + ! EE_Dependency_Map::$_instance instanceof EE_Dependency_Map |
|
| 103 | + && $class_cache instanceof ClassInterfaceCache |
|
| 104 | + ) { |
|
| 105 | + EE_Dependency_Map::$_instance = new EE_Dependency_Map($class_cache); |
|
| 106 | + } |
|
| 107 | + return EE_Dependency_Map::$_instance; |
|
| 108 | + } |
|
| 109 | + |
|
| 110 | + |
|
| 111 | + /** |
|
| 112 | + * @param RequestInterface $request |
|
| 113 | + */ |
|
| 114 | + public function setRequest(RequestInterface $request) |
|
| 115 | + { |
|
| 116 | + $this->request = $request; |
|
| 117 | + } |
|
| 118 | + |
|
| 119 | + |
|
| 120 | + /** |
|
| 121 | + * @param LegacyRequestInterface $legacy_request |
|
| 122 | + */ |
|
| 123 | + public function setLegacyRequest(LegacyRequestInterface $legacy_request) |
|
| 124 | + { |
|
| 125 | + $this->legacy_request = $legacy_request; |
|
| 126 | + } |
|
| 127 | + |
|
| 128 | + |
|
| 129 | + /** |
|
| 130 | + * @param ResponseInterface $response |
|
| 131 | + */ |
|
| 132 | + public function setResponse(ResponseInterface $response) |
|
| 133 | + { |
|
| 134 | + $this->response = $response; |
|
| 135 | + } |
|
| 136 | + |
|
| 137 | + |
|
| 138 | + /** |
|
| 139 | + * @param LoaderInterface $loader |
|
| 140 | + */ |
|
| 141 | + public function setLoader(LoaderInterface $loader) |
|
| 142 | + { |
|
| 143 | + $this->loader = $loader; |
|
| 144 | + } |
|
| 145 | + |
|
| 146 | + |
|
| 147 | + /** |
|
| 148 | + * @param string $class |
|
| 149 | + * @param array $dependencies |
|
| 150 | + * @param int $overwrite |
|
| 151 | + * @return bool |
|
| 152 | + */ |
|
| 153 | + public static function register_dependencies( |
|
| 154 | + string $class, |
|
| 155 | + array $dependencies, |
|
| 156 | + int $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES |
|
| 157 | + ): bool { |
|
| 158 | + return EE_Dependency_Map::$_instance->registerDependencies($class, $dependencies, $overwrite); |
|
| 159 | + } |
|
| 160 | + |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * Assigns an array of class names and corresponding load sources (new or cached) |
|
| 164 | + * to the class specified by the first parameter. |
|
| 165 | + * IMPORTANT !!! |
|
| 166 | + * The order of elements in the incoming $dependencies array MUST match |
|
| 167 | + * the order of the constructor parameters for the class in question. |
|
| 168 | + * This is especially important when overriding any existing dependencies that are registered. |
|
| 169 | + * the third parameter controls whether any duplicate dependencies are overwritten or not. |
|
| 170 | + * |
|
| 171 | + * @param string $class |
|
| 172 | + * @param array $dependencies |
|
| 173 | + * @param int $overwrite |
|
| 174 | + * @return bool |
|
| 175 | + */ |
|
| 176 | + public function registerDependencies( |
|
| 177 | + string $class, |
|
| 178 | + array $dependencies, |
|
| 179 | + int $overwrite = EE_Dependency_Map::KEEP_EXISTING_DEPENDENCIES |
|
| 180 | + ): bool { |
|
| 181 | + if (empty($dependencies)) { |
|
| 182 | + return false; |
|
| 183 | + } |
|
| 184 | + $class = trim($class, '\\'); |
|
| 185 | + $registered = false; |
|
| 186 | + if (empty(EE_Dependency_Map::$_instance->_dependency_map[ $class ])) { |
|
| 187 | + EE_Dependency_Map::$_instance->_dependency_map[ $class ] = []; |
|
| 188 | + } |
|
| 189 | + // we need to make sure that any aliases used when registering a dependency |
|
| 190 | + // get resolved to the correct class name |
|
| 191 | + foreach ($dependencies as $dependency => $load_source) { |
|
| 192 | + $alias = EE_Dependency_Map::$_instance->getFqnForAlias($dependency); |
|
| 193 | + if ( |
|
| 194 | + $overwrite === EE_Dependency_Map::OVERWRITE_DEPENDENCIES |
|
| 195 | + || ! isset( |
|
| 196 | + EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $dependency ], |
|
| 197 | + EE_Dependency_Map::$_instance->_dependency_map[ $class ][ $alias ] |
|
| 198 | + ) |
|
| 199 | + ) { |
|
| 200 | + unset($dependencies[ $dependency ]); |
|
| 201 | + $dependencies[ $alias ] = $load_source; |
|
| 202 | + $registered = true; |
|
| 203 | + } |
|
| 204 | + } |
|
| 205 | + // now add our two lists of dependencies together. |
|
| 206 | + // using Union (+=) favours the arrays in precedence from left to right, |
|
| 207 | + // so $dependencies is NOT overwritten because it is listed first |
|
| 208 | + // ie: with A = B + C, entries in B take precedence over duplicate entries in C |
|
| 209 | + // Union is way faster than array_merge() but should be used with caution... |
|
| 210 | + // especially with numerically indexed arrays |
|
| 211 | + $dependencies += EE_Dependency_Map::$_instance->_dependency_map[ $class ]; |
|
| 212 | + // now we need to ensure that the resulting dependencies |
|
| 213 | + // array only has the entries that are required for the class |
|
| 214 | + // so first count how many dependencies were originally registered for the class |
|
| 215 | + $dependency_count = count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]); |
|
| 216 | + // if that count is non-zero (meaning dependencies were already registered) |
|
| 217 | + EE_Dependency_Map::$_instance->_dependency_map[ $class ] = $dependency_count |
|
| 218 | + // then truncate the final array to match that count |
|
| 219 | + ? array_slice($dependencies, 0, $dependency_count) |
|
| 220 | + // otherwise just take the incoming array because nothing previously existed |
|
| 221 | + : $dependencies; |
|
| 222 | + return $registered |
|
| 223 | + || count(EE_Dependency_Map::$_instance->_dependency_map[ $class ]) === count($dependencies); |
|
| 224 | + } |
|
| 225 | + |
|
| 226 | + |
|
| 227 | + /** |
|
| 228 | + * @param string $class_name |
|
| 229 | + * @param callable|string $loader |
|
| 230 | + * @param bool $overwrite |
|
| 231 | + * @return bool |
|
| 232 | + * @throws DomainException |
|
| 233 | + */ |
|
| 234 | + public static function register_class_loader( |
|
| 235 | + string $class_name, |
|
| 236 | + $loader = 'load_core', |
|
| 237 | + bool $overwrite = false |
|
| 238 | + ): bool { |
|
| 239 | + return EE_Dependency_Map::$_instance->registerClassLoader($class_name, $loader, $overwrite); |
|
| 240 | + } |
|
| 241 | + |
|
| 242 | + |
|
| 243 | + /** |
|
| 244 | + * @param string $class_name |
|
| 245 | + * @param Closure|string $loader |
|
| 246 | + * @param bool $overwrite |
|
| 247 | + * @return bool |
|
| 248 | + * @throws DomainException |
|
| 249 | + */ |
|
| 250 | + public function registerClassLoader(string $class_name, $loader = 'load_core', bool $overwrite = false): bool |
|
| 251 | + { |
|
| 252 | + if (! $loader instanceof Closure && strpos($class_name, '\\') !== false) { |
|
| 253 | + throw new DomainException( |
|
| 254 | + esc_html__('Don\'t use class loaders for FQCNs.', 'event_espresso') |
|
| 255 | + ); |
|
| 256 | + } |
|
| 257 | + // check that loader is callable or method starts with "load_" and exists in EE_Registry |
|
| 258 | + if ( |
|
| 259 | + ! is_callable($loader) |
|
| 260 | + && ( |
|
| 261 | + strpos($loader, 'load_') !== 0 |
|
| 262 | + || ! method_exists('EE_Registry', $loader) |
|
| 263 | + ) |
|
| 264 | + ) { |
|
| 265 | + throw new DomainException( |
|
| 266 | + sprintf( |
|
| 267 | + esc_html__( |
|
| 268 | + '"%1$s" is not a valid loader method on EE_Registry.', |
|
| 269 | + 'event_espresso' |
|
| 270 | + ), |
|
| 271 | + $loader |
|
| 272 | + ) |
|
| 273 | + ); |
|
| 274 | + } |
|
| 275 | + $class_name = EE_Dependency_Map::$_instance->getFqnForAlias($class_name); |
|
| 276 | + if ($overwrite || ! isset(EE_Dependency_Map::$_instance->_class_loaders[ $class_name ])) { |
|
| 277 | + EE_Dependency_Map::$_instance->_class_loaders[ $class_name ] = $loader; |
|
| 278 | + return true; |
|
| 279 | + } |
|
| 280 | + return false; |
|
| 281 | + } |
|
| 282 | + |
|
| 283 | + |
|
| 284 | + /** |
|
| 285 | + * @return array |
|
| 286 | + */ |
|
| 287 | + public function dependency_map(): array |
|
| 288 | + { |
|
| 289 | + return $this->_dependency_map; |
|
| 290 | + } |
|
| 291 | + |
|
| 292 | + |
|
| 293 | + /** |
|
| 294 | + * returns TRUE if dependency map contains a listing for the provided class name |
|
| 295 | + * |
|
| 296 | + * @param string $class_name |
|
| 297 | + * @return boolean |
|
| 298 | + */ |
|
| 299 | + public function has(string $class_name = ''): bool |
|
| 300 | + { |
|
| 301 | + // all legacy models have the same dependencies |
|
| 302 | + if (strpos($class_name, 'EEM_') === 0) { |
|
| 303 | + $class_name = 'LEGACY_MODELS'; |
|
| 304 | + } |
|
| 305 | + return isset($this->_dependency_map[ $class_name ]); |
|
| 306 | + } |
|
| 307 | + |
|
| 308 | + |
|
| 309 | + /** |
|
| 310 | + * returns TRUE if dependency map contains a listing for the provided class name AND dependency |
|
| 311 | + * |
|
| 312 | + * @param string $class_name |
|
| 313 | + * @param string $dependency |
|
| 314 | + * @return bool |
|
| 315 | + */ |
|
| 316 | + public function has_dependency_for_class(string $class_name = '', string $dependency = ''): bool |
|
| 317 | + { |
|
| 318 | + // all legacy models have the same dependencies |
|
| 319 | + if (strpos($class_name, 'EEM_') === 0) { |
|
| 320 | + $class_name = 'LEGACY_MODELS'; |
|
| 321 | + } |
|
| 322 | + $dependency = $this->getFqnForAlias($dependency, $class_name); |
|
| 323 | + return isset($this->_dependency_map[ $class_name ][ $dependency ]); |
|
| 324 | + } |
|
| 325 | + |
|
| 326 | + |
|
| 327 | + /** |
|
| 328 | + * returns loading strategy for whether a previously cached dependency should be loaded or a new instance returned |
|
| 329 | + * |
|
| 330 | + * @param string $class_name |
|
| 331 | + * @param string $dependency |
|
| 332 | + * @return int |
|
| 333 | + */ |
|
| 334 | + public function loading_strategy_for_class_dependency(string $class_name = '', string $dependency = ''): int |
|
| 335 | + { |
|
| 336 | + // all legacy models have the same dependencies |
|
| 337 | + if (strpos($class_name, 'EEM_') === 0) { |
|
| 338 | + $class_name = 'LEGACY_MODELS'; |
|
| 339 | + } |
|
| 340 | + $dependency = $this->getFqnForAlias($dependency); |
|
| 341 | + return $this->has_dependency_for_class($class_name, $dependency) |
|
| 342 | + ? $this->_dependency_map[ $class_name ][ $dependency ] |
|
| 343 | + : EE_Dependency_Map::not_registered; |
|
| 344 | + } |
|
| 345 | + |
|
| 346 | + |
|
| 347 | + /** |
|
| 348 | + * @param string $class_name |
|
| 349 | + * @return string | Closure |
|
| 350 | + */ |
|
| 351 | + public function class_loader(string $class_name) |
|
| 352 | + { |
|
| 353 | + // all legacy models use load_model() |
|
| 354 | + if (strpos($class_name, 'EEM_') === 0) { |
|
| 355 | + return 'load_model'; |
|
| 356 | + } |
|
| 357 | + // EE_CPT_*_Strategy classes like EE_CPT_Event_Strategy, EE_CPT_Venue_Strategy, etc |
|
| 358 | + // perform strpos() first to avoid loading regex every time we load a class |
|
| 359 | + if ( |
|
| 360 | + strpos($class_name, 'EE_CPT_') === 0 |
|
| 361 | + && preg_match('/^EE_CPT_([a-zA-Z]+)_Strategy$/', $class_name) |
|
| 362 | + ) { |
|
| 363 | + return 'load_core'; |
|
| 364 | + } |
|
| 365 | + $class_name = $this->getFqnForAlias($class_name); |
|
| 366 | + return $this->_class_loaders[ $class_name ] ?? ''; |
|
| 367 | + } |
|
| 368 | + |
|
| 369 | + |
|
| 370 | + /** |
|
| 371 | + * @return array |
|
| 372 | + */ |
|
| 373 | + public function class_loaders(): array |
|
| 374 | + { |
|
| 375 | + return $this->_class_loaders; |
|
| 376 | + } |
|
| 377 | + |
|
| 378 | + |
|
| 379 | + /** |
|
| 380 | + * adds an alias for a classname |
|
| 381 | + * |
|
| 382 | + * @param string $fqcn the class name that should be used (concrete class to replace interface) |
|
| 383 | + * @param string $alias the class name that would be type hinted for (abstract parent or interface) |
|
| 384 | + * @param string $for_class the class that has the dependency (is type hinting for the interface) |
|
| 385 | + * @throws InvalidAliasException |
|
| 386 | + */ |
|
| 387 | + public function add_alias(string $fqcn, string $alias, string $for_class = '') |
|
| 388 | + { |
|
| 389 | + $this->class_cache->addAlias($fqcn, $alias, $for_class); |
|
| 390 | + } |
|
| 391 | + |
|
| 392 | + |
|
| 393 | + /** |
|
| 394 | + * Returns TRUE if the provided fully qualified name IS an alias |
|
| 395 | + * WHY? |
|
| 396 | + * Because if a class is type hinting for a concretion, |
|
| 397 | + * then why would we need to find another class to supply it? |
|
| 398 | + * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`, |
|
| 399 | + * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`. |
|
| 400 | + * Don't go looking for some substitute. |
|
| 401 | + * Whereas if a class is type hinting for an interface... |
|
| 402 | + * then we need to find an actual class to use. |
|
| 403 | + * So the interface IS the alias for some other FQN, |
|
| 404 | + * and we need to find out if `Fully/Qualified/Namespace/SomeInterface` |
|
| 405 | + * represents some other class. |
|
| 406 | + * |
|
| 407 | + * @param string $fqn |
|
| 408 | + * @param string $for_class |
|
| 409 | + * @return bool |
|
| 410 | + */ |
|
| 411 | + public function isAlias(string $fqn = '', string $for_class = ''): bool |
|
| 412 | + { |
|
| 413 | + return $this->class_cache->isAlias($fqn, $for_class); |
|
| 414 | + } |
|
| 415 | + |
|
| 416 | + |
|
| 417 | + /** |
|
| 418 | + * Returns a FQN for provided alias if one exists, otherwise returns the original $alias |
|
| 419 | + * functions recursively, so that multiple aliases can be used to drill down to a FQN |
|
| 420 | + * for example: |
|
| 421 | + * if the following two entries were added to the _aliases array: |
|
| 422 | + * array( |
|
| 423 | + * 'interface_alias' => 'some\namespace\interface' |
|
| 424 | + * 'some\namespace\interface' => 'some\namespace\classname' |
|
| 425 | + * ) |
|
| 426 | + * then one could use EE_Registry::instance()->create( 'interface_alias' ) |
|
| 427 | + * to load an instance of 'some\namespace\classname' |
|
| 428 | + * |
|
| 429 | + * @param string $alias |
|
| 430 | + * @param string $for_class |
|
| 431 | + * @return string |
|
| 432 | + */ |
|
| 433 | + public function getFqnForAlias(string $alias = '', string $for_class = ''): string |
|
| 434 | + { |
|
| 435 | + return $this->class_cache->getFqnForAlias($alias, $for_class); |
|
| 436 | + } |
|
| 437 | + |
|
| 438 | + |
|
| 439 | + /** |
|
| 440 | + * Registers the core dependencies and whether a previously instantiated object should be loaded from the cache, |
|
| 441 | + * if one exists, or whether a new object should be generated every time the requested class is loaded. |
|
| 442 | + * This is done by using the following class constants: |
|
| 443 | + * EE_Dependency_Map::load_from_cache - loads previously instantiated object |
|
| 444 | + * EE_Dependency_Map::load_new_object - generates a new object every time |
|
| 445 | + */ |
|
| 446 | + protected function _register_core_dependencies() |
|
| 447 | + { |
|
| 448 | + $this->_dependency_map = [ |
|
| 449 | + 'EE_Admin' => [ |
|
| 450 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 451 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 452 | + ], |
|
| 453 | + 'EE_Request_Handler' => [ |
|
| 454 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 455 | + 'EventEspresso\core\services\request\Response' => EE_Dependency_Map::load_from_cache, |
|
| 456 | + ], |
|
| 457 | + 'EE_System' => [ |
|
| 458 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 459 | + 'EE_Maintenance_Mode' => EE_Dependency_Map::load_from_cache, |
|
| 460 | + 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 461 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 462 | + 'EventEspresso\core\services\routing\Router' => EE_Dependency_Map::load_from_cache, |
|
| 463 | + ], |
|
| 464 | + 'EE_Session' => [ |
|
| 465 | + 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
| 466 | + 'EventEspresso\core\domain\values\session\SessionLifespan' => EE_Dependency_Map::load_from_cache, |
|
| 467 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 468 | + 'EventEspresso\core\services\session\SessionStartHandler' => EE_Dependency_Map::load_from_cache, |
|
| 469 | + 'EventEspresso\core\services\encryption\Base64Encoder' => EE_Dependency_Map::load_from_cache, |
|
| 470 | + ], |
|
| 471 | + 'EventEspresso\core\services\session\SessionStartHandler' => [ |
|
| 472 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache |
|
| 473 | + ], |
|
| 474 | + 'EE_Cart' => [ |
|
| 475 | + 'EE_Session' => EE_Dependency_Map::load_from_cache, |
|
| 476 | + ], |
|
| 477 | + 'EE_Messenger_Collection_Loader' => [ |
|
| 478 | + 'EE_Messenger_Collection' => EE_Dependency_Map::load_new_object, |
|
| 479 | + ], |
|
| 480 | + 'EE_Message_Type_Collection_Loader' => [ |
|
| 481 | + 'EE_Message_Type_Collection' => EE_Dependency_Map::load_new_object, |
|
| 482 | + ], |
|
| 483 | + 'EE_Message_Resource_Manager' => [ |
|
| 484 | + 'EE_Messenger_Collection_Loader' => EE_Dependency_Map::load_new_object, |
|
| 485 | + 'EE_Message_Type_Collection_Loader' => EE_Dependency_Map::load_new_object, |
|
| 486 | + 'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache, |
|
| 487 | + ], |
|
| 488 | + 'EE_Message_Factory' => [ |
|
| 489 | + 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 490 | + ], |
|
| 491 | + 'EE_messages' => [ |
|
| 492 | + 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 493 | + ], |
|
| 494 | + 'EE_Messages_Generator' => [ |
|
| 495 | + 'EE_Messages_Queue' => EE_Dependency_Map::load_new_object, |
|
| 496 | + 'EE_Messages_Data_Handler_Collection' => EE_Dependency_Map::load_new_object, |
|
| 497 | + 'EE_Message_Template_Group_Collection' => EE_Dependency_Map::load_new_object, |
|
| 498 | + 'EEH_Parse_Shortcodes' => EE_Dependency_Map::load_from_cache, |
|
| 499 | + ], |
|
| 500 | + 'EE_Messages_Processor' => [ |
|
| 501 | + 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 502 | + ], |
|
| 503 | + 'EE_Messages_Queue' => [ |
|
| 504 | + 'EE_Message_Repository' => EE_Dependency_Map::load_new_object, |
|
| 505 | + ], |
|
| 506 | + 'EE_Messages_Template_Defaults' => [ |
|
| 507 | + 'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache, |
|
| 508 | + 'EEM_Message_Template' => EE_Dependency_Map::load_from_cache, |
|
| 509 | + ], |
|
| 510 | + 'EE_Message_To_Generate_From_Request' => [ |
|
| 511 | + 'EE_Message_Resource_Manager' => EE_Dependency_Map::load_from_cache, |
|
| 512 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 513 | + ], |
|
| 514 | + 'EventEspresso\core\services\commands\CommandBus' => [ |
|
| 515 | + 'EventEspresso\core\services\commands\CommandHandlerManager' => EE_Dependency_Map::load_from_cache, |
|
| 516 | + ], |
|
| 517 | + 'EventEspresso\services\commands\CommandHandler' => [ |
|
| 518 | + 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 519 | + 'CommandBusInterface' => EE_Dependency_Map::load_from_cache, |
|
| 520 | + ], |
|
| 521 | + 'EventEspresso\core\services\commands\CommandHandlerManager' => [ |
|
| 522 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 523 | + ], |
|
| 524 | + 'EventEspresso\core\services\commands\CompositeCommandHandler' => [ |
|
| 525 | + 'EventEspresso\core\services\commands\CommandBus' => EE_Dependency_Map::load_from_cache, |
|
| 526 | + 'EventEspresso\core\services\commands\CommandFactory' => EE_Dependency_Map::load_from_cache, |
|
| 527 | + ], |
|
| 528 | + 'EventEspresso\core\services\commands\CommandFactory' => [ |
|
| 529 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 530 | + ], |
|
| 531 | + 'EventEspresso\core\services\commands\middleware\CapChecker' => [ |
|
| 532 | + 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 533 | + ], |
|
| 534 | + 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => [ |
|
| 535 | + 'EE_Capabilities' => EE_Dependency_Map::load_from_cache, |
|
| 536 | + ], |
|
| 537 | + 'EventEspresso\core\domain\services\capabilities\RegistrationsCapChecker' => [ |
|
| 538 | + 'EE_Capabilities' => EE_Dependency_Map::load_from_cache, |
|
| 539 | + ], |
|
| 540 | + 'EventEspresso\core\domain\services\commands\registration\CreateRegistrationCommandHandler' => [ |
|
| 541 | + 'EventEspresso\core\domain\services\registration\CreateRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 542 | + ], |
|
| 543 | + 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationDetailsCommandHandler' => [ |
|
| 544 | + 'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 545 | + ], |
|
| 546 | + 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationPaymentsCommandHandler' => [ |
|
| 547 | + 'EventEspresso\core\domain\services\registration\CopyRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 548 | + ], |
|
| 549 | + 'EventEspresso\core\domain\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler' => [ |
|
| 550 | + 'EventEspresso\core\domain\services\registration\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 551 | + ], |
|
| 552 | + 'EventEspresso\core\domain\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler' => [ |
|
| 553 | + 'EventEspresso\core\domain\services\registration\UpdateRegistrationService' => EE_Dependency_Map::load_from_cache, |
|
| 554 | + ], |
|
| 555 | + 'EventEspresso\core\domain\services\commands\ticket\CreateTicketLineItemCommandHandler' => [ |
|
| 556 | + 'EventEspresso\core\domain\services\ticket\CreateTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 557 | + ], |
|
| 558 | + 'EventEspresso\core\domain\services\commands\ticket\CancelTicketLineItemCommandHandler' => [ |
|
| 559 | + 'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 560 | + ], |
|
| 561 | + 'EventEspresso\core\domain\services\registration\CancelRegistrationService' => [ |
|
| 562 | + 'EventEspresso\core\domain\services\ticket\CancelTicketLineItemService' => EE_Dependency_Map::load_from_cache, |
|
| 563 | + ], |
|
| 564 | + 'EventEspresso\core\domain\services\commands\attendee\CreateAttendeeCommandHandler' => [ |
|
| 565 | + 'EEM_Attendee' => EE_Dependency_Map::load_from_cache, |
|
| 566 | + ], |
|
| 567 | + 'EventEspresso\core\domain\values\session\SessionLifespan' => [ |
|
| 568 | + 'EventEspresso\core\domain\values\session\SessionLifespanOption' => EE_Dependency_Map::load_from_cache, |
|
| 569 | + ], |
|
| 570 | + 'EventEspresso\caffeinated\admin\extend\registration_form\forms\SessionLifespanForm' => [ |
|
| 571 | + 'EventEspresso\core\domain\values\session\SessionLifespanOption' => EE_Dependency_Map::load_from_cache, |
|
| 572 | + ], |
|
| 573 | + 'EventEspresso\caffeinated\admin\extend\registration_form\forms\SessionLifespanFormHandler' => [ |
|
| 574 | + 'EventEspresso\core\domain\values\session\SessionLifespanOption' => EE_Dependency_Map::load_from_cache, |
|
| 575 | + ], |
|
| 576 | + 'EventEspresso\core\services\database\TableManager' => [ |
|
| 577 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 578 | + ], |
|
| 579 | + 'EE_Data_Migration_Class_Base' => [ |
|
| 580 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 581 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 582 | + ], |
|
| 583 | + 'EE_DMS_Core_4_1_0' => [ |
|
| 584 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 585 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 586 | + ], |
|
| 587 | + 'EE_DMS_Core_4_2_0' => [ |
|
| 588 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 589 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 590 | + ], |
|
| 591 | + 'EE_DMS_Core_4_3_0' => [ |
|
| 592 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 593 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 594 | + ], |
|
| 595 | + 'EE_DMS_Core_4_4_0' => [ |
|
| 596 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 597 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 598 | + ], |
|
| 599 | + 'EE_DMS_Core_4_5_0' => [ |
|
| 600 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 601 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 602 | + ], |
|
| 603 | + 'EE_DMS_Core_4_6_0' => [ |
|
| 604 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 605 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 606 | + ], |
|
| 607 | + 'EE_DMS_Core_4_7_0' => [ |
|
| 608 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 609 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 610 | + ], |
|
| 611 | + 'EE_DMS_Core_4_8_0' => [ |
|
| 612 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 613 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 614 | + ], |
|
| 615 | + 'EE_DMS_Core_4_9_0' => [ |
|
| 616 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 617 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 618 | + ], |
|
| 619 | + 'EE_DMS_Core_4_10_0' => [ |
|
| 620 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 621 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 622 | + 'EE_DMS_Core_4_9_0' => EE_Dependency_Map::load_from_cache, |
|
| 623 | + ], |
|
| 624 | + 'EE_DMS_Core_5_0_0' => [ |
|
| 625 | + 'EE_DMS_Core_4_10_0' => EE_Dependency_Map::load_from_cache, |
|
| 626 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 627 | + 'EventEspresso\core\services\database\TableManager' => EE_Dependency_Map::load_from_cache, |
|
| 628 | + ], |
|
| 629 | + 'EventEspresso\core\services\assets\I18nRegistry' => [ |
|
| 630 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 631 | + ], |
|
| 632 | + 'EventEspresso\core\services\assets\Registry' => [ |
|
| 633 | + 'EventEspresso\core\services\assets\AssetCollection' => EE_Dependency_Map::load_from_cache, |
|
| 634 | + 'EventEspresso\core\services\assets\AssetManifest' => EE_Dependency_Map::load_from_cache, |
|
| 635 | + ], |
|
| 636 | + 'EventEspresso\core\domain\entities\shortcodes\EspressoCancelled' => [ |
|
| 637 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 638 | + ], |
|
| 639 | + 'EventEspresso\core\domain\entities\shortcodes\EspressoCheckout' => [ |
|
| 640 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 641 | + ], |
|
| 642 | + 'EventEspresso\core\domain\entities\shortcodes\EspressoEventAttendees' => [ |
|
| 643 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 644 | + ], |
|
| 645 | + 'EventEspresso\core\domain\entities\shortcodes\EspressoEvents' => [ |
|
| 646 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 647 | + ], |
|
| 648 | + 'EventEspresso\core\domain\entities\shortcodes\EspressoThankYou' => [ |
|
| 649 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 650 | + ], |
|
| 651 | + 'EventEspresso\core\domain\entities\shortcodes\EspressoTicketSelector' => [ |
|
| 652 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 653 | + ], |
|
| 654 | + 'EventEspresso\core\domain\entities\shortcodes\EspressoTxnPage' => [ |
|
| 655 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => EE_Dependency_Map::load_from_cache, |
|
| 656 | + ], |
|
| 657 | + 'EventEspresso\core\services\cache\BasicCacheManager' => [ |
|
| 658 | + 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
| 659 | + ], |
|
| 660 | + 'EventEspresso\core\services\cache\PostRelatedCacheManager' => [ |
|
| 661 | + 'EventEspresso\core\services\cache\TransientCacheStorage' => EE_Dependency_Map::load_from_cache, |
|
| 662 | + ], |
|
| 663 | + 'EventEspresso\core\domain\services\validation\email\EmailValidationService' => [ |
|
| 664 | + 'EE_Registration_Config' => EE_Dependency_Map::load_from_cache, |
|
| 665 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 666 | + ], |
|
| 667 | + 'EventEspresso\core\domain\values\EmailAddress' => [ |
|
| 668 | + null, |
|
| 669 | + 'EventEspresso\core\domain\services\validation\email\EmailValidationService' => EE_Dependency_Map::load_from_cache, |
|
| 670 | + ], |
|
| 671 | + 'EventEspresso\core\services\orm\ModelFieldFactory' => [ |
|
| 672 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 673 | + ], |
|
| 674 | + 'LEGACY_MODELS' => [ |
|
| 675 | + null, |
|
| 676 | + 'EventEspresso\core\services\database\ModelFieldFactory' => EE_Dependency_Map::load_from_cache, |
|
| 677 | + ], |
|
| 678 | + 'EE_Module_Request_Router' => [ |
|
| 679 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 680 | + ], |
|
| 681 | + 'EE_Registration_Processor' => [ |
|
| 682 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 683 | + ], |
|
| 684 | + 'EventEspresso\core\services\notifications\PersistentAdminNoticeManager' => [ |
|
| 685 | + 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 686 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 687 | + ], |
|
| 688 | + 'EventEspresso\caffeinated\modules\recaptcha_invisible\InvisibleRecaptcha' => [ |
|
| 689 | + 'EE_Registration_Config' => EE_Dependency_Map::load_from_cache, |
|
| 690 | + 'EE_Session' => EE_Dependency_Map::load_from_cache, |
|
| 691 | + ], |
|
| 692 | + 'EventEspresso\modules\ticket_selector\DisplayTicketSelector' => [ |
|
| 693 | + 'EventEspresso\core\domain\entities\users\CurrentUser' => EE_Dependency_Map::load_from_cache, |
|
| 694 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 695 | + 'EE_Ticket_Selector_Config' => EE_Dependency_Map::load_from_cache, |
|
| 696 | + ], |
|
| 697 | + 'EventEspresso\modules\ticket_selector\ProcessTicketSelector' => [ |
|
| 698 | + 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 699 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 700 | + 'EE_Session' => EE_Dependency_Map::load_from_cache, |
|
| 701 | + 'EEM_Ticket' => EE_Dependency_Map::load_from_cache, |
|
| 702 | + 'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => EE_Dependency_Map::load_from_cache, |
|
| 703 | + ], |
|
| 704 | + 'EventEspresso\modules\ticket_selector\ProcessTicketSelectorPostData' => [ |
|
| 705 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 706 | + 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
| 707 | + ], |
|
| 708 | + 'EventEspresso\modules\ticket_selector\TicketDatetimeAvailabilityTracker' => [ |
|
| 709 | + 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
| 710 | + ], |
|
| 711 | + 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => [ |
|
| 712 | + 'EE_Core_Config' => EE_Dependency_Map::load_from_cache, |
|
| 713 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 714 | + ], |
|
| 715 | + 'EventEspresso\core\domain\services\custom_post_types\RegisterCustomPostTypes' => [ |
|
| 716 | + 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 717 | + ], |
|
| 718 | + 'EventEspresso\core\domain\services\custom_post_types\RegisterCustomTaxonomies' => [ |
|
| 719 | + 'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 720 | + ], |
|
| 721 | + 'EE_CPT_Strategy' => [ |
|
| 722 | + 'EventEspresso\core\domain\entities\custom_post_types\CustomPostTypeDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 723 | + 'EventEspresso\core\domain\entities\custom_post_types\CustomTaxonomyDefinitions' => EE_Dependency_Map::load_from_cache, |
|
| 724 | + ], |
|
| 725 | + 'EventEspresso\core\services\loaders\ObjectIdentifier' => [ |
|
| 726 | + 'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache, |
|
| 727 | + ], |
|
| 728 | + 'EventEspresso\core\CPTs\CptQueryModifier' => [ |
|
| 729 | + null, |
|
| 730 | + null, |
|
| 731 | + null, |
|
| 732 | + 'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache, |
|
| 733 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 734 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 735 | + ], |
|
| 736 | + 'EventEspresso\core\services\dependencies\DependencyResolver' => [ |
|
| 737 | + 'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache, |
|
| 738 | + 'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache, |
|
| 739 | + 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 740 | + ], |
|
| 741 | + 'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => [ |
|
| 742 | + 'EventEspresso\core\services\container\Mirror' => EE_Dependency_Map::load_from_cache, |
|
| 743 | + 'EventEspresso\core\services\loaders\ClassInterfaceCache' => EE_Dependency_Map::load_from_cache, |
|
| 744 | + 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 745 | + ], |
|
| 746 | + 'EventEspresso\core\services\routing\RouteMatchSpecificationFactory' => [ |
|
| 747 | + 'EventEspresso\core\services\routing\RouteMatchSpecificationDependencyResolver' => EE_Dependency_Map::load_from_cache, |
|
| 748 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 749 | + ], |
|
| 750 | + 'EventEspresso\core\services\routing\RouteMatchSpecificationManager' => [ |
|
| 751 | + 'EventEspresso\core\services\routing\RouteMatchSpecificationCollection' => EE_Dependency_Map::load_from_cache, |
|
| 752 | + 'EventEspresso\core\services\routing\RouteMatchSpecificationFactory' => EE_Dependency_Map::load_from_cache, |
|
| 753 | + ], |
|
| 754 | + 'EventEspresso\core\services\request\files\FilesDataHandler' => [ |
|
| 755 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 756 | + ], |
|
| 757 | + 'EventEspresso\core\libraries\batch\BatchRequestProcessor' => [ |
|
| 758 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 759 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 760 | + ], |
|
| 761 | + 'EventEspresso\core\domain\services\converters\RestApiSpoofer' => [ |
|
| 762 | + 'WP_REST_Server' => EE_Dependency_Map::load_from_cache, |
|
| 763 | + 'EED_Core_Rest_Api' => EE_Dependency_Map::load_from_cache, |
|
| 764 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Read' => EE_Dependency_Map::load_from_cache, |
|
| 765 | + null, |
|
| 766 | + ], |
|
| 767 | + 'EventEspresso\core\services\routing\RouteHandler' => [ |
|
| 768 | + 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 769 | + 'EventEspresso\core\services\json\JsonDataNodeHandler' => EE_Dependency_Map::load_from_cache, |
|
| 770 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 771 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 772 | + 'EventEspresso\core\services\routing\RouteCollection' => EE_Dependency_Map::load_from_cache, |
|
| 773 | + ], |
|
| 774 | + 'EventEspresso\core\services\json\JsonDataNodeHandler' => [ |
|
| 775 | + 'EventEspresso\core\services\json\JsonDataNodeValidator' => EE_Dependency_Map::load_from_cache, |
|
| 776 | + ], |
|
| 777 | + 'EventEspresso\core\services\routing\Router' => [ |
|
| 778 | + 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 779 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 780 | + 'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache, |
|
| 781 | + ], |
|
| 782 | + 'EventEspresso\core\services\assets\AssetManifest' => [ |
|
| 783 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 784 | + ], |
|
| 785 | + 'EventEspresso\core\services\assets\AssetManifestFactory' => [ |
|
| 786 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 787 | + ], |
|
| 788 | + 'EventEspresso\core\services\assets\BaristaFactory' => [ |
|
| 789 | + 'EventEspresso\core\services\assets\AssetManifestFactory' => EE_Dependency_Map::load_from_cache, |
|
| 790 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 791 | + ], |
|
| 792 | + 'EventEspresso\core\domain\services\capabilities\FeatureFlagsConfig' => [ |
|
| 793 | + 'EventEspresso\core\domain\Domain' => EE_Dependency_Map::load_from_cache, |
|
| 794 | + 'EventEspresso\core\services\json\JsonDataHandler' => EE_Dependency_Map::load_from_cache, |
|
| 795 | + ], |
|
| 796 | + 'EventEspresso\core\domain\services\capabilities\FeatureFlags' => [ |
|
| 797 | + 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker' => EE_Dependency_Map::load_from_cache, |
|
| 798 | + 'EventEspresso\core\domain\services\capabilities\FeatureFlagsConfig' => EE_Dependency_Map::load_from_cache, |
|
| 799 | + ], |
|
| 800 | + 'EventEspresso\core\services\addon\AddonManager' => [ |
|
| 801 | + 'EventEspresso\core\services\addon\AddonCollection' => EE_Dependency_Map::load_from_cache, |
|
| 802 | + 'EventEspresso\core\Psr4Autoloader' => EE_Dependency_Map::load_from_cache, |
|
| 803 | + 'EventEspresso\core\services\addon\api\v1\RegisterAddon' => EE_Dependency_Map::load_from_cache, |
|
| 804 | + 'EventEspresso\core\services\addon\api\IncompatibleAddonHandler' => EE_Dependency_Map::load_from_cache, |
|
| 805 | + 'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler' => EE_Dependency_Map::load_from_cache, |
|
| 806 | + ], |
|
| 807 | + 'EventEspresso\core\services\addon\api\ThirdPartyPluginHandler' => [ |
|
| 808 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 809 | + ], |
|
| 810 | + 'EventEspresso\core\libraries\batch\JobHandlers\ExecuteBatchDeletion' => [ |
|
| 811 | + 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 812 | + ], |
|
| 813 | + 'EventEspresso\core\libraries\batch\JobHandlers\PreviewEventDeletion' => [ |
|
| 814 | + 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 815 | + ], |
|
| 816 | + 'EventEspresso\core\domain\services\admin\events\data\PreviewDeletion' => [ |
|
| 817 | + 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 818 | + 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
| 819 | + 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
| 820 | + 'EEM_Registration' => EE_Dependency_Map::load_from_cache, |
|
| 821 | + ], |
|
| 822 | + 'EventEspresso\core\domain\services\admin\events\data\ConfirmDeletion' => [ |
|
| 823 | + 'EventEspresso\core\services\orm\tree_traversal\NodeGroupDao' => EE_Dependency_Map::load_from_cache, |
|
| 824 | + ], |
|
| 825 | + 'EventEspresso\core\services\request\CurrentPage' => [ |
|
| 826 | + 'EE_CPT_Strategy' => EE_Dependency_Map::load_from_cache, |
|
| 827 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 828 | + ], |
|
| 829 | + 'EventEspresso\core\services\shortcodes\LegacyShortcodesManager' => [ |
|
| 830 | + 'EE_Registry' => EE_Dependency_Map::load_from_cache, |
|
| 831 | + 'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache, |
|
| 832 | + ], |
|
| 833 | + 'EventEspresso\core\services\shortcodes\ShortcodesManager' => [ |
|
| 834 | + 'EventEspresso\core\services\shortcodes\LegacyShortcodesManager' => EE_Dependency_Map::load_from_cache, |
|
| 835 | + 'EventEspresso\core\services\request\CurrentPage' => EE_Dependency_Map::load_from_cache, |
|
| 836 | + ], |
|
| 837 | + 'EventEspresso\core\domain\entities\users\CurrentUser' => [ |
|
| 838 | + 'EventEspresso\core\domain\entities\users\EventManagers' => EE_Dependency_Map::load_from_cache, |
|
| 839 | + ], |
|
| 840 | + 'EventEspresso\core\services\form\meta\InputTypes' => [ |
|
| 841 | + 'EventEspresso\core\services\form\meta\inputs\Block' => EE_Dependency_Map::load_from_cache, |
|
| 842 | + 'EventEspresso\core\services\form\meta\inputs\Button' => EE_Dependency_Map::load_from_cache, |
|
| 843 | + 'EventEspresso\core\services\form\meta\inputs\DateTime' => EE_Dependency_Map::load_from_cache, |
|
| 844 | + 'EventEspresso\core\services\form\meta\inputs\Input' => EE_Dependency_Map::load_from_cache, |
|
| 845 | + 'EventEspresso\core\services\form\meta\inputs\Number' => EE_Dependency_Map::load_from_cache, |
|
| 846 | + 'EventEspresso\core\services\form\meta\inputs\Phone' => EE_Dependency_Map::load_from_cache, |
|
| 847 | + 'EventEspresso\core\services\form\meta\inputs\Select' => EE_Dependency_Map::load_from_cache, |
|
| 848 | + 'EventEspresso\core\services\form\meta\inputs\Text' => EE_Dependency_Map::load_from_cache, |
|
| 849 | + ], |
|
| 850 | + 'EventEspresso\core\domain\services\registration\form\v1\RegFormDependencyHandler' => [ |
|
| 851 | + 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 852 | + ], |
|
| 853 | + 'EventEspresso\core\services\calculators\LineItemCalculator' => [ |
|
| 854 | + 'EventEspresso\core\services\helpers\DecimalValues' => EE_Dependency_Map::load_from_cache, |
|
| 855 | + ], |
|
| 856 | + 'EventEspresso\core\services\helpers\DecimalValues' => [ |
|
| 857 | + 'EE_Currency_Config' => EE_Dependency_Map::load_from_cache, |
|
| 858 | + ], |
|
| 859 | + 'EE_Brewing_Regular' => [ |
|
| 860 | + 'EE_Dependency_Map' => EE_Dependency_Map::load_from_cache, |
|
| 861 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 862 | + 'EventEspresso\core\services\routing\RouteHandler' => EE_Dependency_Map::load_from_cache, |
|
| 863 | + 'EventEspresso\core\services\database\TableAnalysis' => EE_Dependency_Map::load_from_cache, |
|
| 864 | + ], |
|
| 865 | + 'EventEspresso\core\domain\services\messages\MessageTemplateRequestData' => [ |
|
| 866 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 867 | + ], |
|
| 868 | + 'EventEspresso\core\domain\services\messages\MessageTemplateValidator' => [ |
|
| 869 | + 'EventEspresso\core\services\loaders\Loader' => EE_Dependency_Map::load_from_cache, |
|
| 870 | + ], |
|
| 871 | + 'EventEspresso\core\domain\services\messages\MessageTemplateManager' => [ |
|
| 872 | + 'EEM_Message_Template' => EE_Dependency_Map::load_from_cache, |
|
| 873 | + 'EEM_Message_Template_Group' => EE_Dependency_Map::load_from_cache, |
|
| 874 | + 'EventEspresso\core\domain\services\messages\MessageTemplateRequestData' => EE_Dependency_Map::load_from_cache, |
|
| 875 | + 'EventEspresso\core\domain\services\messages\MessageTemplateValidator' => EE_Dependency_Map::load_from_cache, |
|
| 876 | + 'EventEspresso\core\services\request\Request' => EE_Dependency_Map::load_from_cache, |
|
| 877 | + ], |
|
| 878 | + 'EventEspresso\core\services\request\sanitizers\RequestSanitizer' => [ |
|
| 879 | + 'EventEspresso\core\domain\services\validation\email\strategies\Basic' => EE_Dependency_Map::load_from_cache, |
|
| 880 | + ], |
|
| 881 | + ]; |
|
| 882 | + } |
|
| 883 | + |
|
| 884 | + |
|
| 885 | + /** |
|
| 886 | + * Registers how core classes are loaded. |
|
| 887 | + * This can either be done by simply providing the name of one of the EE_Registry loader methods such as: |
|
| 888 | + * 'EE_Request_Handler' => 'load_core' |
|
| 889 | + * 'EE_Messages_Queue' => 'load_lib' |
|
| 890 | + * 'EEH_Debug_Tools' => 'load_helper' |
|
| 891 | + * or, if greater control is required, by providing a custom closure. For example: |
|
| 892 | + * 'Some_Class' => function () { |
|
| 893 | + * return new Some_Class(); |
|
| 894 | + * }, |
|
| 895 | + * This is required for instantiating dependencies |
|
| 896 | + * where an interface has been type hinted in a class constructor. For example: |
|
| 897 | + * 'Required_Interface' => function () { |
|
| 898 | + * return new A_Class_That_Implements_Required_Interface(); |
|
| 899 | + * }, |
|
| 900 | + */ |
|
| 901 | + protected function _register_core_class_loaders() |
|
| 902 | + { |
|
| 903 | + $this->_class_loaders = [ |
|
| 904 | + // load_core |
|
| 905 | + 'EE_Dependency_Map' => function () { |
|
| 906 | + return $this; |
|
| 907 | + }, |
|
| 908 | + 'EE_Capabilities' => 'load_core', |
|
| 909 | + 'EE_Encryption' => 'load_core', |
|
| 910 | + 'EE_Front_Controller' => 'load_core', |
|
| 911 | + 'EE_Module_Request_Router' => 'load_core', |
|
| 912 | + 'EE_Registry' => 'load_core', |
|
| 913 | + 'EE_Request' => function () { |
|
| 914 | + return $this->legacy_request; |
|
| 915 | + }, |
|
| 916 | + 'EventEspresso\core\services\request\Request' => function () { |
|
| 917 | + return $this->request; |
|
| 918 | + }, |
|
| 919 | + 'EventEspresso\core\services\request\Response' => function () { |
|
| 920 | + return $this->response; |
|
| 921 | + }, |
|
| 922 | + 'EE_Base' => 'load_core', |
|
| 923 | + 'EE_Request_Handler' => 'load_core', |
|
| 924 | + 'EE_Session' => 'load_core', |
|
| 925 | + 'EE_Cron_Tasks' => 'load_core', |
|
| 926 | + 'EE_System' => 'load_core', |
|
| 927 | + 'EE_Maintenance_Mode' => 'load_core', |
|
| 928 | + 'EE_Register_CPTs' => 'load_core', |
|
| 929 | + 'EE_Admin' => 'load_core', |
|
| 930 | + 'EE_CPT_Strategy' => 'load_core', |
|
| 931 | + // load_class |
|
| 932 | + 'EE_Registration_Processor' => 'load_class', |
|
| 933 | + // load_lib |
|
| 934 | + 'EE_Message_Resource_Manager' => 'load_lib', |
|
| 935 | + 'EE_Message_Type_Collection' => 'load_lib', |
|
| 936 | + 'EE_Message_Type_Collection_Loader' => 'load_lib', |
|
| 937 | + 'EE_Messenger_Collection' => 'load_lib', |
|
| 938 | + 'EE_Messenger_Collection_Loader' => 'load_lib', |
|
| 939 | + 'EE_Messages_Processor' => 'load_lib', |
|
| 940 | + 'EE_Message_Repository' => 'load_lib', |
|
| 941 | + 'EE_Messages_Queue' => 'load_lib', |
|
| 942 | + 'EE_Messages_Data_Handler_Collection' => 'load_lib', |
|
| 943 | + 'EE_Message_Template_Group_Collection' => 'load_lib', |
|
| 944 | + 'EE_Payment_Method_Manager' => 'load_lib', |
|
| 945 | + 'EE_Payment_Processor' => 'load_core', |
|
| 946 | + 'EE_DMS_Core_4_1_0' => 'load_dms', |
|
| 947 | + 'EE_DMS_Core_4_2_0' => 'load_dms', |
|
| 948 | + 'EE_DMS_Core_4_3_0' => 'load_dms', |
|
| 949 | + 'EE_DMS_Core_4_5_0' => 'load_dms', |
|
| 950 | + 'EE_DMS_Core_4_6_0' => 'load_dms', |
|
| 951 | + 'EE_DMS_Core_4_7_0' => 'load_dms', |
|
| 952 | + 'EE_DMS_Core_4_8_0' => 'load_dms', |
|
| 953 | + 'EE_DMS_Core_4_9_0' => 'load_dms', |
|
| 954 | + 'EE_DMS_Core_4_10_0' => 'load_dms', |
|
| 955 | + 'EE_DMS_Core_5_0_0' => 'load_dms', |
|
| 956 | + 'EE_Messages_Generator' => static function () { |
|
| 957 | + return EE_Registry::instance()->load_lib( |
|
| 958 | + 'Messages_Generator', |
|
| 959 | + [], |
|
| 960 | + false, |
|
| 961 | + false |
|
| 962 | + ); |
|
| 963 | + }, |
|
| 964 | + 'EE_Messages_Template_Defaults' => static function ($arguments = []) { |
|
| 965 | + return EE_Registry::instance()->load_lib( |
|
| 966 | + 'Messages_Template_Defaults', |
|
| 967 | + $arguments, |
|
| 968 | + false, |
|
| 969 | + false |
|
| 970 | + ); |
|
| 971 | + }, |
|
| 972 | + // load_helper |
|
| 973 | + 'EEH_Parse_Shortcodes' => static function () { |
|
| 974 | + if (EE_Registry::instance()->load_helper('Parse_Shortcodes')) { |
|
| 975 | + return new EEH_Parse_Shortcodes(); |
|
| 976 | + } |
|
| 977 | + return null; |
|
| 978 | + }, |
|
| 979 | + 'EE_Template_Config' => static function () { |
|
| 980 | + return EE_Config::instance()->template_settings; |
|
| 981 | + }, |
|
| 982 | + 'EE_Currency_Config' => static function () { |
|
| 983 | + return EE_Currency_Config::getCurrencyConfig(); |
|
| 984 | + }, |
|
| 985 | + 'EE_Registration_Config' => static function () { |
|
| 986 | + return EE_Config::instance()->registration; |
|
| 987 | + }, |
|
| 988 | + 'EE_Core_Config' => static function () { |
|
| 989 | + return EE_Config::instance()->core; |
|
| 990 | + }, |
|
| 991 | + 'EventEspresso\core\services\loaders\Loader' => static function () { |
|
| 992 | + return LoaderFactory::getLoader(); |
|
| 993 | + }, |
|
| 994 | + 'EE_Network_Config' => static function () { |
|
| 995 | + return EE_Network_Config::instance(); |
|
| 996 | + }, |
|
| 997 | + 'EE_Config' => static function () { |
|
| 998 | + return EE_Config::instance(); |
|
| 999 | + }, |
|
| 1000 | + 'EventEspresso\core\domain\Domain' => static function () { |
|
| 1001 | + return DomainFactory::getEventEspressoCoreDomain(); |
|
| 1002 | + }, |
|
| 1003 | + 'EE_Admin_Config' => static function () { |
|
| 1004 | + return EE_Config::instance()->admin; |
|
| 1005 | + }, |
|
| 1006 | + 'EE_Organization_Config' => static function () { |
|
| 1007 | + return EE_Config::instance()->organization; |
|
| 1008 | + }, |
|
| 1009 | + 'EE_Network_Core_Config' => static function () { |
|
| 1010 | + return EE_Network_Config::instance()->core; |
|
| 1011 | + }, |
|
| 1012 | + 'EE_Environment_Config' => static function () { |
|
| 1013 | + return EE_Config::instance()->environment; |
|
| 1014 | + }, |
|
| 1015 | + 'EED_Core_Rest_Api' => static function () { |
|
| 1016 | + return EED_Core_Rest_Api::instance(); |
|
| 1017 | + }, |
|
| 1018 | + 'WP_REST_Server' => static function () { |
|
| 1019 | + return rest_get_server(); |
|
| 1020 | + }, |
|
| 1021 | + 'EventEspresso\core\Psr4Autoloader' => static function () { |
|
| 1022 | + return EE_Psr4AutoloaderInit::psr4_loader(); |
|
| 1023 | + }, |
|
| 1024 | + 'EE_Ticket_Selector_Config' => function () { |
|
| 1025 | + return EE_Config::instance()->template_settings->EED_Ticket_Selector; |
|
| 1026 | + }, |
|
| 1027 | + ]; |
|
| 1028 | + } |
|
| 1029 | + |
|
| 1030 | + |
|
| 1031 | + /** |
|
| 1032 | + * can be used for supplying alternate names for classes, |
|
| 1033 | + * or for connecting interface names to instantiable classes |
|
| 1034 | + * |
|
| 1035 | + * @throws InvalidAliasException |
|
| 1036 | + */ |
|
| 1037 | + protected function _register_core_aliases() |
|
| 1038 | + { |
|
| 1039 | + $aliases = [ |
|
| 1040 | + 'CommandBusInterface' => 'EventEspresso\core\services\commands\CommandBusInterface', |
|
| 1041 | + 'EventEspresso\core\services\commands\CommandBusInterface' => 'EventEspresso\core\services\commands\CommandBus', |
|
| 1042 | + 'CommandHandlerManagerInterface' => 'EventEspresso\core\services\commands\CommandHandlerManagerInterface', |
|
| 1043 | + 'EventEspresso\core\services\commands\CommandHandlerManagerInterface' => 'EventEspresso\core\services\commands\CommandHandlerManager', |
|
| 1044 | + 'CapChecker' => 'EventEspresso\core\services\commands\middleware\CapChecker', |
|
| 1045 | + 'AddActionHook' => 'EventEspresso\core\services\commands\middleware\AddActionHook', |
|
| 1046 | + 'CapabilitiesChecker' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker', |
|
| 1047 | + 'CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface', |
|
| 1048 | + 'EventEspresso\core\domain\services\capabilities\CapabilitiesCheckerInterface' => 'EventEspresso\core\domain\services\capabilities\CapabilitiesChecker', |
|
| 1049 | + 'CreateRegistrationService' => 'EventEspresso\core\domain\services\registration\CreateRegistrationService', |
|
| 1050 | + 'CreateRegistrationCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CreateRegistrationCommand', |
|
| 1051 | + 'CopyRegistrationDetailsCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationDetailsCommand', |
|
| 1052 | + 'CopyRegistrationPaymentsCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CopyRegistrationPaymentsCommand', |
|
| 1053 | + 'CancelRegistrationAndTicketLineItemCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\CancelRegistrationAndTicketLineItemCommandHandler', |
|
| 1054 | + 'UpdateRegistrationAndTransactionAfterChangeCommandHandler' => 'EventEspresso\core\domain\services\commands\registration\UpdateRegistrationAndTransactionAfterChangeCommandHandler', |
|
| 1055 | + 'CreateTicketLineItemCommandHandler' => 'EventEspresso\core\domain\services\commands\ticket\CreateTicketLineItemCommand', |
|
| 1056 | + 'CreateTransactionCommandHandler' => 'EventEspresso\core\domain\services\commands\transaction\CreateTransactionCommandHandler', |
|
| 1057 | + 'CreateAttendeeCommandHandler' => 'EventEspresso\core\domain\services\commands\attendee\CreateAttendeeCommandHandler', |
|
| 1058 | + 'TableManager' => 'EventEspresso\core\services\database\TableManager', |
|
| 1059 | + 'TableAnalysis' => 'EventEspresso\core\services\database\TableAnalysis', |
|
| 1060 | + 'EspressoShortcode' => 'EventEspresso\core\services\shortcodes\EspressoShortcode', |
|
| 1061 | + 'ShortcodeInterface' => 'EventEspresso\core\services\shortcodes\ShortcodeInterface', |
|
| 1062 | + 'EventEspresso\core\services\shortcodes\ShortcodeInterface' => 'EventEspresso\core\services\shortcodes\EspressoShortcode', |
|
| 1063 | + 'EventEspresso\core\services\cache\CacheStorageInterface' => 'EventEspresso\core\services\cache\TransientCacheStorage', |
|
| 1064 | + 'LoaderInterface' => 'EventEspresso\core\services\loaders\LoaderInterface', |
|
| 1065 | + 'EventEspresso\core\services\loaders\LoaderInterface' => 'EventEspresso\core\services\loaders\Loader', |
|
| 1066 | + 'CommandFactoryInterface' => 'EventEspresso\core\services\commands\CommandFactoryInterface', |
|
| 1067 | + 'EventEspresso\core\services\commands\CommandFactoryInterface' => 'EventEspresso\core\services\commands\CommandFactory', |
|
| 1068 | + 'EmailValidatorInterface' => 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface', |
|
| 1069 | + 'EventEspresso\core\domain\services\validation\email\EmailValidatorInterface' => 'EventEspresso\core\domain\services\validation\email\EmailValidationService', |
|
| 1070 | + 'NoticeConverterInterface' => 'EventEspresso\core\services\notices\NoticeConverterInterface', |
|
| 1071 | + 'EventEspresso\core\services\notices\NoticeConverterInterface' => 'EventEspresso\core\services\notices\ConvertNoticesToEeErrors', |
|
| 1072 | + 'NoticesContainerInterface' => 'EventEspresso\core\services\notices\NoticesContainerInterface', |
|
| 1073 | + 'EventEspresso\core\services\notices\NoticesContainerInterface' => 'EventEspresso\core\services\notices\NoticesContainer', |
|
| 1074 | + 'EventEspresso\core\services\request\RequestInterface' => 'EventEspresso\core\services\request\Request', |
|
| 1075 | + 'EventEspresso\core\services\request\ResponseInterface' => 'EventEspresso\core\services\request\Response', |
|
| 1076 | + 'EventEspresso\core\domain\DomainInterface' => 'EventEspresso\core\domain\Domain', |
|
| 1077 | + 'Registration_Processor' => 'EE_Registration_Processor', |
|
| 1078 | + 'EventEspresso\core\services\assets\AssetManifestInterface' => 'EventEspresso\core\services\assets\AssetManifest', |
|
| 1079 | + ]; |
|
| 1080 | + foreach ($aliases as $alias => $fqn) { |
|
| 1081 | + if (is_array($fqn)) { |
|
| 1082 | + foreach ($fqn as $class => $for_class) { |
|
| 1083 | + $this->class_cache->addAlias($class, $alias, $for_class); |
|
| 1084 | + } |
|
| 1085 | + continue; |
|
| 1086 | + } |
|
| 1087 | + $this->class_cache->addAlias($fqn, $alias); |
|
| 1088 | + } |
|
| 1089 | + if (! (defined('DOING_AJAX') && DOING_AJAX) && is_admin()) { |
|
| 1090 | + $this->class_cache->addAlias( |
|
| 1091 | + 'EventEspresso\core\services\notices\ConvertNoticesToAdminNotices', |
|
| 1092 | + 'EventEspresso\core\services\notices\NoticeConverterInterface' |
|
| 1093 | + ); |
|
| 1094 | + } |
|
| 1095 | + } |
|
| 1096 | + |
|
| 1097 | + |
|
| 1098 | + public function debug($for_class = '') |
|
| 1099 | + { |
|
| 1100 | + if (method_exists($this->class_cache, 'debug')) { |
|
| 1101 | + $this->class_cache->debug($for_class); |
|
| 1102 | + } |
|
| 1103 | + } |
|
| 1104 | + |
|
| 1105 | + |
|
| 1106 | + /** |
|
| 1107 | + * This is used to reset the internal map and class_loaders to their original default state at the beginning of the |
|
| 1108 | + * request Primarily used by unit tests. |
|
| 1109 | + */ |
|
| 1110 | + public function reset() |
|
| 1111 | + { |
|
| 1112 | + $this->_register_core_class_loaders(); |
|
| 1113 | + $this->_register_core_dependencies(); |
|
| 1114 | + } |
|
| 1115 | + |
|
| 1116 | + |
|
| 1117 | + /** |
|
| 1118 | + * PLZ NOTE: a better name for this method would be is_alias() |
|
| 1119 | + * because it returns TRUE if the provided fully qualified name IS an alias |
|
| 1120 | + * WHY? |
|
| 1121 | + * Because if a class is type hinting for a concretion, |
|
| 1122 | + * then why would we need to find another class to supply it? |
|
| 1123 | + * ie: if a class asks for `Fully/Qualified/Namespace/SpecificClassName`, |
|
| 1124 | + * then give it an instance of `Fully/Qualified/Namespace/SpecificClassName`. |
|
| 1125 | + * Don't go looking for some substitute. |
|
| 1126 | + * Whereas if a class is type hinting for an interface... |
|
| 1127 | + * then we need to find an actual class to use. |
|
| 1128 | + * So the interface IS the alias for some other FQN, |
|
| 1129 | + * and we need to find out if `Fully/Qualified/Namespace/SomeInterface` |
|
| 1130 | + * represents some other class. |
|
| 1131 | + * |
|
| 1132 | + * @param string $fqn |
|
| 1133 | + * @param string $for_class |
|
| 1134 | + * @return bool |
|
| 1135 | + * @deprecated 4.9.62.p |
|
| 1136 | + */ |
|
| 1137 | + public function has_alias(string $fqn = '', string $for_class = ''): bool |
|
| 1138 | + { |
|
| 1139 | + return $this->isAlias($fqn, $for_class); |
|
| 1140 | + } |
|
| 1141 | + |
|
| 1142 | + |
|
| 1143 | + /** |
|
| 1144 | + * PLZ NOTE: a better name for this method would be get_fqn_for_alias() |
|
| 1145 | + * because it returns a FQN for provided alias if one exists, otherwise returns the original $alias |
|
| 1146 | + * functions recursively, so that multiple aliases can be used to drill down to a FQN |
|
| 1147 | + * for example: |
|
| 1148 | + * if the following two entries were added to the _aliases array: |
|
| 1149 | + * array( |
|
| 1150 | + * 'interface_alias' => 'some\namespace\interface' |
|
| 1151 | + * 'some\namespace\interface' => 'some\namespace\classname' |
|
| 1152 | + * ) |
|
| 1153 | + * then one could use EE_Registry::instance()->create( 'interface_alias' ) |
|
| 1154 | + * to load an instance of 'some\namespace\classname' |
|
| 1155 | + * |
|
| 1156 | + * @param string $alias |
|
| 1157 | + * @param string $for_class |
|
| 1158 | + * @return string |
|
| 1159 | + * @deprecated 4.9.62.p |
|
| 1160 | + */ |
|
| 1161 | + public function get_alias(string $alias = '', string $for_class = ''): string |
|
| 1162 | + { |
|
| 1163 | + return $this->getFqnForAlias($alias, $for_class); |
|
| 1164 | + } |
|
| 1165 | 1165 | } |
@@ -9,18 +9,18 @@ |
||
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | 11 | if (! empty($post_body_content)) : |
| 12 | - if ($add_page_frame && ! $is_ajax) { |
|
| 13 | - if ( |
|
| 14 | - strpos($post_body_content, 'class="padding"') === false |
|
| 15 | - || strpos($post_body_content, 'class="padding"') < 120 |
|
| 16 | - ) { |
|
| 17 | - $post_body_content = '<div class="padding">' . $post_body_content . '</div>'; |
|
| 18 | - } |
|
| 19 | - if (strpos($post_body_content, '<div class="ee-admin-container">') === false) { |
|
| 20 | - $post_body_content = '<div class="ee-admin-container">' . $post_body_content . '</div>'; |
|
| 21 | - } |
|
| 22 | - } |
|
| 23 | - ?> |
|
| 12 | + if ($add_page_frame && ! $is_ajax) { |
|
| 13 | + if ( |
|
| 14 | + strpos($post_body_content, 'class="padding"') === false |
|
| 15 | + || strpos($post_body_content, 'class="padding"') < 120 |
|
| 16 | + ) { |
|
| 17 | + $post_body_content = '<div class="padding">' . $post_body_content . '</div>'; |
|
| 18 | + } |
|
| 19 | + if (strpos($post_body_content, '<div class="ee-admin-container">') === false) { |
|
| 20 | + $post_body_content = '<div class="ee-admin-container">' . $post_body_content . '</div>'; |
|
| 21 | + } |
|
| 22 | + } |
|
| 23 | + ?> |
|
| 24 | 24 | <div id="post-body-content"> |
| 25 | 25 | <?php echo wp_kses($post_body_content, AllowedTags::getWithFullTags()); ?> |
| 26 | 26 | </div> |
@@ -8,16 +8,16 @@ |
||
| 8 | 8 | * @var string $post_body_content |
| 9 | 9 | */ |
| 10 | 10 | |
| 11 | -if (! empty($post_body_content)) : |
|
| 11 | +if ( ! empty($post_body_content)) : |
|
| 12 | 12 | if ($add_page_frame && ! $is_ajax) { |
| 13 | 13 | if ( |
| 14 | 14 | strpos($post_body_content, 'class="padding"') === false |
| 15 | 15 | || strpos($post_body_content, 'class="padding"') < 120 |
| 16 | 16 | ) { |
| 17 | - $post_body_content = '<div class="padding">' . $post_body_content . '</div>'; |
|
| 17 | + $post_body_content = '<div class="padding">'.$post_body_content.'</div>'; |
|
| 18 | 18 | } |
| 19 | 19 | if (strpos($post_body_content, '<div class="ee-admin-container">') === false) { |
| 20 | - $post_body_content = '<div class="ee-admin-container">' . $post_body_content . '</div>'; |
|
| 20 | + $post_body_content = '<div class="ee-admin-container">'.$post_body_content.'</div>'; |
|
| 21 | 21 | } |
| 22 | 22 | } |
| 23 | 23 | ?> |
@@ -11,11 +11,11 @@ |
||
| 11 | 11 | */ |
| 12 | 12 | ?> |
| 13 | 13 | |
| 14 | -<div id="<?php echo esc_attr($admin_page_wrapper_div_id);?>" class="<?php echo esc_attr($admin_page_wrapper_div_class);?>" |
|
| 14 | +<div id="<?php echo esc_attr($admin_page_wrapper_div_id); ?>" class="<?php echo esc_attr($admin_page_wrapper_div_class); ?>" |
|
| 15 | 15 | > |
| 16 | 16 | <div id="post-body" class="metabox-holder columns-1"> |
| 17 | 17 | |
| 18 | - <?php if (! empty($admin_page_header)) : ?> |
|
| 18 | + <?php if ( ! empty($admin_page_header)) : ?> |
|
| 19 | 19 | <div id="admin-page-header"> |
| 20 | 20 | <?php echo wp_kses($admin_page_header, AllowedTags::getWithFormTags()); ?> |
| 21 | 21 | </div> |
@@ -15,12 +15,12 @@ |
||
| 15 | 15 | do_action('add_meta_boxes', (string) $post_type, $post); |
| 16 | 16 | ?> |
| 17 | 17 | |
| 18 | -<?php if (! empty($admin_page_header)) : ?> |
|
| 18 | +<?php if ( ! empty($admin_page_header)) : ?> |
|
| 19 | 19 | <div id="admin-page-header"> |
| 20 | 20 | <?php echo wp_kses($admin_page_header, AllowedTags::getWithFormTags()); ?> |
| 21 | 21 | </div> |
| 22 | 22 | <?php endif; ?> |
| 23 | -<div id="<?php echo esc_attr($admin_page_wrapper_div_id);?>" class="<?php echo esc_attr($admin_page_wrapper_div_class);?>"> |
|
| 23 | +<div id="<?php echo esc_attr($admin_page_wrapper_div_id); ?>" class="<?php echo esc_attr($admin_page_wrapper_div_class); ?>"> |
|
| 24 | 24 | <!-- admin-page-header --> |
| 25 | 25 | <div id="post-body" class="metabox-holder columns-2"> |
| 26 | 26 | |
@@ -15,753 +15,753 @@ |
||
| 15 | 15 | abstract class EE_Admin_Hooks extends EE_Base |
| 16 | 16 | { |
| 17 | 17 | |
| 18 | - /** |
|
| 19 | - * This just holds an instance of the page object for this hook |
|
| 20 | - * |
|
| 21 | - * @var EE_Admin_Page|EE_Admin_Page_CPT|null |
|
| 22 | - * @deprecated 5.0.8.p |
|
| 23 | - */ |
|
| 24 | - protected $_page_object = null; |
|
| 25 | - |
|
| 26 | - /** |
|
| 27 | - * This holds the EE_Admin_Page object from the calling admin page that this object hooks into. |
|
| 28 | - * |
|
| 29 | - * @var EE_Admin_Page|EE_Admin_Page_CPT|null |
|
| 30 | - */ |
|
| 31 | - protected $_adminpage_obj = null; |
|
| 32 | - |
|
| 33 | - protected ?EE_Registry $EE = null; |
|
| 34 | - |
|
| 35 | - protected ?RequestInterface $request = null; |
|
| 36 | - |
|
| 37 | - /** |
|
| 38 | - * This is set by child classes and is an associative array of ajax hooks in the format: |
|
| 39 | - * array( |
|
| 40 | - * 'ajax_action_ref' => 'executing_method'; //must be public |
|
| 41 | - * ) |
|
| 42 | - */ |
|
| 43 | - protected array $_ajax_func = []; |
|
| 44 | - |
|
| 45 | - /** |
|
| 46 | - * This is an array of methods that get executed on a page routes admin_init hook. Use the following format: |
|
| 47 | - * array( |
|
| 48 | - * 'page_route' => 'executing_method' //must be public |
|
| 49 | - * ) |
|
| 50 | - */ |
|
| 51 | - protected array $_init_func = []; |
|
| 52 | - |
|
| 53 | - /** |
|
| 54 | - * This is an array of methods that output metabox content for the given page route. Use the following format: |
|
| 55 | - * [ |
|
| 56 | - * 0 => [ |
|
| 57 | - * 'page_route' => 'string_for_page_route', must correspond to a page route in the class being connected |
|
| 58 | - * with (i.e. "edit_event") If this is in an array then the |
|
| 59 | - * same params below will be used but the metabox will be |
|
| 60 | - * added to each route. |
|
| 61 | - * 'func' => 'executing_method', must be public (i.e. public function executing_method |
|
| 62 | - * ($post, $callback_args){} ). |
|
| 63 | - * Note if you include callback args in the array then you |
|
| 64 | - * need to declare them in the method arguments. |
|
| 65 | - * 'id' => 'identifier_for_metabox', so it can be removed by addons |
|
| 66 | - * (optional, class will set it automatically) |
|
| 67 | - * 'priority' => 'default', default 'default' (optional) |
|
| 68 | - * 'label' => esc_html__('Localized Title', 'event_espresso'), |
|
| 69 | - * 'context' => 'advanced' advanced is default (optional), |
|
| 70 | - * ] |
|
| 71 | - * 'callback_args' => array() //any callback args to include (optional) |
|
| 72 | - * ] |
|
| 73 | - * Why are we indexing numerically? Because it's possible there may be more than one metabox per page_route. |
|
| 74 | - */ |
|
| 75 | - protected array $_metaboxes = []; |
|
| 76 | - |
|
| 77 | - /** |
|
| 78 | - * This is an array of values that indicate any metaboxes we want removed from a given page route. Usually this is |
|
| 79 | - * used when caffeinated functionality is replacing decaffeinated functionality. Use the following format for the |
|
| 80 | - * array: array( |
|
| 81 | - * 0 => array( |
|
| 82 | - * 'page_route' => 'string_for_page_route' //can be string or array of strings that match a page_route(s) |
|
| 83 | - * that are in the class being connected with (i.e. 'edit', or 'create_new'). |
|
| 84 | - * 'id' => 'identifier_for_metabox', //what the id is of the metabox being removed |
|
| 85 | - * 'context' => 'normal', //the context for the metabox being removed (has to match) |
|
| 86 | - * 'screen' => 'screen_id', //(optional), if not included then this class will attempt to remove the metabox |
|
| 87 | - * using the currently loaded screen object->id however, there may be cases where you have to specify the |
|
| 88 | - * id for the screen the metabox is on. |
|
| 89 | - * ) |
|
| 90 | - * ) |
|
| 91 | - */ |
|
| 92 | - protected array $_remove_metaboxes = []; |
|
| 93 | - |
|
| 94 | - protected array $_req_data = []; |
|
| 95 | - |
|
| 96 | - /** |
|
| 97 | - * This parent class takes care of loading the scripts and styles if the child class has set the properties for |
|
| 98 | - * them in the following format. Note, the first array index ('register') is for defining all the registers. The |
|
| 99 | - * second array index is for indicating what routes each script/style loads on. array( |
|
| 100 | - * 'registers' => array( |
|
| 101 | - * 'script_ref' => array( // if more than one script is to be loaded its best to use the 'dependency' |
|
| 102 | - * argument to link scripts together. |
|
| 103 | - * 'type' => 'js' // 'js' or 'css' (defaults to js). This tells us what type of wp_function to use |
|
| 104 | - * 'url' => 'http://urltoscript.css.js', |
|
| 105 | - * 'depends' => array('jquery'), //an array of dependencies for the scripts. REMEMBER, if a script has |
|
| 106 | - * already been registered elsewhere in the system. You can just use the depends array to make sure it |
|
| 107 | - * gets loaded before the one you are setting here. |
|
| 108 | - * 'footer' => TRUE //defaults to true (styles don't use this parameter) |
|
| 109 | - * ), |
|
| 110 | - * 'enqueues' => array( //this time each key corresponds to the script ref followed by an array of page routes |
|
| 111 | - * the script gets enqueued on. |
|
| 112 | - * 'script_ref' => array('route_one', 'route_two') |
|
| 113 | - * ), |
|
| 114 | - * 'localize' => array( //this allows you to set a localized object. Indicate which script the object is being |
|
| 115 | - * attached to and then include an array indexed by the name of the object and the array of key/value pairs for |
|
| 116 | - * the object. |
|
| 117 | - * 'scrip_ref' => array( |
|
| 118 | - * 'NAME_OF_JS_OBJECT' => array( |
|
| 119 | - * 'translate_ref' => esc_html__('localized_string', 'event_espresso'), |
|
| 120 | - * 'some_data' => 5 |
|
| 121 | - * ) |
|
| 122 | - * ) |
|
| 123 | - * ) |
|
| 124 | - * ) |
|
| 125 | - */ |
|
| 126 | - protected array $_scripts_styles = []; |
|
| 127 | - |
|
| 128 | - protected array $_scripts = []; |
|
| 129 | - |
|
| 130 | - protected array $_styles = []; |
|
| 131 | - |
|
| 132 | - /** |
|
| 133 | - * this optional property can be set by child classes to override the priority for the automatic action/filter hook |
|
| 134 | - * loading in the `_load_routed_hooks()` method. Please follow this format: array( |
|
| 135 | - * 'wp_hook_reference' => 1 |
|
| 136 | - * ) |
|
| 137 | - * ) |
|
| 138 | - */ |
|
| 139 | - protected array $_wp_action_filters_priority = []; |
|
| 140 | - |
|
| 141 | - /** |
|
| 142 | - * this is just a flag set automatically to indicate whether we've got an extended hook class running (i.e. |
|
| 143 | - * espresso_events_Registration_Form_Hooks_Extend extends espresso_events_Registration_Form_Hooks). This flag is |
|
| 144 | - * used later to make sure we require the needed files. |
|
| 145 | - */ |
|
| 146 | - protected bool $_extend = false; |
|
| 147 | - |
|
| 148 | - /** |
|
| 149 | - * we're just going to use this to hold the name of the caller class (child class name) |
|
| 150 | - */ |
|
| 151 | - public string $caller = ''; |
|
| 152 | - |
|
| 153 | - protected string $_current_route = ''; |
|
| 154 | - |
|
| 155 | - |
|
| 156 | - /** |
|
| 157 | - * child classes MUST set this property so that the page object can be loaded correctly |
|
| 158 | - */ |
|
| 159 | - protected string $_name = ''; |
|
| 160 | - |
|
| 161 | - |
|
| 162 | - /** |
|
| 163 | - * constructor |
|
| 164 | - * |
|
| 165 | - * @param EE_Admin_Page $admin_page |
|
| 166 | - * @throws EE_Error |
|
| 167 | - * @throws ReflectionException |
|
| 168 | - */ |
|
| 169 | - public function __construct(EE_Admin_Page $admin_page) |
|
| 170 | - { |
|
| 171 | - $this->_adminpage_obj = $admin_page; |
|
| 172 | - $this->request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
| 173 | - $this->_req_data = $this->request->requestParams(); |
|
| 174 | - $current_page = $this->request->getRequestParam('page'); |
|
| 175 | - $current_page = $this->request->getRequestParam('current_page', $current_page); |
|
| 176 | - // first let's verify we're on the right page |
|
| 177 | - if ($current_page !== $this->_adminpage_obj->page_slug) { |
|
| 178 | - return; |
|
| 179 | - } |
|
| 180 | - $this->_set_defaults(); |
|
| 181 | - $this->_set_hooks_properties(); |
|
| 182 | - // get out nothing more to be done here. |
|
| 183 | - // allow for extends to modify properties |
|
| 184 | - if (method_exists($this, '_extend_properties')) { |
|
| 185 | - $this->_extend_properties(); |
|
| 186 | - } |
|
| 187 | - // $this->_set_page_object(); |
|
| 188 | - $this->_init_hooks(); |
|
| 189 | - $this->_load_custom_methods(); |
|
| 190 | - $this->_load_routed_hooks(); |
|
| 191 | - add_action('admin_enqueue_scripts', [$this, 'enqueue_scripts_styles']); |
|
| 192 | - add_action('admin_enqueue_scripts', [$this, 'add_metaboxes'], 20); |
|
| 193 | - add_action('admin_enqueue_scripts', [$this, 'remove_metaboxes'], 15); |
|
| 194 | - $this->_ajax_hooks(); |
|
| 195 | - } |
|
| 196 | - |
|
| 197 | - |
|
| 198 | - /** |
|
| 199 | - * used by child classes to set the following properties: |
|
| 200 | - * $_ajax_func (optional) |
|
| 201 | - * $_init_func (optional) |
|
| 202 | - * $_metaboxes (optional) |
|
| 203 | - * $_scripts (optional) |
|
| 204 | - * $_styles (optional) |
|
| 205 | - * $_name (required) |
|
| 206 | - * Also in this method will be registered any scripts or styles loaded on the targeted page (as indicated in the |
|
| 207 | - * _scripts/_styles properties) Also children should place in this method any filters/actions that have to happen |
|
| 208 | - * really early on page load (just after admin_init) if they want to have them registered for handling early. |
|
| 209 | - * |
|
| 210 | - * @abstract |
|
| 211 | - * @return void |
|
| 212 | - */ |
|
| 213 | - abstract protected function _set_hooks_properties(); |
|
| 214 | - |
|
| 215 | - |
|
| 216 | - /** |
|
| 217 | - * The hooks for enqueue_scripts and enqueue_styles will be run in here. Child classes need to define their |
|
| 218 | - * scripts and styles in the relevant $_scripts and $_styles properties. Child classes must have also already |
|
| 219 | - * registered the scripts and styles using wp_register_script and wp_register_style functions. |
|
| 220 | - * |
|
| 221 | - * @return void |
|
| 222 | - * @throws EE_Error |
|
| 223 | - */ |
|
| 224 | - public function enqueue_scripts_styles() |
|
| 225 | - { |
|
| 226 | - if (! empty($this->_scripts_styles)) { |
|
| 227 | - // first let's do all the registrations |
|
| 228 | - if (! isset($this->_scripts_styles['registers'])) { |
|
| 229 | - $msg[] = esc_html__( |
|
| 230 | - 'There is no "registers" index in the <code>$this->_scripts_styles</code> property.', |
|
| 231 | - 'event_espresso' |
|
| 232 | - ); |
|
| 233 | - $msg[] = sprintf( |
|
| 234 | - esc_html__( |
|
| 235 | - 'Make sure you read the phpdoc comments above the definition of the $_scripts_styles property in the <code>EE_Admin_Hooks</code> class and modify according in the %s child', |
|
| 236 | - 'event_espresso' |
|
| 237 | - ), |
|
| 238 | - '<strong>' . $this->caller . '</strong>' |
|
| 239 | - ); |
|
| 240 | - throw new EE_Error(implode('||', $msg)); |
|
| 241 | - } |
|
| 242 | - $defaults = [ |
|
| 243 | - 'type' => 'js', |
|
| 244 | - 'url' => '', |
|
| 245 | - 'depends' => [], |
|
| 246 | - 'version' => EVENT_ESPRESSO_VERSION, |
|
| 247 | - 'footer' => true, |
|
| 248 | - ]; |
|
| 249 | - foreach ($this->_scripts_styles['registers'] as $ref => $details) { |
|
| 250 | - $details = wp_parse_args($details, $defaults); |
|
| 251 | - $type = $details['type']; |
|
| 252 | - $url = $details['url']; |
|
| 253 | - $depends = $details['depends']; |
|
| 254 | - $version = $details['version']; |
|
| 255 | - $footer = $details['footer']; |
|
| 256 | - // let's make sure that we set the 'registers' type if it's not set! |
|
| 257 | - // We need it later to determine which enqueue we do |
|
| 258 | - $this->_scripts_styles['registers'][ $ref ]['type'] = $type; |
|
| 259 | - // let's make sure we're not missing any REQUIRED parameters |
|
| 260 | - if (empty($url)) { |
|
| 261 | - $msg[] = sprintf( |
|
| 262 | - esc_html__('Missing the url for the requested %s', 'event_espresso'), |
|
| 263 | - $type == 'js' ? 'script' : 'stylesheet' |
|
| 264 | - ); |
|
| 265 | - $msg[] = sprintf( |
|
| 266 | - esc_html__( |
|
| 267 | - 'Double-check your <code>$this->_scripts_styles</code> array in %s and make sure that there is a "url" set for the %s ref', |
|
| 268 | - 'event_espresso' |
|
| 269 | - ), |
|
| 270 | - '<strong>' . $this->caller . '</strong>', |
|
| 271 | - $ref |
|
| 272 | - ); |
|
| 273 | - throw new EE_Error(implode('||', $msg)); |
|
| 274 | - } |
|
| 275 | - // made it here so let's do the appropriate registration |
|
| 276 | - $type == 'js' |
|
| 277 | - ? wp_register_script($ref, $url, $depends, $version, $footer) |
|
| 278 | - : wp_register_style( |
|
| 279 | - $ref, |
|
| 280 | - $url, |
|
| 281 | - $depends, |
|
| 282 | - $version |
|
| 283 | - ); |
|
| 284 | - } |
|
| 285 | - // k now let's do the enqueues |
|
| 286 | - if (! isset($this->_scripts_styles['enqueues'])) { |
|
| 287 | - return; |
|
| 288 | - } //not sure if we should throw an error here or not. |
|
| 289 | - |
|
| 290 | - foreach ($this->_scripts_styles['enqueues'] as $ref => $routes) { |
|
| 291 | - // make sure $routes is an array |
|
| 292 | - $routes = (array) $routes; |
|
| 293 | - if (in_array($this->_current_route, $routes)) { |
|
| 294 | - $this->_scripts_styles['registers'][ $ref ]['type'] == 'js' ? wp_enqueue_script($ref) |
|
| 295 | - : wp_enqueue_style($ref); |
|
| 296 | - // if we have a localization for the script let's do that too. |
|
| 297 | - if (isset($this->_scripts_styles['localize'][ $ref ])) { |
|
| 298 | - foreach ($this->_scripts_styles['localize'][ $ref ] as $object_name => $indexes) { |
|
| 299 | - wp_localize_script( |
|
| 300 | - $ref, |
|
| 301 | - $object_name, |
|
| 302 | - $this->_scripts_styles['localize'][ $ref ][ $object_name ] |
|
| 303 | - ); |
|
| 304 | - } |
|
| 305 | - } |
|
| 306 | - } |
|
| 307 | - } |
|
| 308 | - // let's do the deregisters |
|
| 309 | - if (! isset($this->_scripts_styles['deregisters'])) { |
|
| 310 | - return; |
|
| 311 | - } |
|
| 312 | - foreach ($this->_scripts_styles['deregisters'] as $ref => $details) { |
|
| 313 | - $defaults = ['type' => 'js']; |
|
| 314 | - $details = wp_parse_args($details, $defaults); |
|
| 315 | - $details['type'] === 'js' ? wp_deregister_script($ref) : wp_deregister_style($ref); |
|
| 316 | - } |
|
| 317 | - } |
|
| 318 | - } |
|
| 319 | - |
|
| 320 | - |
|
| 321 | - /** |
|
| 322 | - * just set the defaults for the hooks properties. |
|
| 323 | - * |
|
| 324 | - * @return void |
|
| 325 | - */ |
|
| 326 | - private function _set_defaults() |
|
| 327 | - { |
|
| 328 | - $this->_ajax_func = []; |
|
| 329 | - $this->_init_func = []; |
|
| 330 | - $this->_metaboxes = []; |
|
| 331 | - $this->_scripts = []; |
|
| 332 | - $this->_styles = []; |
|
| 333 | - $this->_wp_action_filters_priority = []; |
|
| 334 | - $this->_current_route = $this->getCurrentRoute(); |
|
| 335 | - $this->caller = get_class($this); |
|
| 336 | - $this->_extend = (bool) stripos($this->caller, 'Extend'); |
|
| 337 | - } |
|
| 338 | - |
|
| 339 | - |
|
| 340 | - /** |
|
| 341 | - * A helper for determining the current route. |
|
| 342 | - * |
|
| 343 | - * @return string |
|
| 344 | - */ |
|
| 345 | - private function getCurrentRoute(): string |
|
| 346 | - { |
|
| 347 | - $action = $this->request->getRequestParam('action'); |
|
| 348 | - // list tables do something else with 'action' for bulk actions. |
|
| 349 | - $action = $action !== '-1' && $action !== '' ? $action : 'default'; |
|
| 350 | - $route = $this->request->getRequestParam('route'); |
|
| 351 | - // we set a 'route' variable in some cases where action is being used by something else. |
|
| 352 | - return $action === 'default' && $route !== '' ? $route : $action; |
|
| 353 | - } |
|
| 354 | - |
|
| 355 | - |
|
| 356 | - /** |
|
| 357 | - * this sets the _page_object property |
|
| 358 | - * |
|
| 359 | - * @return void |
|
| 360 | - * @throws EE_Error |
|
| 361 | - * @throws ReflectionException |
|
| 362 | - * @throws Throwable |
|
| 363 | - * @deprecated 5.0.8.p |
|
| 364 | - */ |
|
| 365 | - protected function _set_page_object() |
|
| 366 | - { |
|
| 367 | - if ($this->_page_object instanceof EE_Admin_Page) { |
|
| 368 | - return; |
|
| 369 | - } |
|
| 370 | - // first make sure $this->_name is set |
|
| 371 | - if (empty($this->_name)) { |
|
| 372 | - $msg[] = esc_html__('We can\'t load the page object', 'event_espresso'); |
|
| 373 | - $msg[] = sprintf( |
|
| 374 | - esc_html__("This is because the %s child class has not set the '_name' property", 'event_espresso'), |
|
| 375 | - $this->caller |
|
| 376 | - ); |
|
| 377 | - throw new EE_Error(implode('||', $msg)); |
|
| 378 | - } |
|
| 379 | - // change "the_message" to "the message" |
|
| 380 | - $class_name = str_replace('_', ' ', $this->_name); |
|
| 381 | - // change "the message" to "The_Message_Admin_Page" |
|
| 382 | - $class_name = str_replace(' ', '_', ucwords($class_name)) . '_Admin_Page'; |
|
| 383 | - // first default file (if exists) |
|
| 384 | - $decaf_file = EE_ADMIN_PAGES . "$this->_name/$class_name.core.php"; |
|
| 385 | - if (is_readable($decaf_file)) { |
|
| 386 | - require_once($decaf_file); |
|
| 387 | - } |
|
| 388 | - // now we have to do require for extended file (if needed) |
|
| 389 | - if ($this->_extend) { |
|
| 390 | - require_once EE_CORE_CAF_ADMIN_EXTEND . "$this->_name/Extend_$class_name.core.php"; |
|
| 391 | - // and extend the class name as well |
|
| 392 | - $class_name = 'Extend_' . $class_name; |
|
| 393 | - } |
|
| 394 | - // let's make sure the class exists |
|
| 395 | - if (! class_exists($class_name)) { |
|
| 396 | - $msg[] = esc_html__('We can\'t load the page object', 'event_espresso'); |
|
| 397 | - $msg[] = sprintf( |
|
| 398 | - esc_html__( |
|
| 399 | - 'The class name that was given is %s. Check the spelling and make sure its correct, also there needs to be an autoloader setup for the class', |
|
| 400 | - 'event_espresso' |
|
| 401 | - ), |
|
| 402 | - $class_name |
|
| 403 | - ); |
|
| 404 | - throw new EE_Error(implode('||', $msg)); |
|
| 405 | - } |
|
| 406 | - // do NOT load admin pages that are ALREADY LOADED!!! |
|
| 407 | - if ($class_name !== $this->_adminpage_obj->class_name) { |
|
| 408 | - return; |
|
| 409 | - } |
|
| 410 | - $this->_page_object = LoaderFactory::getLoader()->getShared($class_name, [false]); |
|
| 411 | - $this->_page_object->initializePage(); |
|
| 412 | - } |
|
| 413 | - |
|
| 414 | - |
|
| 415 | - /** |
|
| 416 | - * Child "hook" classes can declare any methods that they want executed when a specific page route is loaded. The |
|
| 417 | - * advantage of this is when doing things like running our own db interactions on saves etc. Remember that |
|
| 418 | - * $this->_req_data (all the _POST and _GET data) is available to your methods. |
|
| 419 | - * |
|
| 420 | - * @return void |
|
| 421 | - */ |
|
| 422 | - private function _load_custom_methods() |
|
| 423 | - { |
|
| 424 | - /** |
|
| 425 | - * method cannot be named 'default' (@see http://us3.php |
|
| 426 | - * .net/manual/en/reserved.keywords.php) so need to |
|
| 427 | - * handle routes that are "default" |
|
| 428 | - * |
|
| 429 | - * @since 4.3.0 |
|
| 430 | - */ |
|
| 431 | - $method_callback = $this->_current_route == 'default' ? 'default_callback' : $this->_current_route; |
|
| 432 | - // these run before the Admin_Page route executes. |
|
| 433 | - if (is_callable($this, $method_callback)) { |
|
| 434 | - call_user_func([$this, $method_callback]); |
|
| 435 | - } |
|
| 436 | - // these run via the _redirect_after_action method in EE_Admin_Page which usually happens after non_UI methods in EE_Admin_Page classes. There are two redirect actions, the first fires before $query_args might be manipulated by "save and close" actions and the second fires right before the actual redirect happens. |
|
| 437 | - // first the actions |
|
| 438 | - // note that these action hooks will have the $query_args value available. |
|
| 439 | - $admin_class_name = get_class($this->_adminpage_obj); |
|
| 440 | - if (method_exists($this, '_redirect_action_early_' . $this->_current_route)) { |
|
| 441 | - add_action( |
|
| 442 | - 'AHEE__' |
|
| 443 | - . $admin_class_name |
|
| 444 | - . '___redirect_after_action__before_redirect_modification_' |
|
| 445 | - . $this->_current_route, |
|
| 446 | - [$this, '_redirect_action_early_' . $this->_current_route] |
|
| 447 | - ); |
|
| 448 | - } |
|
| 449 | - if (method_exists($this, '_redirect_action_' . $this->_current_route)) { |
|
| 450 | - add_action( |
|
| 451 | - 'AHEE_redirect_' . $admin_class_name . $this->_current_route, |
|
| 452 | - [$this, '_redirect_action_' . $this->_current_route] |
|
| 453 | - ); |
|
| 454 | - } |
|
| 455 | - // let's hook into the _redirect itself and allow for changing where the user goes after redirect. This will have $query_args and $redirect_url available. |
|
| 456 | - if (method_exists($this, '_redirect_filter_' . $this->_current_route)) { |
|
| 457 | - add_filter( |
|
| 458 | - 'FHEE_redirect_' . $admin_class_name . $this->_current_route, |
|
| 459 | - [$this, '_redirect_filter_' . $this->_current_route], |
|
| 460 | - 10, |
|
| 461 | - 2 |
|
| 462 | - ); |
|
| 463 | - } |
|
| 464 | - } |
|
| 465 | - |
|
| 466 | - |
|
| 467 | - /** |
|
| 468 | - * This method will search for a corresponding method with a name matching the route and the wp_hook to run. This |
|
| 469 | - * allows child hook classes to target hooking into a specific wp action or filter hook ONLY on a certain route. |
|
| 470 | - * just remember, methods MUST be public Future hooks should be added in here to be access by child classes. |
|
| 471 | - * |
|
| 472 | - * @return void |
|
| 473 | - */ |
|
| 474 | - private function _load_routed_hooks() |
|
| 475 | - { |
|
| 476 | - // this array provides the hook action names that will be referenced. Key is the action. Value is an array with the type (action or filter) and the number of parameters for the hook. We'll default all priorities for automatic hooks to 10. |
|
| 477 | - $hook_filter_array = [ |
|
| 478 | - 'admin_footer' => [ |
|
| 479 | - 'type' => 'action', |
|
| 480 | - 'argnum' => 1, |
|
| 481 | - 'priority' => 10, |
|
| 482 | - ], |
|
| 483 | - 'FHEE_list_table_views_' . $this->_adminpage_obj->page_slug . '_' . $this->_current_route => [ |
|
| 484 | - 'type' => 'filter', |
|
| 485 | - 'argnum' => 1, |
|
| 486 | - 'priority' => 10, |
|
| 487 | - ], |
|
| 488 | - 'FHEE_list_table_views_' . $this->_adminpage_obj->page_slug => [ |
|
| 489 | - 'type' => 'filter', |
|
| 490 | - 'argnum' => 1, |
|
| 491 | - 'priority' => 10, |
|
| 492 | - ], |
|
| 493 | - 'FHEE_list_table_views' => [ |
|
| 494 | - 'type' => 'filter', |
|
| 495 | - 'argnum' => 1, |
|
| 496 | - 'priority' => 10, |
|
| 497 | - ], |
|
| 498 | - 'AHEE__EE_Admin_Page___display_admin_page__modify_metaboxes' => [ |
|
| 499 | - 'type' => 'action', |
|
| 500 | - 'argnum' => 1, |
|
| 501 | - 'priority' => 10, |
|
| 502 | - ], |
|
| 503 | - ]; |
|
| 504 | - foreach ($hook_filter_array as $hook => $args) { |
|
| 505 | - if (method_exists($this, $this->_current_route . '_' . $hook)) { |
|
| 506 | - if (isset($this->_wp_action_filters_priority[ $hook ])) { |
|
| 507 | - $args['priority'] = $this->_wp_action_filters_priority[ $hook ]; |
|
| 508 | - } |
|
| 509 | - if ($args['type'] == 'action') { |
|
| 510 | - add_action( |
|
| 511 | - $hook, |
|
| 512 | - [$this, $this->_current_route . '_' . $hook], |
|
| 513 | - $args['priority'], |
|
| 514 | - $args['argnum'] |
|
| 515 | - ); |
|
| 516 | - } else { |
|
| 517 | - add_filter( |
|
| 518 | - $hook, |
|
| 519 | - [$this, $this->_current_route . '_' . $hook], |
|
| 520 | - $args['priority'], |
|
| 521 | - $args['argnum'] |
|
| 522 | - ); |
|
| 523 | - } |
|
| 524 | - } |
|
| 525 | - } |
|
| 526 | - } |
|
| 527 | - |
|
| 528 | - |
|
| 529 | - /** |
|
| 530 | - * Loop through the $_ajax_func array and add_actions for the array. |
|
| 531 | - * |
|
| 532 | - * @return void |
|
| 533 | - * @throws EE_Error |
|
| 534 | - */ |
|
| 535 | - private function _ajax_hooks() |
|
| 536 | - { |
|
| 537 | - if (empty($this->_ajax_func)) { |
|
| 538 | - return; |
|
| 539 | - } //get out there's nothing to take care of. |
|
| 540 | - foreach ($this->_ajax_func as $action => $method) { |
|
| 541 | - // make sure method exists |
|
| 542 | - if (! method_exists($this, $method)) { |
|
| 543 | - $msg[] = esc_html__( |
|
| 544 | - 'There is no corresponding method for the hook labeled in the _ajax_func array', |
|
| 545 | - 'event_espresso' |
|
| 546 | - ) . '<br />'; |
|
| 547 | - $msg[] = sprintf( |
|
| 548 | - esc_html__( |
|
| 549 | - 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', |
|
| 550 | - 'event_espresso' |
|
| 551 | - ), |
|
| 552 | - $method, |
|
| 553 | - $this->caller |
|
| 554 | - ); |
|
| 555 | - throw new EE_Error(implode('||', $msg)); |
|
| 556 | - } |
|
| 557 | - add_action('wp_ajax_' . $action, [$this, $method]); |
|
| 558 | - } |
|
| 559 | - } |
|
| 560 | - |
|
| 561 | - |
|
| 562 | - /** |
|
| 563 | - * Loop through the $_init_func array and add_actions for the array. |
|
| 564 | - * |
|
| 565 | - * @return void |
|
| 566 | - * @throws EE_Error |
|
| 567 | - */ |
|
| 568 | - protected function _init_hooks() |
|
| 569 | - { |
|
| 570 | - if (empty($this->_init_func)) { |
|
| 571 | - return; |
|
| 572 | - } |
|
| 573 | - // get out there's nothing to take care of. |
|
| 574 | - // We need to determine what page_route we are on! |
|
| 575 | - foreach ($this->_init_func as $route => $method) { |
|
| 576 | - // make sure method exists |
|
| 577 | - if (! method_exists($this, $method)) { |
|
| 578 | - $msg[] = esc_html__( |
|
| 579 | - 'There is no corresponding method for the hook labeled in the _init_func array', |
|
| 580 | - 'event_espresso' |
|
| 581 | - ) . '<br />'; |
|
| 582 | - $msg[] = sprintf( |
|
| 583 | - esc_html__( |
|
| 584 | - 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', |
|
| 585 | - 'event_espresso' |
|
| 586 | - ), |
|
| 587 | - $method, |
|
| 588 | - $this->caller |
|
| 589 | - ); |
|
| 590 | - throw new EE_Error(implode('||', $msg)); |
|
| 591 | - } |
|
| 592 | - if ($route == $this->_current_route) { |
|
| 593 | - add_action('admin_init', [$this, $method]); |
|
| 594 | - } |
|
| 595 | - } |
|
| 596 | - } |
|
| 597 | - |
|
| 598 | - |
|
| 599 | - /** |
|
| 600 | - * Loop through the _metaboxes property and add_metaboxes accordingly |
|
| 601 | - * //todo we could eventually make this a config component class (i.e. new EE_Metabox); |
|
| 602 | - * |
|
| 603 | - * @return void |
|
| 604 | - * @throws EE_Error |
|
| 605 | - */ |
|
| 606 | - public function add_metaboxes() |
|
| 607 | - { |
|
| 608 | - if (empty($this->_metaboxes)) { |
|
| 609 | - return; |
|
| 610 | - } //get out we don't have any metaboxes to set for this connection |
|
| 611 | - $this->_handle_metabox_array($this->_metaboxes); |
|
| 612 | - } |
|
| 613 | - |
|
| 614 | - |
|
| 615 | - /** |
|
| 616 | - * @param array $boxes |
|
| 617 | - * @param bool|null $add |
|
| 618 | - * @throws EE_Error |
|
| 619 | - */ |
|
| 620 | - private function _handle_metabox_array(array $boxes, ?bool $add = true) |
|
| 621 | - { |
|
| 622 | - foreach ($boxes as $box) { |
|
| 623 | - if (! isset($box['page_route'])) { |
|
| 624 | - continue; |
|
| 625 | - } |
|
| 626 | - // we don't have a valid array |
|
| 627 | - // let's make sure $box['page_route'] is an array so the "foreach" will work. |
|
| 628 | - $box['page_route'] = (array) $box['page_route']; |
|
| 629 | - foreach ($box['page_route'] as $route) { |
|
| 630 | - if ($route != $this->_current_route) { |
|
| 631 | - continue; |
|
| 632 | - } //get out we only add metaboxes for set route. |
|
| 633 | - if ($add) { |
|
| 634 | - $this->_add_metabox($box); |
|
| 635 | - } else { |
|
| 636 | - $this->_remove_metabox($box); |
|
| 637 | - } |
|
| 638 | - } |
|
| 639 | - } |
|
| 640 | - } |
|
| 641 | - |
|
| 642 | - |
|
| 643 | - /** |
|
| 644 | - * Loop through the _remove_metaboxes property and remove metaboxes accordingly. |
|
| 645 | - * |
|
| 646 | - * @return void |
|
| 647 | - * @throws EE_Error |
|
| 648 | - */ |
|
| 649 | - public function remove_metaboxes() |
|
| 650 | - { |
|
| 651 | - if (empty($this->_remove_metaboxes)) { |
|
| 652 | - return; |
|
| 653 | - } //get out there are no metaboxes to remove |
|
| 654 | - $this->_handle_metabox_array($this->_remove_metaboxes, false); |
|
| 655 | - } |
|
| 656 | - |
|
| 657 | - |
|
| 658 | - /** |
|
| 659 | - * This just handles adding a metabox |
|
| 660 | - * |
|
| 661 | - * @param array $args an array of args that have been set for this metabox by the child class |
|
| 662 | - * @throws EE_Error |
|
| 663 | - */ |
|
| 664 | - private function _add_metabox(array $args) |
|
| 665 | - { |
|
| 666 | - $current_screen = get_current_screen(); |
|
| 667 | - $screen_id = is_object($current_screen) ? $current_screen->id : null; |
|
| 668 | - $callback = $args['func'] ?? 'some_invalid_callback'; |
|
| 669 | - $callback_function = is_array($callback) ? end($callback) : $callback; |
|
| 670 | - // set defaults |
|
| 671 | - $defaults = [ |
|
| 672 | - 'callback_args' => [], |
|
| 673 | - 'context' => 'advanced', |
|
| 674 | - 'func' => $callback, |
|
| 675 | - 'id' => $this->caller . '_' . $callback_function . '_metabox', |
|
| 676 | - 'label' => $this->caller, |
|
| 677 | - 'page' => $args['page'] ?? $screen_id, |
|
| 678 | - 'priority' => 'default', |
|
| 679 | - ]; |
|
| 680 | - $args = wp_parse_args($args, $defaults); |
|
| 681 | - $callback_args = $args['callback_args']; |
|
| 682 | - $context = $args['context']; |
|
| 683 | - $id = $args['id']; |
|
| 684 | - $label = $args['label']; |
|
| 685 | - $page = $args['page']; |
|
| 686 | - $priority = $args['priority']; |
|
| 687 | - // make sure method exists |
|
| 688 | - if (! method_exists($this, $callback_function)) { |
|
| 689 | - $msg[] = |
|
| 690 | - esc_html__('There is no corresponding method to display the metabox content', 'event_espresso') |
|
| 691 | - . '<br />'; |
|
| 692 | - $msg[] = sprintf( |
|
| 693 | - esc_html__( |
|
| 694 | - 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', |
|
| 695 | - 'event_espresso' |
|
| 696 | - ), |
|
| 697 | - $callback_function, |
|
| 698 | - $this->caller |
|
| 699 | - ); |
|
| 700 | - throw new EE_Error(implode('||', $msg)); |
|
| 701 | - } |
|
| 702 | - // everything checks out so let's add the metabox |
|
| 703 | - add_meta_box($id, $label, [$this, $callback_function], $page, $context, $priority, $callback_args); |
|
| 704 | - add_filter( |
|
| 705 | - "postbox_classes_{$page}_$id", |
|
| 706 | - function ($classes) { |
|
| 707 | - $classes[] = 'ee-admin-container'; |
|
| 708 | - return $classes; |
|
| 709 | - } |
|
| 710 | - ); |
|
| 711 | - } |
|
| 712 | - |
|
| 713 | - |
|
| 714 | - private function _remove_metabox($args) |
|
| 715 | - { |
|
| 716 | - $current_screen = get_current_screen(); |
|
| 717 | - $screen_id = is_object($current_screen) ? $current_screen->id : null; |
|
| 718 | - $func = $args['func'] ?? 'some_invalid_callback'; |
|
| 719 | - // set defaults |
|
| 720 | - $defaults = [ |
|
| 721 | - 'context' => 'default', |
|
| 722 | - 'id' => $args['id'] ?? "{$this->_current_route}_{$this->caller}_{$func}_metabox", |
|
| 723 | - 'screen' => $args['screen'] ?? $screen_id, |
|
| 724 | - ]; |
|
| 725 | - $args = wp_parse_args($args, $defaults); |
|
| 726 | - $context = $args['context']; |
|
| 727 | - $id = $args['id']; |
|
| 728 | - $screen = $args['screen']; |
|
| 729 | - // everything checks out so lets remove the box! |
|
| 730 | - remove_meta_box($id, $screen, $context); |
|
| 731 | - } |
|
| 732 | - |
|
| 733 | - /** |
|
| 734 | - * This is used whenever we're DOING_AJAX to return a formatted json array that our calling javascript can expect |
|
| 735 | - * The returned json object is created from an array in the following format: |
|
| 736 | - * array( |
|
| 737 | - * 'error' => FALSE, //(default FALSE), contains any errors and/or exceptions (exceptions return json early), |
|
| 738 | - * 'success' => FALSE, //(default FALSE) - contains any special success message. |
|
| 739 | - * 'notices' => '', // - contains any EE_Error formatted notices |
|
| 740 | - * 'content' => 'string can be html', //this is a string of formatted content (can be html) |
|
| 741 | - * 'data' => array() //this can be any key/value pairs that a method returns for later json parsing by the js. |
|
| 742 | - * We're also going to include the template args with every package (so js can pick out any specific template args |
|
| 743 | - * that might be included in here) |
|
| 744 | - * ) |
|
| 745 | - * The json object is populated by whatever is set in the $_template_args property. |
|
| 746 | - * |
|
| 747 | - * @param string $content |
|
| 748 | - * @param array $data |
|
| 749 | - */ |
|
| 750 | - public function returnJson(string $content = '', array $data = []): void |
|
| 751 | - { |
|
| 752 | - // make sure any EE_Error notices have been handled. |
|
| 753 | - $notices = EE_Error::get_notices(false); |
|
| 754 | - wp_send_json( |
|
| 755 | - [ |
|
| 756 | - 'success' => $notices['success'] ?? false, |
|
| 757 | - 'errors' => $notices['errors'] ?? false, |
|
| 758 | - 'attention' => $notices['attention'] ?? false, |
|
| 759 | - 'notices' => $notices, |
|
| 760 | - 'content' => $content, |
|
| 761 | - 'data' => $data, |
|
| 762 | - // special flag so any ajax.Success methods in js can identify this return package as a EEajax package. |
|
| 763 | - 'isEEajax' => true, |
|
| 764 | - ] |
|
| 765 | - ); |
|
| 766 | - } |
|
| 18 | + /** |
|
| 19 | + * This just holds an instance of the page object for this hook |
|
| 20 | + * |
|
| 21 | + * @var EE_Admin_Page|EE_Admin_Page_CPT|null |
|
| 22 | + * @deprecated 5.0.8.p |
|
| 23 | + */ |
|
| 24 | + protected $_page_object = null; |
|
| 25 | + |
|
| 26 | + /** |
|
| 27 | + * This holds the EE_Admin_Page object from the calling admin page that this object hooks into. |
|
| 28 | + * |
|
| 29 | + * @var EE_Admin_Page|EE_Admin_Page_CPT|null |
|
| 30 | + */ |
|
| 31 | + protected $_adminpage_obj = null; |
|
| 32 | + |
|
| 33 | + protected ?EE_Registry $EE = null; |
|
| 34 | + |
|
| 35 | + protected ?RequestInterface $request = null; |
|
| 36 | + |
|
| 37 | + /** |
|
| 38 | + * This is set by child classes and is an associative array of ajax hooks in the format: |
|
| 39 | + * array( |
|
| 40 | + * 'ajax_action_ref' => 'executing_method'; //must be public |
|
| 41 | + * ) |
|
| 42 | + */ |
|
| 43 | + protected array $_ajax_func = []; |
|
| 44 | + |
|
| 45 | + /** |
|
| 46 | + * This is an array of methods that get executed on a page routes admin_init hook. Use the following format: |
|
| 47 | + * array( |
|
| 48 | + * 'page_route' => 'executing_method' //must be public |
|
| 49 | + * ) |
|
| 50 | + */ |
|
| 51 | + protected array $_init_func = []; |
|
| 52 | + |
|
| 53 | + /** |
|
| 54 | + * This is an array of methods that output metabox content for the given page route. Use the following format: |
|
| 55 | + * [ |
|
| 56 | + * 0 => [ |
|
| 57 | + * 'page_route' => 'string_for_page_route', must correspond to a page route in the class being connected |
|
| 58 | + * with (i.e. "edit_event") If this is in an array then the |
|
| 59 | + * same params below will be used but the metabox will be |
|
| 60 | + * added to each route. |
|
| 61 | + * 'func' => 'executing_method', must be public (i.e. public function executing_method |
|
| 62 | + * ($post, $callback_args){} ). |
|
| 63 | + * Note if you include callback args in the array then you |
|
| 64 | + * need to declare them in the method arguments. |
|
| 65 | + * 'id' => 'identifier_for_metabox', so it can be removed by addons |
|
| 66 | + * (optional, class will set it automatically) |
|
| 67 | + * 'priority' => 'default', default 'default' (optional) |
|
| 68 | + * 'label' => esc_html__('Localized Title', 'event_espresso'), |
|
| 69 | + * 'context' => 'advanced' advanced is default (optional), |
|
| 70 | + * ] |
|
| 71 | + * 'callback_args' => array() //any callback args to include (optional) |
|
| 72 | + * ] |
|
| 73 | + * Why are we indexing numerically? Because it's possible there may be more than one metabox per page_route. |
|
| 74 | + */ |
|
| 75 | + protected array $_metaboxes = []; |
|
| 76 | + |
|
| 77 | + /** |
|
| 78 | + * This is an array of values that indicate any metaboxes we want removed from a given page route. Usually this is |
|
| 79 | + * used when caffeinated functionality is replacing decaffeinated functionality. Use the following format for the |
|
| 80 | + * array: array( |
|
| 81 | + * 0 => array( |
|
| 82 | + * 'page_route' => 'string_for_page_route' //can be string or array of strings that match a page_route(s) |
|
| 83 | + * that are in the class being connected with (i.e. 'edit', or 'create_new'). |
|
| 84 | + * 'id' => 'identifier_for_metabox', //what the id is of the metabox being removed |
|
| 85 | + * 'context' => 'normal', //the context for the metabox being removed (has to match) |
|
| 86 | + * 'screen' => 'screen_id', //(optional), if not included then this class will attempt to remove the metabox |
|
| 87 | + * using the currently loaded screen object->id however, there may be cases where you have to specify the |
|
| 88 | + * id for the screen the metabox is on. |
|
| 89 | + * ) |
|
| 90 | + * ) |
|
| 91 | + */ |
|
| 92 | + protected array $_remove_metaboxes = []; |
|
| 93 | + |
|
| 94 | + protected array $_req_data = []; |
|
| 95 | + |
|
| 96 | + /** |
|
| 97 | + * This parent class takes care of loading the scripts and styles if the child class has set the properties for |
|
| 98 | + * them in the following format. Note, the first array index ('register') is for defining all the registers. The |
|
| 99 | + * second array index is for indicating what routes each script/style loads on. array( |
|
| 100 | + * 'registers' => array( |
|
| 101 | + * 'script_ref' => array( // if more than one script is to be loaded its best to use the 'dependency' |
|
| 102 | + * argument to link scripts together. |
|
| 103 | + * 'type' => 'js' // 'js' or 'css' (defaults to js). This tells us what type of wp_function to use |
|
| 104 | + * 'url' => 'http://urltoscript.css.js', |
|
| 105 | + * 'depends' => array('jquery'), //an array of dependencies for the scripts. REMEMBER, if a script has |
|
| 106 | + * already been registered elsewhere in the system. You can just use the depends array to make sure it |
|
| 107 | + * gets loaded before the one you are setting here. |
|
| 108 | + * 'footer' => TRUE //defaults to true (styles don't use this parameter) |
|
| 109 | + * ), |
|
| 110 | + * 'enqueues' => array( //this time each key corresponds to the script ref followed by an array of page routes |
|
| 111 | + * the script gets enqueued on. |
|
| 112 | + * 'script_ref' => array('route_one', 'route_two') |
|
| 113 | + * ), |
|
| 114 | + * 'localize' => array( //this allows you to set a localized object. Indicate which script the object is being |
|
| 115 | + * attached to and then include an array indexed by the name of the object and the array of key/value pairs for |
|
| 116 | + * the object. |
|
| 117 | + * 'scrip_ref' => array( |
|
| 118 | + * 'NAME_OF_JS_OBJECT' => array( |
|
| 119 | + * 'translate_ref' => esc_html__('localized_string', 'event_espresso'), |
|
| 120 | + * 'some_data' => 5 |
|
| 121 | + * ) |
|
| 122 | + * ) |
|
| 123 | + * ) |
|
| 124 | + * ) |
|
| 125 | + */ |
|
| 126 | + protected array $_scripts_styles = []; |
|
| 127 | + |
|
| 128 | + protected array $_scripts = []; |
|
| 129 | + |
|
| 130 | + protected array $_styles = []; |
|
| 131 | + |
|
| 132 | + /** |
|
| 133 | + * this optional property can be set by child classes to override the priority for the automatic action/filter hook |
|
| 134 | + * loading in the `_load_routed_hooks()` method. Please follow this format: array( |
|
| 135 | + * 'wp_hook_reference' => 1 |
|
| 136 | + * ) |
|
| 137 | + * ) |
|
| 138 | + */ |
|
| 139 | + protected array $_wp_action_filters_priority = []; |
|
| 140 | + |
|
| 141 | + /** |
|
| 142 | + * this is just a flag set automatically to indicate whether we've got an extended hook class running (i.e. |
|
| 143 | + * espresso_events_Registration_Form_Hooks_Extend extends espresso_events_Registration_Form_Hooks). This flag is |
|
| 144 | + * used later to make sure we require the needed files. |
|
| 145 | + */ |
|
| 146 | + protected bool $_extend = false; |
|
| 147 | + |
|
| 148 | + /** |
|
| 149 | + * we're just going to use this to hold the name of the caller class (child class name) |
|
| 150 | + */ |
|
| 151 | + public string $caller = ''; |
|
| 152 | + |
|
| 153 | + protected string $_current_route = ''; |
|
| 154 | + |
|
| 155 | + |
|
| 156 | + /** |
|
| 157 | + * child classes MUST set this property so that the page object can be loaded correctly |
|
| 158 | + */ |
|
| 159 | + protected string $_name = ''; |
|
| 160 | + |
|
| 161 | + |
|
| 162 | + /** |
|
| 163 | + * constructor |
|
| 164 | + * |
|
| 165 | + * @param EE_Admin_Page $admin_page |
|
| 166 | + * @throws EE_Error |
|
| 167 | + * @throws ReflectionException |
|
| 168 | + */ |
|
| 169 | + public function __construct(EE_Admin_Page $admin_page) |
|
| 170 | + { |
|
| 171 | + $this->_adminpage_obj = $admin_page; |
|
| 172 | + $this->request = LoaderFactory::getLoader()->getShared(RequestInterface::class); |
|
| 173 | + $this->_req_data = $this->request->requestParams(); |
|
| 174 | + $current_page = $this->request->getRequestParam('page'); |
|
| 175 | + $current_page = $this->request->getRequestParam('current_page', $current_page); |
|
| 176 | + // first let's verify we're on the right page |
|
| 177 | + if ($current_page !== $this->_adminpage_obj->page_slug) { |
|
| 178 | + return; |
|
| 179 | + } |
|
| 180 | + $this->_set_defaults(); |
|
| 181 | + $this->_set_hooks_properties(); |
|
| 182 | + // get out nothing more to be done here. |
|
| 183 | + // allow for extends to modify properties |
|
| 184 | + if (method_exists($this, '_extend_properties')) { |
|
| 185 | + $this->_extend_properties(); |
|
| 186 | + } |
|
| 187 | + // $this->_set_page_object(); |
|
| 188 | + $this->_init_hooks(); |
|
| 189 | + $this->_load_custom_methods(); |
|
| 190 | + $this->_load_routed_hooks(); |
|
| 191 | + add_action('admin_enqueue_scripts', [$this, 'enqueue_scripts_styles']); |
|
| 192 | + add_action('admin_enqueue_scripts', [$this, 'add_metaboxes'], 20); |
|
| 193 | + add_action('admin_enqueue_scripts', [$this, 'remove_metaboxes'], 15); |
|
| 194 | + $this->_ajax_hooks(); |
|
| 195 | + } |
|
| 196 | + |
|
| 197 | + |
|
| 198 | + /** |
|
| 199 | + * used by child classes to set the following properties: |
|
| 200 | + * $_ajax_func (optional) |
|
| 201 | + * $_init_func (optional) |
|
| 202 | + * $_metaboxes (optional) |
|
| 203 | + * $_scripts (optional) |
|
| 204 | + * $_styles (optional) |
|
| 205 | + * $_name (required) |
|
| 206 | + * Also in this method will be registered any scripts or styles loaded on the targeted page (as indicated in the |
|
| 207 | + * _scripts/_styles properties) Also children should place in this method any filters/actions that have to happen |
|
| 208 | + * really early on page load (just after admin_init) if they want to have them registered for handling early. |
|
| 209 | + * |
|
| 210 | + * @abstract |
|
| 211 | + * @return void |
|
| 212 | + */ |
|
| 213 | + abstract protected function _set_hooks_properties(); |
|
| 214 | + |
|
| 215 | + |
|
| 216 | + /** |
|
| 217 | + * The hooks for enqueue_scripts and enqueue_styles will be run in here. Child classes need to define their |
|
| 218 | + * scripts and styles in the relevant $_scripts and $_styles properties. Child classes must have also already |
|
| 219 | + * registered the scripts and styles using wp_register_script and wp_register_style functions. |
|
| 220 | + * |
|
| 221 | + * @return void |
|
| 222 | + * @throws EE_Error |
|
| 223 | + */ |
|
| 224 | + public function enqueue_scripts_styles() |
|
| 225 | + { |
|
| 226 | + if (! empty($this->_scripts_styles)) { |
|
| 227 | + // first let's do all the registrations |
|
| 228 | + if (! isset($this->_scripts_styles['registers'])) { |
|
| 229 | + $msg[] = esc_html__( |
|
| 230 | + 'There is no "registers" index in the <code>$this->_scripts_styles</code> property.', |
|
| 231 | + 'event_espresso' |
|
| 232 | + ); |
|
| 233 | + $msg[] = sprintf( |
|
| 234 | + esc_html__( |
|
| 235 | + 'Make sure you read the phpdoc comments above the definition of the $_scripts_styles property in the <code>EE_Admin_Hooks</code> class and modify according in the %s child', |
|
| 236 | + 'event_espresso' |
|
| 237 | + ), |
|
| 238 | + '<strong>' . $this->caller . '</strong>' |
|
| 239 | + ); |
|
| 240 | + throw new EE_Error(implode('||', $msg)); |
|
| 241 | + } |
|
| 242 | + $defaults = [ |
|
| 243 | + 'type' => 'js', |
|
| 244 | + 'url' => '', |
|
| 245 | + 'depends' => [], |
|
| 246 | + 'version' => EVENT_ESPRESSO_VERSION, |
|
| 247 | + 'footer' => true, |
|
| 248 | + ]; |
|
| 249 | + foreach ($this->_scripts_styles['registers'] as $ref => $details) { |
|
| 250 | + $details = wp_parse_args($details, $defaults); |
|
| 251 | + $type = $details['type']; |
|
| 252 | + $url = $details['url']; |
|
| 253 | + $depends = $details['depends']; |
|
| 254 | + $version = $details['version']; |
|
| 255 | + $footer = $details['footer']; |
|
| 256 | + // let's make sure that we set the 'registers' type if it's not set! |
|
| 257 | + // We need it later to determine which enqueue we do |
|
| 258 | + $this->_scripts_styles['registers'][ $ref ]['type'] = $type; |
|
| 259 | + // let's make sure we're not missing any REQUIRED parameters |
|
| 260 | + if (empty($url)) { |
|
| 261 | + $msg[] = sprintf( |
|
| 262 | + esc_html__('Missing the url for the requested %s', 'event_espresso'), |
|
| 263 | + $type == 'js' ? 'script' : 'stylesheet' |
|
| 264 | + ); |
|
| 265 | + $msg[] = sprintf( |
|
| 266 | + esc_html__( |
|
| 267 | + 'Double-check your <code>$this->_scripts_styles</code> array in %s and make sure that there is a "url" set for the %s ref', |
|
| 268 | + 'event_espresso' |
|
| 269 | + ), |
|
| 270 | + '<strong>' . $this->caller . '</strong>', |
|
| 271 | + $ref |
|
| 272 | + ); |
|
| 273 | + throw new EE_Error(implode('||', $msg)); |
|
| 274 | + } |
|
| 275 | + // made it here so let's do the appropriate registration |
|
| 276 | + $type == 'js' |
|
| 277 | + ? wp_register_script($ref, $url, $depends, $version, $footer) |
|
| 278 | + : wp_register_style( |
|
| 279 | + $ref, |
|
| 280 | + $url, |
|
| 281 | + $depends, |
|
| 282 | + $version |
|
| 283 | + ); |
|
| 284 | + } |
|
| 285 | + // k now let's do the enqueues |
|
| 286 | + if (! isset($this->_scripts_styles['enqueues'])) { |
|
| 287 | + return; |
|
| 288 | + } //not sure if we should throw an error here or not. |
|
| 289 | + |
|
| 290 | + foreach ($this->_scripts_styles['enqueues'] as $ref => $routes) { |
|
| 291 | + // make sure $routes is an array |
|
| 292 | + $routes = (array) $routes; |
|
| 293 | + if (in_array($this->_current_route, $routes)) { |
|
| 294 | + $this->_scripts_styles['registers'][ $ref ]['type'] == 'js' ? wp_enqueue_script($ref) |
|
| 295 | + : wp_enqueue_style($ref); |
|
| 296 | + // if we have a localization for the script let's do that too. |
|
| 297 | + if (isset($this->_scripts_styles['localize'][ $ref ])) { |
|
| 298 | + foreach ($this->_scripts_styles['localize'][ $ref ] as $object_name => $indexes) { |
|
| 299 | + wp_localize_script( |
|
| 300 | + $ref, |
|
| 301 | + $object_name, |
|
| 302 | + $this->_scripts_styles['localize'][ $ref ][ $object_name ] |
|
| 303 | + ); |
|
| 304 | + } |
|
| 305 | + } |
|
| 306 | + } |
|
| 307 | + } |
|
| 308 | + // let's do the deregisters |
|
| 309 | + if (! isset($this->_scripts_styles['deregisters'])) { |
|
| 310 | + return; |
|
| 311 | + } |
|
| 312 | + foreach ($this->_scripts_styles['deregisters'] as $ref => $details) { |
|
| 313 | + $defaults = ['type' => 'js']; |
|
| 314 | + $details = wp_parse_args($details, $defaults); |
|
| 315 | + $details['type'] === 'js' ? wp_deregister_script($ref) : wp_deregister_style($ref); |
|
| 316 | + } |
|
| 317 | + } |
|
| 318 | + } |
|
| 319 | + |
|
| 320 | + |
|
| 321 | + /** |
|
| 322 | + * just set the defaults for the hooks properties. |
|
| 323 | + * |
|
| 324 | + * @return void |
|
| 325 | + */ |
|
| 326 | + private function _set_defaults() |
|
| 327 | + { |
|
| 328 | + $this->_ajax_func = []; |
|
| 329 | + $this->_init_func = []; |
|
| 330 | + $this->_metaboxes = []; |
|
| 331 | + $this->_scripts = []; |
|
| 332 | + $this->_styles = []; |
|
| 333 | + $this->_wp_action_filters_priority = []; |
|
| 334 | + $this->_current_route = $this->getCurrentRoute(); |
|
| 335 | + $this->caller = get_class($this); |
|
| 336 | + $this->_extend = (bool) stripos($this->caller, 'Extend'); |
|
| 337 | + } |
|
| 338 | + |
|
| 339 | + |
|
| 340 | + /** |
|
| 341 | + * A helper for determining the current route. |
|
| 342 | + * |
|
| 343 | + * @return string |
|
| 344 | + */ |
|
| 345 | + private function getCurrentRoute(): string |
|
| 346 | + { |
|
| 347 | + $action = $this->request->getRequestParam('action'); |
|
| 348 | + // list tables do something else with 'action' for bulk actions. |
|
| 349 | + $action = $action !== '-1' && $action !== '' ? $action : 'default'; |
|
| 350 | + $route = $this->request->getRequestParam('route'); |
|
| 351 | + // we set a 'route' variable in some cases where action is being used by something else. |
|
| 352 | + return $action === 'default' && $route !== '' ? $route : $action; |
|
| 353 | + } |
|
| 354 | + |
|
| 355 | + |
|
| 356 | + /** |
|
| 357 | + * this sets the _page_object property |
|
| 358 | + * |
|
| 359 | + * @return void |
|
| 360 | + * @throws EE_Error |
|
| 361 | + * @throws ReflectionException |
|
| 362 | + * @throws Throwable |
|
| 363 | + * @deprecated 5.0.8.p |
|
| 364 | + */ |
|
| 365 | + protected function _set_page_object() |
|
| 366 | + { |
|
| 367 | + if ($this->_page_object instanceof EE_Admin_Page) { |
|
| 368 | + return; |
|
| 369 | + } |
|
| 370 | + // first make sure $this->_name is set |
|
| 371 | + if (empty($this->_name)) { |
|
| 372 | + $msg[] = esc_html__('We can\'t load the page object', 'event_espresso'); |
|
| 373 | + $msg[] = sprintf( |
|
| 374 | + esc_html__("This is because the %s child class has not set the '_name' property", 'event_espresso'), |
|
| 375 | + $this->caller |
|
| 376 | + ); |
|
| 377 | + throw new EE_Error(implode('||', $msg)); |
|
| 378 | + } |
|
| 379 | + // change "the_message" to "the message" |
|
| 380 | + $class_name = str_replace('_', ' ', $this->_name); |
|
| 381 | + // change "the message" to "The_Message_Admin_Page" |
|
| 382 | + $class_name = str_replace(' ', '_', ucwords($class_name)) . '_Admin_Page'; |
|
| 383 | + // first default file (if exists) |
|
| 384 | + $decaf_file = EE_ADMIN_PAGES . "$this->_name/$class_name.core.php"; |
|
| 385 | + if (is_readable($decaf_file)) { |
|
| 386 | + require_once($decaf_file); |
|
| 387 | + } |
|
| 388 | + // now we have to do require for extended file (if needed) |
|
| 389 | + if ($this->_extend) { |
|
| 390 | + require_once EE_CORE_CAF_ADMIN_EXTEND . "$this->_name/Extend_$class_name.core.php"; |
|
| 391 | + // and extend the class name as well |
|
| 392 | + $class_name = 'Extend_' . $class_name; |
|
| 393 | + } |
|
| 394 | + // let's make sure the class exists |
|
| 395 | + if (! class_exists($class_name)) { |
|
| 396 | + $msg[] = esc_html__('We can\'t load the page object', 'event_espresso'); |
|
| 397 | + $msg[] = sprintf( |
|
| 398 | + esc_html__( |
|
| 399 | + 'The class name that was given is %s. Check the spelling and make sure its correct, also there needs to be an autoloader setup for the class', |
|
| 400 | + 'event_espresso' |
|
| 401 | + ), |
|
| 402 | + $class_name |
|
| 403 | + ); |
|
| 404 | + throw new EE_Error(implode('||', $msg)); |
|
| 405 | + } |
|
| 406 | + // do NOT load admin pages that are ALREADY LOADED!!! |
|
| 407 | + if ($class_name !== $this->_adminpage_obj->class_name) { |
|
| 408 | + return; |
|
| 409 | + } |
|
| 410 | + $this->_page_object = LoaderFactory::getLoader()->getShared($class_name, [false]); |
|
| 411 | + $this->_page_object->initializePage(); |
|
| 412 | + } |
|
| 413 | + |
|
| 414 | + |
|
| 415 | + /** |
|
| 416 | + * Child "hook" classes can declare any methods that they want executed when a specific page route is loaded. The |
|
| 417 | + * advantage of this is when doing things like running our own db interactions on saves etc. Remember that |
|
| 418 | + * $this->_req_data (all the _POST and _GET data) is available to your methods. |
|
| 419 | + * |
|
| 420 | + * @return void |
|
| 421 | + */ |
|
| 422 | + private function _load_custom_methods() |
|
| 423 | + { |
|
| 424 | + /** |
|
| 425 | + * method cannot be named 'default' (@see http://us3.php |
|
| 426 | + * .net/manual/en/reserved.keywords.php) so need to |
|
| 427 | + * handle routes that are "default" |
|
| 428 | + * |
|
| 429 | + * @since 4.3.0 |
|
| 430 | + */ |
|
| 431 | + $method_callback = $this->_current_route == 'default' ? 'default_callback' : $this->_current_route; |
|
| 432 | + // these run before the Admin_Page route executes. |
|
| 433 | + if (is_callable($this, $method_callback)) { |
|
| 434 | + call_user_func([$this, $method_callback]); |
|
| 435 | + } |
|
| 436 | + // these run via the _redirect_after_action method in EE_Admin_Page which usually happens after non_UI methods in EE_Admin_Page classes. There are two redirect actions, the first fires before $query_args might be manipulated by "save and close" actions and the second fires right before the actual redirect happens. |
|
| 437 | + // first the actions |
|
| 438 | + // note that these action hooks will have the $query_args value available. |
|
| 439 | + $admin_class_name = get_class($this->_adminpage_obj); |
|
| 440 | + if (method_exists($this, '_redirect_action_early_' . $this->_current_route)) { |
|
| 441 | + add_action( |
|
| 442 | + 'AHEE__' |
|
| 443 | + . $admin_class_name |
|
| 444 | + . '___redirect_after_action__before_redirect_modification_' |
|
| 445 | + . $this->_current_route, |
|
| 446 | + [$this, '_redirect_action_early_' . $this->_current_route] |
|
| 447 | + ); |
|
| 448 | + } |
|
| 449 | + if (method_exists($this, '_redirect_action_' . $this->_current_route)) { |
|
| 450 | + add_action( |
|
| 451 | + 'AHEE_redirect_' . $admin_class_name . $this->_current_route, |
|
| 452 | + [$this, '_redirect_action_' . $this->_current_route] |
|
| 453 | + ); |
|
| 454 | + } |
|
| 455 | + // let's hook into the _redirect itself and allow for changing where the user goes after redirect. This will have $query_args and $redirect_url available. |
|
| 456 | + if (method_exists($this, '_redirect_filter_' . $this->_current_route)) { |
|
| 457 | + add_filter( |
|
| 458 | + 'FHEE_redirect_' . $admin_class_name . $this->_current_route, |
|
| 459 | + [$this, '_redirect_filter_' . $this->_current_route], |
|
| 460 | + 10, |
|
| 461 | + 2 |
|
| 462 | + ); |
|
| 463 | + } |
|
| 464 | + } |
|
| 465 | + |
|
| 466 | + |
|
| 467 | + /** |
|
| 468 | + * This method will search for a corresponding method with a name matching the route and the wp_hook to run. This |
|
| 469 | + * allows child hook classes to target hooking into a specific wp action or filter hook ONLY on a certain route. |
|
| 470 | + * just remember, methods MUST be public Future hooks should be added in here to be access by child classes. |
|
| 471 | + * |
|
| 472 | + * @return void |
|
| 473 | + */ |
|
| 474 | + private function _load_routed_hooks() |
|
| 475 | + { |
|
| 476 | + // this array provides the hook action names that will be referenced. Key is the action. Value is an array with the type (action or filter) and the number of parameters for the hook. We'll default all priorities for automatic hooks to 10. |
|
| 477 | + $hook_filter_array = [ |
|
| 478 | + 'admin_footer' => [ |
|
| 479 | + 'type' => 'action', |
|
| 480 | + 'argnum' => 1, |
|
| 481 | + 'priority' => 10, |
|
| 482 | + ], |
|
| 483 | + 'FHEE_list_table_views_' . $this->_adminpage_obj->page_slug . '_' . $this->_current_route => [ |
|
| 484 | + 'type' => 'filter', |
|
| 485 | + 'argnum' => 1, |
|
| 486 | + 'priority' => 10, |
|
| 487 | + ], |
|
| 488 | + 'FHEE_list_table_views_' . $this->_adminpage_obj->page_slug => [ |
|
| 489 | + 'type' => 'filter', |
|
| 490 | + 'argnum' => 1, |
|
| 491 | + 'priority' => 10, |
|
| 492 | + ], |
|
| 493 | + 'FHEE_list_table_views' => [ |
|
| 494 | + 'type' => 'filter', |
|
| 495 | + 'argnum' => 1, |
|
| 496 | + 'priority' => 10, |
|
| 497 | + ], |
|
| 498 | + 'AHEE__EE_Admin_Page___display_admin_page__modify_metaboxes' => [ |
|
| 499 | + 'type' => 'action', |
|
| 500 | + 'argnum' => 1, |
|
| 501 | + 'priority' => 10, |
|
| 502 | + ], |
|
| 503 | + ]; |
|
| 504 | + foreach ($hook_filter_array as $hook => $args) { |
|
| 505 | + if (method_exists($this, $this->_current_route . '_' . $hook)) { |
|
| 506 | + if (isset($this->_wp_action_filters_priority[ $hook ])) { |
|
| 507 | + $args['priority'] = $this->_wp_action_filters_priority[ $hook ]; |
|
| 508 | + } |
|
| 509 | + if ($args['type'] == 'action') { |
|
| 510 | + add_action( |
|
| 511 | + $hook, |
|
| 512 | + [$this, $this->_current_route . '_' . $hook], |
|
| 513 | + $args['priority'], |
|
| 514 | + $args['argnum'] |
|
| 515 | + ); |
|
| 516 | + } else { |
|
| 517 | + add_filter( |
|
| 518 | + $hook, |
|
| 519 | + [$this, $this->_current_route . '_' . $hook], |
|
| 520 | + $args['priority'], |
|
| 521 | + $args['argnum'] |
|
| 522 | + ); |
|
| 523 | + } |
|
| 524 | + } |
|
| 525 | + } |
|
| 526 | + } |
|
| 527 | + |
|
| 528 | + |
|
| 529 | + /** |
|
| 530 | + * Loop through the $_ajax_func array and add_actions for the array. |
|
| 531 | + * |
|
| 532 | + * @return void |
|
| 533 | + * @throws EE_Error |
|
| 534 | + */ |
|
| 535 | + private function _ajax_hooks() |
|
| 536 | + { |
|
| 537 | + if (empty($this->_ajax_func)) { |
|
| 538 | + return; |
|
| 539 | + } //get out there's nothing to take care of. |
|
| 540 | + foreach ($this->_ajax_func as $action => $method) { |
|
| 541 | + // make sure method exists |
|
| 542 | + if (! method_exists($this, $method)) { |
|
| 543 | + $msg[] = esc_html__( |
|
| 544 | + 'There is no corresponding method for the hook labeled in the _ajax_func array', |
|
| 545 | + 'event_espresso' |
|
| 546 | + ) . '<br />'; |
|
| 547 | + $msg[] = sprintf( |
|
| 548 | + esc_html__( |
|
| 549 | + 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', |
|
| 550 | + 'event_espresso' |
|
| 551 | + ), |
|
| 552 | + $method, |
|
| 553 | + $this->caller |
|
| 554 | + ); |
|
| 555 | + throw new EE_Error(implode('||', $msg)); |
|
| 556 | + } |
|
| 557 | + add_action('wp_ajax_' . $action, [$this, $method]); |
|
| 558 | + } |
|
| 559 | + } |
|
| 560 | + |
|
| 561 | + |
|
| 562 | + /** |
|
| 563 | + * Loop through the $_init_func array and add_actions for the array. |
|
| 564 | + * |
|
| 565 | + * @return void |
|
| 566 | + * @throws EE_Error |
|
| 567 | + */ |
|
| 568 | + protected function _init_hooks() |
|
| 569 | + { |
|
| 570 | + if (empty($this->_init_func)) { |
|
| 571 | + return; |
|
| 572 | + } |
|
| 573 | + // get out there's nothing to take care of. |
|
| 574 | + // We need to determine what page_route we are on! |
|
| 575 | + foreach ($this->_init_func as $route => $method) { |
|
| 576 | + // make sure method exists |
|
| 577 | + if (! method_exists($this, $method)) { |
|
| 578 | + $msg[] = esc_html__( |
|
| 579 | + 'There is no corresponding method for the hook labeled in the _init_func array', |
|
| 580 | + 'event_espresso' |
|
| 581 | + ) . '<br />'; |
|
| 582 | + $msg[] = sprintf( |
|
| 583 | + esc_html__( |
|
| 584 | + 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', |
|
| 585 | + 'event_espresso' |
|
| 586 | + ), |
|
| 587 | + $method, |
|
| 588 | + $this->caller |
|
| 589 | + ); |
|
| 590 | + throw new EE_Error(implode('||', $msg)); |
|
| 591 | + } |
|
| 592 | + if ($route == $this->_current_route) { |
|
| 593 | + add_action('admin_init', [$this, $method]); |
|
| 594 | + } |
|
| 595 | + } |
|
| 596 | + } |
|
| 597 | + |
|
| 598 | + |
|
| 599 | + /** |
|
| 600 | + * Loop through the _metaboxes property and add_metaboxes accordingly |
|
| 601 | + * //todo we could eventually make this a config component class (i.e. new EE_Metabox); |
|
| 602 | + * |
|
| 603 | + * @return void |
|
| 604 | + * @throws EE_Error |
|
| 605 | + */ |
|
| 606 | + public function add_metaboxes() |
|
| 607 | + { |
|
| 608 | + if (empty($this->_metaboxes)) { |
|
| 609 | + return; |
|
| 610 | + } //get out we don't have any metaboxes to set for this connection |
|
| 611 | + $this->_handle_metabox_array($this->_metaboxes); |
|
| 612 | + } |
|
| 613 | + |
|
| 614 | + |
|
| 615 | + /** |
|
| 616 | + * @param array $boxes |
|
| 617 | + * @param bool|null $add |
|
| 618 | + * @throws EE_Error |
|
| 619 | + */ |
|
| 620 | + private function _handle_metabox_array(array $boxes, ?bool $add = true) |
|
| 621 | + { |
|
| 622 | + foreach ($boxes as $box) { |
|
| 623 | + if (! isset($box['page_route'])) { |
|
| 624 | + continue; |
|
| 625 | + } |
|
| 626 | + // we don't have a valid array |
|
| 627 | + // let's make sure $box['page_route'] is an array so the "foreach" will work. |
|
| 628 | + $box['page_route'] = (array) $box['page_route']; |
|
| 629 | + foreach ($box['page_route'] as $route) { |
|
| 630 | + if ($route != $this->_current_route) { |
|
| 631 | + continue; |
|
| 632 | + } //get out we only add metaboxes for set route. |
|
| 633 | + if ($add) { |
|
| 634 | + $this->_add_metabox($box); |
|
| 635 | + } else { |
|
| 636 | + $this->_remove_metabox($box); |
|
| 637 | + } |
|
| 638 | + } |
|
| 639 | + } |
|
| 640 | + } |
|
| 641 | + |
|
| 642 | + |
|
| 643 | + /** |
|
| 644 | + * Loop through the _remove_metaboxes property and remove metaboxes accordingly. |
|
| 645 | + * |
|
| 646 | + * @return void |
|
| 647 | + * @throws EE_Error |
|
| 648 | + */ |
|
| 649 | + public function remove_metaboxes() |
|
| 650 | + { |
|
| 651 | + if (empty($this->_remove_metaboxes)) { |
|
| 652 | + return; |
|
| 653 | + } //get out there are no metaboxes to remove |
|
| 654 | + $this->_handle_metabox_array($this->_remove_metaboxes, false); |
|
| 655 | + } |
|
| 656 | + |
|
| 657 | + |
|
| 658 | + /** |
|
| 659 | + * This just handles adding a metabox |
|
| 660 | + * |
|
| 661 | + * @param array $args an array of args that have been set for this metabox by the child class |
|
| 662 | + * @throws EE_Error |
|
| 663 | + */ |
|
| 664 | + private function _add_metabox(array $args) |
|
| 665 | + { |
|
| 666 | + $current_screen = get_current_screen(); |
|
| 667 | + $screen_id = is_object($current_screen) ? $current_screen->id : null; |
|
| 668 | + $callback = $args['func'] ?? 'some_invalid_callback'; |
|
| 669 | + $callback_function = is_array($callback) ? end($callback) : $callback; |
|
| 670 | + // set defaults |
|
| 671 | + $defaults = [ |
|
| 672 | + 'callback_args' => [], |
|
| 673 | + 'context' => 'advanced', |
|
| 674 | + 'func' => $callback, |
|
| 675 | + 'id' => $this->caller . '_' . $callback_function . '_metabox', |
|
| 676 | + 'label' => $this->caller, |
|
| 677 | + 'page' => $args['page'] ?? $screen_id, |
|
| 678 | + 'priority' => 'default', |
|
| 679 | + ]; |
|
| 680 | + $args = wp_parse_args($args, $defaults); |
|
| 681 | + $callback_args = $args['callback_args']; |
|
| 682 | + $context = $args['context']; |
|
| 683 | + $id = $args['id']; |
|
| 684 | + $label = $args['label']; |
|
| 685 | + $page = $args['page']; |
|
| 686 | + $priority = $args['priority']; |
|
| 687 | + // make sure method exists |
|
| 688 | + if (! method_exists($this, $callback_function)) { |
|
| 689 | + $msg[] = |
|
| 690 | + esc_html__('There is no corresponding method to display the metabox content', 'event_espresso') |
|
| 691 | + . '<br />'; |
|
| 692 | + $msg[] = sprintf( |
|
| 693 | + esc_html__( |
|
| 694 | + 'The method name given in the array is %s, check the spelling and make sure it exists in the %s class', |
|
| 695 | + 'event_espresso' |
|
| 696 | + ), |
|
| 697 | + $callback_function, |
|
| 698 | + $this->caller |
|
| 699 | + ); |
|
| 700 | + throw new EE_Error(implode('||', $msg)); |
|
| 701 | + } |
|
| 702 | + // everything checks out so let's add the metabox |
|
| 703 | + add_meta_box($id, $label, [$this, $callback_function], $page, $context, $priority, $callback_args); |
|
| 704 | + add_filter( |
|
| 705 | + "postbox_classes_{$page}_$id", |
|
| 706 | + function ($classes) { |
|
| 707 | + $classes[] = 'ee-admin-container'; |
|
| 708 | + return $classes; |
|
| 709 | + } |
|
| 710 | + ); |
|
| 711 | + } |
|
| 712 | + |
|
| 713 | + |
|
| 714 | + private function _remove_metabox($args) |
|
| 715 | + { |
|
| 716 | + $current_screen = get_current_screen(); |
|
| 717 | + $screen_id = is_object($current_screen) ? $current_screen->id : null; |
|
| 718 | + $func = $args['func'] ?? 'some_invalid_callback'; |
|
| 719 | + // set defaults |
|
| 720 | + $defaults = [ |
|
| 721 | + 'context' => 'default', |
|
| 722 | + 'id' => $args['id'] ?? "{$this->_current_route}_{$this->caller}_{$func}_metabox", |
|
| 723 | + 'screen' => $args['screen'] ?? $screen_id, |
|
| 724 | + ]; |
|
| 725 | + $args = wp_parse_args($args, $defaults); |
|
| 726 | + $context = $args['context']; |
|
| 727 | + $id = $args['id']; |
|
| 728 | + $screen = $args['screen']; |
|
| 729 | + // everything checks out so lets remove the box! |
|
| 730 | + remove_meta_box($id, $screen, $context); |
|
| 731 | + } |
|
| 732 | + |
|
| 733 | + /** |
|
| 734 | + * This is used whenever we're DOING_AJAX to return a formatted json array that our calling javascript can expect |
|
| 735 | + * The returned json object is created from an array in the following format: |
|
| 736 | + * array( |
|
| 737 | + * 'error' => FALSE, //(default FALSE), contains any errors and/or exceptions (exceptions return json early), |
|
| 738 | + * 'success' => FALSE, //(default FALSE) - contains any special success message. |
|
| 739 | + * 'notices' => '', // - contains any EE_Error formatted notices |
|
| 740 | + * 'content' => 'string can be html', //this is a string of formatted content (can be html) |
|
| 741 | + * 'data' => array() //this can be any key/value pairs that a method returns for later json parsing by the js. |
|
| 742 | + * We're also going to include the template args with every package (so js can pick out any specific template args |
|
| 743 | + * that might be included in here) |
|
| 744 | + * ) |
|
| 745 | + * The json object is populated by whatever is set in the $_template_args property. |
|
| 746 | + * |
|
| 747 | + * @param string $content |
|
| 748 | + * @param array $data |
|
| 749 | + */ |
|
| 750 | + public function returnJson(string $content = '', array $data = []): void |
|
| 751 | + { |
|
| 752 | + // make sure any EE_Error notices have been handled. |
|
| 753 | + $notices = EE_Error::get_notices(false); |
|
| 754 | + wp_send_json( |
|
| 755 | + [ |
|
| 756 | + 'success' => $notices['success'] ?? false, |
|
| 757 | + 'errors' => $notices['errors'] ?? false, |
|
| 758 | + 'attention' => $notices['attention'] ?? false, |
|
| 759 | + 'notices' => $notices, |
|
| 760 | + 'content' => $content, |
|
| 761 | + 'data' => $data, |
|
| 762 | + // special flag so any ajax.Success methods in js can identify this return package as a EEajax package. |
|
| 763 | + 'isEEajax' => true, |
|
| 764 | + ] |
|
| 765 | + ); |
|
| 766 | + } |
|
| 767 | 767 | } |