@@ -22,1370 +22,1370 @@ |
||
22 | 22 | class EED_Core_Rest_Api extends EED_Module |
23 | 23 | { |
24 | 24 | |
25 | - const ee_api_namespace = Domain::API_NAMESPACE; |
|
26 | - |
|
27 | - const ee_api_namespace_for_regex = 'ee\/v([^/]*)\/'; |
|
28 | - |
|
29 | - const saved_routes_option_names = 'ee_core_routes'; |
|
30 | - |
|
31 | - /** |
|
32 | - * string used in _links response bodies to make them globally unique. |
|
33 | - * |
|
34 | - * @see http://v2.wp-api.org/extending/linking/ |
|
35 | - */ |
|
36 | - const ee_api_link_namespace = 'https://api.eventespresso.com/'; |
|
37 | - |
|
38 | - /** |
|
39 | - * @var CalculatedModelFields |
|
40 | - */ |
|
41 | - protected static $_field_calculator; |
|
42 | - |
|
43 | - |
|
44 | - /** |
|
45 | - * @return EED_Core_Rest_Api|EED_Module |
|
46 | - */ |
|
47 | - public static function instance() |
|
48 | - { |
|
49 | - return parent::get_instance(EED_Core_Rest_Api::class); |
|
50 | - } |
|
51 | - |
|
52 | - |
|
53 | - /** |
|
54 | - * set_hooks - for hooking into EE Core, other modules, etc |
|
55 | - * |
|
56 | - * @access public |
|
57 | - * @return void |
|
58 | - */ |
|
59 | - public static function set_hooks() |
|
60 | - { |
|
61 | - } |
|
62 | - |
|
63 | - |
|
64 | - /** |
|
65 | - * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
66 | - * |
|
67 | - * @access public |
|
68 | - * @return void |
|
69 | - */ |
|
70 | - public static function set_hooks_admin() |
|
71 | - { |
|
72 | - } |
|
73 | - |
|
74 | - |
|
75 | - public static function set_hooks_both() |
|
76 | - { |
|
77 | - add_action('rest_api_init', ['EED_Core_Rest_Api', 'set_hooks_rest_api'], 5); |
|
78 | - add_action('rest_api_init', ['EED_Core_Rest_Api', 'register_routes'], 10); |
|
79 | - add_filter('rest_route_data', ['EED_Core_Rest_Api', 'hide_old_endpoints'], 10, 2); |
|
80 | - add_filter( |
|
81 | - 'rest_index', |
|
82 | - ['EventEspresso\core\libraries\rest_api\controllers\model\Meta', 'filterEeMetadataIntoIndex'] |
|
83 | - ); |
|
84 | - } |
|
85 | - |
|
86 | - |
|
87 | - /** |
|
88 | - * @since $VID:$ |
|
89 | - */ |
|
90 | - public static function loadCalculatedModelFields() |
|
91 | - { |
|
92 | - EED_Core_Rest_Api::$_field_calculator = LoaderFactory::getLoader()->load( |
|
93 | - 'EventEspresso\core\libraries\rest_api\CalculatedModelFields' |
|
94 | - ); |
|
95 | - EED_Core_Rest_Api::invalidate_cached_route_data_on_version_change(); |
|
96 | - } |
|
97 | - |
|
98 | - |
|
99 | - /** |
|
100 | - * sets up hooks which only need to be included as part of REST API requests; |
|
101 | - * other requests like to the frontend or admin etc don't need them |
|
102 | - * |
|
103 | - * @throws EE_Error |
|
104 | - */ |
|
105 | - public static function set_hooks_rest_api() |
|
106 | - { |
|
107 | - // set hooks which account for changes made to the API |
|
108 | - EED_Core_Rest_Api::_set_hooks_for_changes(); |
|
109 | - } |
|
110 | - |
|
111 | - |
|
112 | - /** |
|
113 | - * public wrapper of _set_hooks_for_changes. |
|
114 | - * Loads all the hooks which make requests to old versions of the API |
|
115 | - * appear the same as they always did |
|
116 | - * |
|
117 | - * @throws EE_Error |
|
118 | - */ |
|
119 | - public static function set_hooks_for_changes() |
|
120 | - { |
|
121 | - EED_Core_Rest_Api::_set_hooks_for_changes(); |
|
122 | - } |
|
123 | - |
|
124 | - |
|
125 | - /** |
|
126 | - * Loads all the hooks which make requests to old versions of the API |
|
127 | - * appear the same as they always did |
|
128 | - * |
|
129 | - * @throws EE_Error |
|
130 | - */ |
|
131 | - protected static function _set_hooks_for_changes() |
|
132 | - { |
|
133 | - $folder_contents = EEH_File::get_contents_of_folders([EE_LIBRARIES . 'rest_api/changes'], false); |
|
134 | - foreach ($folder_contents as $classname_in_namespace => $filepath) { |
|
135 | - // ignore the base parent class |
|
136 | - // and legacy named classes |
|
137 | - if ($classname_in_namespace === 'ChangesInBase' |
|
138 | - || strpos($classname_in_namespace, 'Changes_In_') === 0 |
|
139 | - ) { |
|
140 | - continue; |
|
141 | - } |
|
142 | - $full_classname = 'EventEspresso\core\libraries\rest_api\changes\\' . $classname_in_namespace; |
|
143 | - if (class_exists($full_classname)) { |
|
144 | - $instance_of_class = new $full_classname; |
|
145 | - if ($instance_of_class instanceof ChangesInBase) { |
|
146 | - $instance_of_class->setHooks(); |
|
147 | - } |
|
148 | - } |
|
149 | - } |
|
150 | - } |
|
151 | - |
|
152 | - |
|
153 | - /** |
|
154 | - * Filters the WP routes to add our EE-related ones. This takes a bit of time |
|
155 | - * so we actually prefer to only do it when an EE plugin is activated or upgraded |
|
156 | - * |
|
157 | - * @throws EE_Error |
|
158 | - * @throws ReflectionException |
|
159 | - */ |
|
160 | - public static function register_routes() |
|
161 | - { |
|
162 | - foreach (EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_routes) { |
|
163 | - foreach ($relative_routes as $relative_route => $data_for_multiple_endpoints) { |
|
164 | - /** |
|
165 | - * @var array $data_for_multiple_endpoints numerically indexed array |
|
166 | - * but can also contain route options like { |
|
167 | - * @type array $schema { |
|
168 | - * @type callable $schema_callback |
|
169 | - * @type array $callback_args arguments that will be passed to the callback, after the |
|
170 | - * WP_REST_Request of course |
|
171 | - * } |
|
172 | - * } |
|
173 | - */ |
|
174 | - // when registering routes, register all the endpoints' data at the same time |
|
175 | - $multiple_endpoint_args = []; |
|
176 | - foreach ($data_for_multiple_endpoints as $endpoint_key => $data_for_single_endpoint) { |
|
177 | - /** |
|
178 | - * @var array $data_for_single_endpoint { |
|
179 | - * @type callable $callback |
|
180 | - * @type string methods |
|
181 | - * @type array args |
|
182 | - * @type array _links |
|
183 | - * @type array $callback_args arguments that will be passed to the callback, after the |
|
184 | - * WP_REST_Request of course |
|
185 | - * } |
|
186 | - */ |
|
187 | - // skip route options |
|
188 | - if (! is_numeric($endpoint_key)) { |
|
189 | - continue; |
|
190 | - } |
|
191 | - if (! isset($data_for_single_endpoint['callback'], $data_for_single_endpoint['methods'])) { |
|
192 | - throw new EE_Error( |
|
193 | - esc_html__( |
|
194 | - // @codingStandardsIgnoreStart |
|
195 | - 'Endpoint configuration data needs to have entries "callback" (callable) and "methods" (comma-separated list of accepts HTTP methods).', |
|
196 | - // @codingStandardsIgnoreEnd |
|
197 | - 'event_espresso' |
|
198 | - ) |
|
199 | - ); |
|
200 | - } |
|
201 | - $callback = $data_for_single_endpoint['callback']; |
|
202 | - $single_endpoint_args = [ |
|
203 | - 'methods' => $data_for_single_endpoint['methods'], |
|
204 | - 'args' => isset($data_for_single_endpoint['args']) ? $data_for_single_endpoint['args'] |
|
205 | - : [], |
|
206 | - ]; |
|
207 | - if (isset($data_for_single_endpoint['_links'])) { |
|
208 | - $single_endpoint_args['_links'] = $data_for_single_endpoint['_links']; |
|
209 | - } |
|
210 | - if (isset($data_for_single_endpoint['callback_args'])) { |
|
211 | - $callback_args = $data_for_single_endpoint['callback_args']; |
|
212 | - $single_endpoint_args['callback'] = static function (WP_REST_Request $request) use ( |
|
213 | - $callback, |
|
214 | - $callback_args |
|
215 | - ) { |
|
216 | - array_unshift($callback_args, $request); |
|
217 | - return call_user_func_array( |
|
218 | - $callback, |
|
219 | - $callback_args |
|
220 | - ); |
|
221 | - }; |
|
222 | - } else { |
|
223 | - $single_endpoint_args['callback'] = $data_for_single_endpoint['callback']; |
|
224 | - } |
|
225 | - // As of WordPress 5.5, if a permission_callback is not provided, |
|
226 | - // the REST API will issue a _doing_it_wrong notice. |
|
227 | - // Since the EE REST API defers capabilities to the db model system, |
|
228 | - // we will just use the generic WP callback for public endpoints |
|
229 | - if (! isset($single_endpoint_args['permission_callback'])) { |
|
230 | - $single_endpoint_args['permission_callback'] = '__return_true'; |
|
231 | - } |
|
232 | - $multiple_endpoint_args[] = $single_endpoint_args; |
|
233 | - } |
|
234 | - if (isset($data_for_multiple_endpoints['schema'])) { |
|
235 | - $schema_route_data = $data_for_multiple_endpoints['schema']; |
|
236 | - $schema_callback = $schema_route_data['schema_callback']; |
|
237 | - $callback_args = $schema_route_data['callback_args']; |
|
238 | - $multiple_endpoint_args['schema'] = static function () use ($schema_callback, $callback_args) { |
|
239 | - return call_user_func_array( |
|
240 | - $schema_callback, |
|
241 | - $callback_args |
|
242 | - ); |
|
243 | - }; |
|
244 | - } |
|
245 | - register_rest_route( |
|
246 | - $namespace, |
|
247 | - $relative_route, |
|
248 | - $multiple_endpoint_args |
|
249 | - ); |
|
250 | - } |
|
251 | - } |
|
252 | - } |
|
253 | - |
|
254 | - |
|
255 | - /** |
|
256 | - * Checks if there was a version change or something that merits invalidating the cached |
|
257 | - * route data. If so, invalidates the cached route data so that it gets refreshed |
|
258 | - * next time the WP API is used |
|
259 | - */ |
|
260 | - public static function invalidate_cached_route_data_on_version_change() |
|
261 | - { |
|
262 | - if (EE_System::instance()->detect_req_type() !== EE_System::req_type_normal) { |
|
263 | - EED_Core_Rest_Api::invalidate_cached_route_data(); |
|
264 | - } |
|
265 | - foreach (EE_Registry::instance()->addons as $addon) { |
|
266 | - if ($addon instanceof EE_Addon && $addon->detect_req_type() !== EE_System::req_type_normal) { |
|
267 | - EED_Core_Rest_Api::invalidate_cached_route_data(); |
|
268 | - } |
|
269 | - } |
|
270 | - } |
|
271 | - |
|
272 | - |
|
273 | - /** |
|
274 | - * Removes the cached route data so it will get refreshed next time the WP API is used |
|
275 | - */ |
|
276 | - public static function invalidate_cached_route_data() |
|
277 | - { |
|
278 | - // delete the saved EE REST API routes |
|
279 | - foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden) { |
|
280 | - delete_option(EED_Core_Rest_Api::saved_routes_option_names . $version); |
|
281 | - } |
|
282 | - } |
|
283 | - |
|
284 | - |
|
285 | - /** |
|
286 | - * Gets the EE route data |
|
287 | - * |
|
288 | - * @return array top-level key is the namespace, next-level key is the route and its value is array{ |
|
289 | - * @throws EE_Error |
|
290 | - * @throws ReflectionException |
|
291 | - * @type string|array $callback |
|
292 | - * @type string $methods |
|
293 | - * @type boolean $hidden_endpoint |
|
294 | - * } |
|
295 | - */ |
|
296 | - public static function get_ee_route_data() |
|
297 | - { |
|
298 | - $ee_routes = []; |
|
299 | - foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoints) { |
|
300 | - $ee_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = EED_Core_Rest_Api::_get_ee_route_data_for_version( |
|
301 | - $version, |
|
302 | - $hidden_endpoints |
|
303 | - ); |
|
304 | - } |
|
305 | - return $ee_routes; |
|
306 | - } |
|
307 | - |
|
308 | - |
|
309 | - /** |
|
310 | - * Gets the EE route data from the wp options if it exists already, |
|
311 | - * otherwise re-generates it and saves it to the option |
|
312 | - * |
|
313 | - * @param string $version |
|
314 | - * @param boolean $hidden_endpoints |
|
315 | - * @return array |
|
316 | - * @throws EE_Error |
|
317 | - * @throws ReflectionException |
|
318 | - */ |
|
319 | - protected static function _get_ee_route_data_for_version($version, $hidden_endpoints = false) |
|
320 | - { |
|
321 | - $ee_routes = get_option(EED_Core_Rest_Api::saved_routes_option_names . $version, null); |
|
322 | - if (! $ee_routes || EED_Core_Rest_Api::debugMode()) { |
|
323 | - $ee_routes = EED_Core_Rest_Api::_save_ee_route_data_for_version($version, $hidden_endpoints); |
|
324 | - } |
|
325 | - return $ee_routes; |
|
326 | - } |
|
327 | - |
|
328 | - |
|
329 | - /** |
|
330 | - * Saves the EE REST API route data to a wp option and returns it |
|
331 | - * |
|
332 | - * @param string $version |
|
333 | - * @param boolean $hidden_endpoints |
|
334 | - * @return mixed|null |
|
335 | - * @throws EE_Error |
|
336 | - * @throws ReflectionException |
|
337 | - */ |
|
338 | - protected static function _save_ee_route_data_for_version($version, $hidden_endpoints = false) |
|
339 | - { |
|
340 | - $instance = EED_Core_Rest_Api::instance(); |
|
341 | - $routes = apply_filters( |
|
342 | - 'EED_Core_Rest_Api__save_ee_route_data_for_version__routes', |
|
343 | - array_replace_recursive( |
|
344 | - $instance->_get_config_route_data_for_version($version, $hidden_endpoints), |
|
345 | - $instance->_get_meta_route_data_for_version($version, $hidden_endpoints), |
|
346 | - $instance->_get_model_route_data_for_version($version, $hidden_endpoints), |
|
347 | - $instance->_get_rpc_route_data_for_version($version, $hidden_endpoints) |
|
348 | - ) |
|
349 | - ); |
|
350 | - $option_name = EED_Core_Rest_Api::saved_routes_option_names . $version; |
|
351 | - if (get_option($option_name)) { |
|
352 | - update_option($option_name, $routes, true); |
|
353 | - } else { |
|
354 | - add_option($option_name, $routes, null, 'no'); |
|
355 | - } |
|
356 | - return $routes; |
|
357 | - } |
|
358 | - |
|
359 | - |
|
360 | - /** |
|
361 | - * Calculates all the EE routes and saves it to a WordPress option so we don't |
|
362 | - * need to calculate it on every request |
|
363 | - * |
|
364 | - * @return void |
|
365 | - * @deprecated since version 4.9.1 |
|
366 | - */ |
|
367 | - public static function save_ee_routes() |
|
368 | - { |
|
369 | - if (EE_Maintenance_Mode::instance()->models_can_query()) { |
|
370 | - $instance = EED_Core_Rest_Api::instance(); |
|
371 | - $routes = apply_filters( |
|
372 | - 'EED_Core_Rest_Api__save_ee_routes__routes', |
|
373 | - array_replace_recursive( |
|
374 | - $instance->_register_config_routes(), |
|
375 | - $instance->_register_meta_routes(), |
|
376 | - $instance->_register_model_routes(), |
|
377 | - $instance->_register_rpc_routes() |
|
378 | - ) |
|
379 | - ); |
|
380 | - update_option(EED_Core_Rest_Api::saved_routes_option_names, $routes, true); |
|
381 | - } |
|
382 | - } |
|
383 | - |
|
384 | - |
|
385 | - /** |
|
386 | - * Gets all the route information relating to EE models |
|
387 | - * |
|
388 | - * @return array @see get_ee_route_data |
|
389 | - * @deprecated since version 4.9.1 |
|
390 | - */ |
|
391 | - protected function _register_model_routes() |
|
392 | - { |
|
393 | - $model_routes = []; |
|
394 | - foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
395 | - $model_routes[ EED_Core_Rest_Api::ee_api_namespace |
|
396 | - . $version ] = $this->_get_config_route_data_for_version($version, $hidden_endpoint); |
|
397 | - } |
|
398 | - return $model_routes; |
|
399 | - } |
|
400 | - |
|
401 | - |
|
402 | - /** |
|
403 | - * Decides whether or not to add write endpoints for this model. |
|
404 | - * Currently, this defaults to exclude all global tables and models |
|
405 | - * which would allow inserting WP core data (we don't want to duplicate |
|
406 | - * what WP API does, as it's unnecessary, extra work, and potentially extra bugs) |
|
407 | - * |
|
408 | - * @param EEM_Base $model |
|
409 | - * @return bool |
|
410 | - */ |
|
411 | - public static function should_have_write_endpoints(EEM_Base $model) |
|
412 | - { |
|
413 | - if ($model->is_wp_core_model()) { |
|
414 | - return false; |
|
415 | - } |
|
416 | - foreach ($model->get_tables() as $table) { |
|
417 | - if ($table->is_global()) { |
|
418 | - return false; |
|
419 | - } |
|
420 | - } |
|
421 | - return true; |
|
422 | - } |
|
423 | - |
|
424 | - |
|
425 | - /** |
|
426 | - * Gets the names of all models which should have plural routes (eg `ee/v4.8.36/events`) |
|
427 | - * in this versioned namespace of EE4 |
|
428 | - * |
|
429 | - * @param $version |
|
430 | - * @return array keys are model names (eg 'Event') and values ar either classnames (eg 'EEM_Event') |
|
431 | - */ |
|
432 | - public static function model_names_with_plural_routes($version) |
|
433 | - { |
|
434 | - $model_version_info = new ModelVersionInfo($version); |
|
435 | - $models_to_register = $model_version_info->modelsForRequestedVersion(); |
|
436 | - // let's not bother having endpoints for extra metas |
|
437 | - unset( |
|
438 | - $models_to_register['Extra_Meta'], |
|
439 | - $models_to_register['Extra_Join'], |
|
440 | - $models_to_register['Post_Meta'] |
|
441 | - ); |
|
442 | - return apply_filters( |
|
443 | - 'FHEE__EED_Core_REST_API___register_model_routes', |
|
444 | - $models_to_register |
|
445 | - ); |
|
446 | - } |
|
447 | - |
|
448 | - |
|
449 | - /** |
|
450 | - * Gets the route data for EE models in the specified version |
|
451 | - * |
|
452 | - * @param string $version |
|
453 | - * @param boolean $hidden_endpoint |
|
454 | - * @return array |
|
455 | - * @throws EE_Error |
|
456 | - * @throws ReflectionException |
|
457 | - */ |
|
458 | - protected function _get_model_route_data_for_version($version, $hidden_endpoint = false) |
|
459 | - { |
|
460 | - $model_routes = []; |
|
461 | - $model_version_info = new ModelVersionInfo($version); |
|
462 | - foreach (EED_Core_Rest_Api::model_names_with_plural_routes($version) as $model_name => $model_classname) { |
|
463 | - $model = EE_Registry::instance()->load_model($model_name); |
|
464 | - // if this isn't a valid model then let's skip iterate to the next item in the loop. |
|
465 | - if (! $model instanceof EEM_Base) { |
|
466 | - continue; |
|
467 | - } |
|
468 | - // yes we could just register one route for ALL models, but then they wouldn't show up in the index |
|
469 | - $plural_model_route = EED_Core_Rest_Api::get_collection_route($model); |
|
470 | - $singular_model_route = EED_Core_Rest_Api::get_entity_route($model, '(?P<id>[^\/]+)'); |
|
471 | - $model_routes[ $plural_model_route ] = [ |
|
472 | - [ |
|
473 | - 'callback' => [ |
|
474 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
475 | - 'handleRequestGetAll', |
|
476 | - ], |
|
477 | - 'callback_args' => [$version, $model_name], |
|
478 | - 'methods' => WP_REST_Server::READABLE, |
|
479 | - 'hidden_endpoint' => $hidden_endpoint, |
|
480 | - 'args' => $this->_get_read_query_params($model, $version), |
|
481 | - '_links' => [ |
|
482 | - 'self' => rest_url(EED_Core_Rest_Api::ee_api_namespace . $version . $singular_model_route), |
|
483 | - ], |
|
484 | - ], |
|
485 | - 'schema' => [ |
|
486 | - 'schema_callback' => [ |
|
487 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
488 | - 'handleSchemaRequest', |
|
489 | - ], |
|
490 | - 'callback_args' => [$version, $model_name], |
|
491 | - ], |
|
492 | - ]; |
|
493 | - $model_routes[ $singular_model_route ] = [ |
|
494 | - [ |
|
495 | - 'callback' => [ |
|
496 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
497 | - 'handleRequestGetOne', |
|
498 | - ], |
|
499 | - 'callback_args' => [$version, $model_name], |
|
500 | - 'methods' => WP_REST_Server::READABLE, |
|
501 | - 'hidden_endpoint' => $hidden_endpoint, |
|
502 | - 'args' => $this->_get_response_selection_query_params($model, $version, true), |
|
503 | - ], |
|
504 | - ]; |
|
505 | - if (apply_filters( |
|
506 | - 'FHEE__EED_Core_Rest_Api___get_model_route_data_for_version__add_write_endpoints', |
|
507 | - EED_Core_Rest_Api::should_have_write_endpoints($model), |
|
508 | - $model |
|
509 | - )) { |
|
510 | - $model_routes[ $plural_model_route ][] = [ |
|
511 | - 'callback' => [ |
|
512 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
513 | - 'handleRequestInsert', |
|
514 | - ], |
|
515 | - 'callback_args' => [$version, $model_name], |
|
516 | - 'methods' => WP_REST_Server::CREATABLE, |
|
517 | - 'hidden_endpoint' => $hidden_endpoint, |
|
518 | - 'args' => $this->_get_write_params($model_name, $model_version_info, true), |
|
519 | - ]; |
|
520 | - $model_routes[ $singular_model_route ] = array_merge( |
|
521 | - $model_routes[ $singular_model_route ], |
|
522 | - [ |
|
523 | - [ |
|
524 | - 'callback' => [ |
|
525 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
526 | - 'handleRequestUpdate', |
|
527 | - ], |
|
528 | - 'callback_args' => [$version, $model_name], |
|
529 | - 'methods' => WP_REST_Server::EDITABLE, |
|
530 | - 'hidden_endpoint' => $hidden_endpoint, |
|
531 | - 'args' => $this->_get_write_params($model_name, $model_version_info), |
|
532 | - ], |
|
533 | - [ |
|
534 | - 'callback' => [ |
|
535 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
536 | - 'handleRequestDelete', |
|
537 | - ], |
|
538 | - 'callback_args' => [$version, $model_name], |
|
539 | - 'methods' => WP_REST_Server::DELETABLE, |
|
540 | - 'hidden_endpoint' => $hidden_endpoint, |
|
541 | - 'args' => $this->_get_delete_query_params($model, $version), |
|
542 | - ], |
|
543 | - ] |
|
544 | - ); |
|
545 | - } |
|
546 | - foreach ($model->relation_settings() as $relation_name => $relation_obj) { |
|
547 | - $related_route = EED_Core_Rest_Api::get_relation_route_via( |
|
548 | - $model, |
|
549 | - '(?P<id>[^\/]+)', |
|
550 | - $relation_obj |
|
551 | - ); |
|
552 | - $model_routes[ $related_route ] = [ |
|
553 | - [ |
|
554 | - 'callback' => [ |
|
555 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
556 | - 'handleRequestGetRelated', |
|
557 | - ], |
|
558 | - 'callback_args' => [$version, $model_name, $relation_name], |
|
559 | - 'methods' => WP_REST_Server::READABLE, |
|
560 | - 'hidden_endpoint' => $hidden_endpoint, |
|
561 | - 'args' => $this->_get_read_query_params($relation_obj->get_other_model(), $version), |
|
562 | - ], |
|
563 | - ]; |
|
564 | - |
|
565 | - $related_write_route = $related_route . '/' . '(?P<related_id>[^\/]+)'; |
|
566 | - $model_routes[ $related_write_route ] = [ |
|
567 | - [ |
|
568 | - 'callback' => [ |
|
569 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
570 | - 'handleRequestAddRelation', |
|
571 | - ], |
|
572 | - 'callback_args' => [$version, $model_name, $relation_name], |
|
573 | - 'methods' => WP_REST_Server::EDITABLE, |
|
574 | - 'hidden_endpoint' => $hidden_endpoint, |
|
575 | - 'args' => $this->_get_add_relation_query_params( |
|
576 | - $model, |
|
577 | - $relation_obj->get_other_model(), |
|
578 | - $version |
|
579 | - ), |
|
580 | - ], |
|
581 | - [ |
|
582 | - 'callback' => [ |
|
583 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
584 | - 'handleRequestRemoveRelation', |
|
585 | - ], |
|
586 | - 'callback_args' => [$version, $model_name, $relation_name], |
|
587 | - 'methods' => WP_REST_Server::DELETABLE, |
|
588 | - 'hidden_endpoint' => $hidden_endpoint, |
|
589 | - 'args' => [], |
|
590 | - ], |
|
591 | - ]; |
|
592 | - } |
|
593 | - } |
|
594 | - return $model_routes; |
|
595 | - } |
|
596 | - |
|
597 | - |
|
598 | - /** |
|
599 | - * Gets the relative URI to a model's REST API plural route, after the EE4 versioned namespace, |
|
600 | - * excluding the preceding slash. |
|
601 | - * Eg you pass get_plural_route_to('Event') = 'events' |
|
602 | - * |
|
603 | - * @param EEM_Base $model |
|
604 | - * @return string |
|
605 | - */ |
|
606 | - public static function get_collection_route(EEM_Base $model) |
|
607 | - { |
|
608 | - return EEH_Inflector::pluralize_and_lower($model->get_this_model_name()); |
|
609 | - } |
|
610 | - |
|
611 | - |
|
612 | - /** |
|
613 | - * Gets the relative URI to a model's REST API singular route, after the EE4 versioned namespace, |
|
614 | - * excluding the preceding slash. |
|
615 | - * Eg you pass get_plural_route_to('Event', 12) = 'events/12' |
|
616 | - * |
|
617 | - * @param EEM_Base $model eg Event or Venue |
|
618 | - * @param string $id |
|
619 | - * @return string |
|
620 | - */ |
|
621 | - public static function get_entity_route($model, $id) |
|
622 | - { |
|
623 | - return EED_Core_Rest_Api::get_collection_route($model) . '/' . $id; |
|
624 | - } |
|
625 | - |
|
626 | - |
|
627 | - /** |
|
628 | - * Gets the relative URI to a model's REST API singular route, after the EE4 versioned namespace, |
|
629 | - * excluding the preceding slash. |
|
630 | - * Eg you pass get_plural_route_to('Event', 12) = 'events/12' |
|
631 | - * |
|
632 | - * @param EEM_Base $model eg Event or Venue |
|
633 | - * @param string $id |
|
634 | - * @param EE_Model_Relation_Base $relation_obj |
|
635 | - * @return string |
|
636 | - */ |
|
637 | - public static function get_relation_route_via(EEM_Base $model, $id, EE_Model_Relation_Base $relation_obj) |
|
638 | - { |
|
639 | - $related_model_name_endpoint_part = ModelRead::getRelatedEntityName( |
|
640 | - $relation_obj->get_other_model()->get_this_model_name(), |
|
641 | - $relation_obj |
|
642 | - ); |
|
643 | - return EED_Core_Rest_Api::get_entity_route($model, $id) . '/' . $related_model_name_endpoint_part; |
|
644 | - } |
|
645 | - |
|
646 | - |
|
647 | - /** |
|
648 | - * Adds onto the $relative_route the EE4 REST API versioned namespace. |
|
649 | - * Eg if given '4.8.36' and 'events', will return 'ee/v4.8.36/events' |
|
650 | - * |
|
651 | - * @param string $relative_route |
|
652 | - * @param string $version |
|
653 | - * @return string |
|
654 | - */ |
|
655 | - public static function get_versioned_route_to($relative_route, $version = '4.8.36') |
|
656 | - { |
|
657 | - return '/' . EED_Core_Rest_Api::ee_api_namespace . $version . '/' . $relative_route; |
|
658 | - } |
|
659 | - |
|
660 | - |
|
661 | - /** |
|
662 | - * Adds all the RPC-style routes (remote procedure call-like routes, ie |
|
663 | - * routes that don't conform to the traditional REST CRUD-style). |
|
664 | - * |
|
665 | - * @deprecated since 4.9.1 |
|
666 | - */ |
|
667 | - protected function _register_rpc_routes() |
|
668 | - { |
|
669 | - $routes = []; |
|
670 | - foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
671 | - $routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_rpc_route_data_for_version( |
|
672 | - $version, |
|
673 | - $hidden_endpoint |
|
674 | - ); |
|
675 | - } |
|
676 | - return $routes; |
|
677 | - } |
|
678 | - |
|
679 | - |
|
680 | - /** |
|
681 | - * @param string $version |
|
682 | - * @param boolean $hidden_endpoint |
|
683 | - * @return array |
|
684 | - */ |
|
685 | - protected function _get_rpc_route_data_for_version($version, $hidden_endpoint = false) |
|
686 | - { |
|
687 | - $this_versions_routes = []; |
|
688 | - // checkin endpoint |
|
689 | - $this_versions_routes['registrations/(?P<REG_ID>\d+)/toggle_checkin_for_datetime/(?P<DTT_ID>\d+)'] = [ |
|
690 | - [ |
|
691 | - 'callback' => [ |
|
692 | - 'EventEspresso\core\libraries\rest_api\controllers\rpc\Checkin', |
|
693 | - 'handleRequestToggleCheckin', |
|
694 | - ], |
|
695 | - 'methods' => WP_REST_Server::CREATABLE, |
|
696 | - 'hidden_endpoint' => $hidden_endpoint, |
|
697 | - 'args' => [ |
|
698 | - 'force' => [ |
|
699 | - 'required' => false, |
|
700 | - 'default' => false, |
|
701 | - 'description' => __( |
|
702 | - // @codingStandardsIgnoreStart |
|
703 | - 'Whether to force toggle checkin, or to verify the registration status and allowed ticket uses', |
|
704 | - // @codingStandardsIgnoreEnd |
|
705 | - 'event_espresso' |
|
706 | - ), |
|
707 | - ], |
|
708 | - ], |
|
709 | - 'callback_args' => [$version], |
|
710 | - ], |
|
711 | - ]; |
|
712 | - return apply_filters( |
|
713 | - 'FHEE__EED_Core_Rest_Api___register_rpc_routes__this_versions_routes', |
|
714 | - $this_versions_routes, |
|
715 | - $version, |
|
716 | - $hidden_endpoint |
|
717 | - ); |
|
718 | - } |
|
719 | - |
|
720 | - |
|
721 | - /** |
|
722 | - * Gets the query params that can be used when request one or many |
|
723 | - * |
|
724 | - * @param EEM_Base $model |
|
725 | - * @param string $version |
|
726 | - * @return array |
|
727 | - */ |
|
728 | - protected function _get_response_selection_query_params(EEM_Base $model, $version, $single_only = false) |
|
729 | - { |
|
730 | - EED_Core_Rest_Api::loadCalculatedModelFields(); |
|
731 | - $query_params = [ |
|
732 | - 'include' => [ |
|
733 | - 'required' => false, |
|
734 | - 'default' => '*', |
|
735 | - 'type' => 'string', |
|
736 | - ], |
|
737 | - 'calculate' => [ |
|
738 | - 'required' => false, |
|
739 | - 'default' => '', |
|
740 | - 'enum' => EED_Core_Rest_Api::$_field_calculator->retrieveCalculatedFieldsForModel($model), |
|
741 | - 'type' => 'string', |
|
742 | - // because we accept a CSV list of the enumerated strings, WP core validation and sanitization |
|
743 | - // freaks out. We'll just validate this argument while handling the request |
|
744 | - 'validate_callback' => null, |
|
745 | - 'sanitize_callback' => null, |
|
746 | - ], |
|
747 | - 'password' => [ |
|
748 | - 'required' => false, |
|
749 | - 'default' => '', |
|
750 | - 'type' => 'string', |
|
751 | - ], |
|
752 | - ]; |
|
753 | - return apply_filters( |
|
754 | - 'FHEE__EED_Core_Rest_Api___get_response_selection_query_params', |
|
755 | - $query_params, |
|
756 | - $model, |
|
757 | - $version |
|
758 | - ); |
|
759 | - } |
|
760 | - |
|
761 | - |
|
762 | - /** |
|
763 | - * Gets the parameters acceptable for delete requests |
|
764 | - * |
|
765 | - * @param EEM_Base $model |
|
766 | - * @param string $version |
|
767 | - * @return array |
|
768 | - */ |
|
769 | - protected function _get_delete_query_params(EEM_Base $model, $version) |
|
770 | - { |
|
771 | - $params_for_delete = [ |
|
772 | - 'allow_blocking' => [ |
|
773 | - 'required' => false, |
|
774 | - 'default' => true, |
|
775 | - 'type' => 'boolean', |
|
776 | - ], |
|
777 | - ]; |
|
778 | - $params_for_delete['force'] = [ |
|
779 | - 'required' => false, |
|
780 | - 'default' => false, |
|
781 | - 'type' => 'boolean', |
|
782 | - ]; |
|
783 | - return apply_filters( |
|
784 | - 'FHEE__EED_Core_Rest_Api___get_delete_query_params', |
|
785 | - $params_for_delete, |
|
786 | - $model, |
|
787 | - $version |
|
788 | - ); |
|
789 | - } |
|
790 | - |
|
791 | - |
|
792 | - /** |
|
793 | - * @param EEM_Base $source_model |
|
794 | - * @param EEM_Base $related_model |
|
795 | - * @param $version |
|
796 | - * @return array |
|
797 | - * @throws EE_Error |
|
798 | - * @since $VID:$ |
|
799 | - */ |
|
800 | - protected function _get_add_relation_query_params(EEM_Base $source_model, EEM_Base $related_model, $version) |
|
801 | - { |
|
802 | - // if they're related through a HABTM relation, check for any non-FKs |
|
803 | - $all_relation_settings = $source_model->relation_settings(); |
|
804 | - $relation_settings = $all_relation_settings[ $related_model->get_this_model_name() ]; |
|
805 | - $params = []; |
|
806 | - if ($relation_settings instanceof EE_HABTM_Relation && $relation_settings->hasNonKeyFields()) { |
|
807 | - foreach ($relation_settings->getNonKeyFields() as $field) { |
|
808 | - /* @var $field EE_Model_Field_Base */ |
|
809 | - $params[ $field->get_name() ] = [ |
|
810 | - 'required' => ! $field->is_nullable(), |
|
811 | - 'default' => ModelDataTranslator::prepareFieldValueForJson( |
|
812 | - $field, |
|
813 | - $field->get_default_value(), |
|
814 | - $version |
|
815 | - ), |
|
816 | - 'type' => $field->getSchemaType(), |
|
817 | - 'validate_callback' => null, |
|
818 | - 'sanitize_callback' => null, |
|
819 | - ]; |
|
820 | - } |
|
821 | - } |
|
822 | - return $params; |
|
823 | - } |
|
824 | - |
|
825 | - |
|
826 | - /** |
|
827 | - * Gets info about reading query params that are acceptable |
|
828 | - * |
|
829 | - * @param EEM_Base $model eg 'Event' or 'Venue' |
|
830 | - * @param string $version |
|
831 | - * @return array describing the args acceptable when querying this model |
|
832 | - * @throws EE_Error |
|
833 | - */ |
|
834 | - protected function _get_read_query_params(EEM_Base $model, $version) |
|
835 | - { |
|
836 | - $default_orderby = []; |
|
837 | - foreach ($model->get_combined_primary_key_fields() as $key_field) { |
|
838 | - $default_orderby[ $key_field->get_name() ] = 'ASC'; |
|
839 | - } |
|
840 | - return array_merge( |
|
841 | - $this->_get_response_selection_query_params($model, $version), |
|
842 | - [ |
|
843 | - 'where' => [ |
|
844 | - 'required' => false, |
|
845 | - 'default' => [], |
|
846 | - 'type' => 'object', |
|
847 | - // because we accept an almost infinite list of possible where conditions, WP |
|
848 | - // core validation and sanitization freaks out. We'll just validate this argument |
|
849 | - // while handling the request |
|
850 | - 'validate_callback' => null, |
|
851 | - 'sanitize_callback' => null, |
|
852 | - ], |
|
853 | - 'limit' => [ |
|
854 | - 'required' => false, |
|
855 | - 'default' => EED_Core_Rest_Api::get_default_query_limit(), |
|
856 | - 'type' => [ |
|
857 | - 'array', |
|
858 | - 'string', |
|
859 | - 'integer', |
|
860 | - ], |
|
861 | - // because we accept a variety of types, WP core validation and sanitization |
|
862 | - // freaks out. We'll just validate this argument while handling the request |
|
863 | - 'validate_callback' => null, |
|
864 | - 'sanitize_callback' => null, |
|
865 | - ], |
|
866 | - 'order_by' => [ |
|
867 | - 'required' => false, |
|
868 | - 'default' => $default_orderby, |
|
869 | - 'type' => [ |
|
870 | - 'object', |
|
871 | - 'string', |
|
872 | - ],// because we accept a variety of types, WP core validation and sanitization |
|
873 | - // freaks out. We'll just validate this argument while handling the request |
|
874 | - 'validate_callback' => null, |
|
875 | - 'sanitize_callback' => null, |
|
876 | - ], |
|
877 | - 'group_by' => [ |
|
878 | - 'required' => false, |
|
879 | - 'default' => null, |
|
880 | - 'type' => [ |
|
881 | - 'object', |
|
882 | - 'string', |
|
883 | - ], |
|
884 | - // because we accept an almost infinite list of possible groupings, |
|
885 | - // WP core validation and sanitization |
|
886 | - // freaks out. We'll just validate this argument while handling the request |
|
887 | - 'validate_callback' => null, |
|
888 | - 'sanitize_callback' => null, |
|
889 | - ], |
|
890 | - 'having' => [ |
|
891 | - 'required' => false, |
|
892 | - 'default' => null, |
|
893 | - 'type' => 'object', |
|
894 | - // because we accept an almost infinite list of possible where conditions, WP |
|
895 | - // core validation and sanitization freaks out. We'll just validate this argument |
|
896 | - // while handling the request |
|
897 | - 'validate_callback' => null, |
|
898 | - 'sanitize_callback' => null, |
|
899 | - ], |
|
900 | - 'caps' => [ |
|
901 | - 'required' => false, |
|
902 | - 'default' => EEM_Base::caps_read, |
|
903 | - 'type' => 'string', |
|
904 | - 'enum' => [ |
|
905 | - EEM_Base::caps_read, |
|
906 | - EEM_Base::caps_read_admin, |
|
907 | - EEM_Base::caps_edit, |
|
908 | - EEM_Base::caps_delete, |
|
909 | - ], |
|
910 | - ], |
|
911 | - ] |
|
912 | - ); |
|
913 | - } |
|
914 | - |
|
915 | - |
|
916 | - /** |
|
917 | - * Gets parameter information for a model regarding writing data |
|
918 | - * |
|
919 | - * @param string $model_name |
|
920 | - * @param ModelVersionInfo $model_version_info |
|
921 | - * @param boolean $create whether this is for request to create (in |
|
922 | - * which case we need all required params) or |
|
923 | - * just to update (in which case we don't |
|
924 | - * need those on every request) |
|
925 | - * @return array |
|
926 | - * @throws EE_Error |
|
927 | - * @throws ReflectionException |
|
928 | - */ |
|
929 | - protected function _get_write_params( |
|
930 | - $model_name, |
|
931 | - ModelVersionInfo $model_version_info, |
|
932 | - $create = false |
|
933 | - ) { |
|
934 | - $model = EE_Registry::instance()->load_model($model_name); |
|
935 | - $fields = $model_version_info->fieldsOnModelInThisVersion($model); |
|
936 | - |
|
937 | - // we do our own validation and sanitization within the controller |
|
938 | - $sanitize_callback = function_exists('rest_validate_value_from_schema') |
|
939 | - ? ['EED_Core_Rest_Api', 'default_sanitize_callback'] |
|
940 | - : null; |
|
941 | - $args_info = []; |
|
942 | - foreach ($fields as $field_name => $field_obj) { |
|
943 | - if ($field_obj->is_auto_increment()) { |
|
944 | - // totally ignore auto increment IDs |
|
945 | - continue; |
|
946 | - } |
|
947 | - $arg_info = $field_obj->getSchema(); |
|
948 | - $required = $create && ! $field_obj->is_nullable() && $field_obj->get_default_value() === null; |
|
949 | - $arg_info['required'] = $required; |
|
950 | - // remove the read-only flag. If it were read-only we wouldn't list it as an argument while writing, right? |
|
951 | - unset($arg_info['readonly']); |
|
952 | - $schema_properties = $field_obj->getSchemaProperties(); |
|
953 | - if (isset($schema_properties['raw']) |
|
954 | - && $field_obj->getSchemaType() === 'object' |
|
955 | - ) { |
|
956 | - // if there's a "raw" form of this argument, use those properties instead |
|
957 | - $arg_info = array_replace( |
|
958 | - $arg_info, |
|
959 | - $schema_properties['raw'] |
|
960 | - ); |
|
961 | - } |
|
962 | - $arg_info['default'] = ModelDataTranslator::prepareFieldValueForJson( |
|
963 | - $field_obj, |
|
964 | - $field_obj->get_default_value(), |
|
965 | - $model_version_info->requestedVersion() |
|
966 | - ); |
|
967 | - $arg_info['sanitize_callback'] = $sanitize_callback; |
|
968 | - $args_info[ $field_name ] = $arg_info; |
|
969 | - if ($field_obj instanceof EE_Datetime_Field) { |
|
970 | - $gmt_arg_info = $arg_info; |
|
971 | - $gmt_arg_info['description'] = sprintf( |
|
972 | - esc_html__( |
|
973 | - '%1$s - the value for this field in UTC. Ignored if %2$s is provided.', |
|
974 | - 'event_espresso' |
|
975 | - ), |
|
976 | - $field_obj->get_nicename(), |
|
977 | - $field_name |
|
978 | - ); |
|
979 | - $args_info[ $field_name . '_gmt' ] = $gmt_arg_info; |
|
980 | - } |
|
981 | - } |
|
982 | - return $args_info; |
|
983 | - } |
|
984 | - |
|
985 | - |
|
986 | - /** |
|
987 | - * Replacement for WP API's 'rest_parse_request_arg'. |
|
988 | - * If the value is blank but not required, don't bother validating it. |
|
989 | - * Also, it uses our email validation instead of WP API's default. |
|
990 | - * |
|
991 | - * @param $value |
|
992 | - * @param WP_REST_Request $request |
|
993 | - * @param $param |
|
994 | - * @return bool|true|WP_Error |
|
995 | - * @throws InvalidArgumentException |
|
996 | - * @throws InvalidInterfaceException |
|
997 | - * @throws InvalidDataTypeException |
|
998 | - */ |
|
999 | - public static function default_sanitize_callback($value, WP_REST_Request $request, $param) |
|
1000 | - { |
|
1001 | - $attributes = $request->get_attributes(); |
|
1002 | - if (! isset($attributes['args'][ $param ]) |
|
1003 | - || ! is_array($attributes['args'][ $param ])) { |
|
1004 | - $validation_result = true; |
|
1005 | - } else { |
|
1006 | - $args = $attributes['args'][ $param ]; |
|
1007 | - if (( |
|
1008 | - $value === '' |
|
1009 | - || $value === null |
|
1010 | - ) |
|
1011 | - && (! isset($args['required']) |
|
1012 | - || $args['required'] === false |
|
1013 | - ) |
|
1014 | - ) { |
|
1015 | - // not required and not provided? that's cool |
|
1016 | - $validation_result = true; |
|
1017 | - } elseif (isset($args['format']) |
|
1018 | - && $args['format'] === 'email' |
|
1019 | - ) { |
|
1020 | - $validation_result = true; |
|
1021 | - if (! EED_Core_Rest_Api::_validate_email($value)) { |
|
1022 | - $validation_result = new WP_Error( |
|
1023 | - 'rest_invalid_param', |
|
1024 | - esc_html__( |
|
1025 | - 'The email address is not valid or does not exist.', |
|
1026 | - 'event_espresso' |
|
1027 | - ) |
|
1028 | - ); |
|
1029 | - } |
|
1030 | - } else { |
|
1031 | - $validation_result = rest_validate_value_from_schema($value, $args, $param); |
|
1032 | - } |
|
1033 | - } |
|
1034 | - if (is_wp_error($validation_result)) { |
|
1035 | - return $validation_result; |
|
1036 | - } |
|
1037 | - return rest_sanitize_request_arg($value, $request, $param); |
|
1038 | - } |
|
1039 | - |
|
1040 | - |
|
1041 | - /** |
|
1042 | - * Returns whether or not this email address is valid. Copied from EE_Email_Validation_Strategy::_validate_email() |
|
1043 | - * |
|
1044 | - * @param $email |
|
1045 | - * @return bool |
|
1046 | - * @throws InvalidArgumentException |
|
1047 | - * @throws InvalidInterfaceException |
|
1048 | - * @throws InvalidDataTypeException |
|
1049 | - */ |
|
1050 | - protected static function _validate_email($email) |
|
1051 | - { |
|
1052 | - try { |
|
1053 | - EmailAddressFactory::create($email); |
|
1054 | - return true; |
|
1055 | - } catch (EmailValidationException $e) { |
|
1056 | - return false; |
|
1057 | - } |
|
1058 | - } |
|
1059 | - |
|
1060 | - |
|
1061 | - /** |
|
1062 | - * Gets routes for the config |
|
1063 | - * |
|
1064 | - * @return array @see _register_model_routes |
|
1065 | - * @deprecated since version 4.9.1 |
|
1066 | - */ |
|
1067 | - protected function _register_config_routes() |
|
1068 | - { |
|
1069 | - $config_routes = []; |
|
1070 | - foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
1071 | - $config_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_config_route_data_for_version( |
|
1072 | - $version, |
|
1073 | - $hidden_endpoint |
|
1074 | - ); |
|
1075 | - } |
|
1076 | - return $config_routes; |
|
1077 | - } |
|
1078 | - |
|
1079 | - |
|
1080 | - /** |
|
1081 | - * Gets routes for the config for the specified version |
|
1082 | - * |
|
1083 | - * @param string $version |
|
1084 | - * @param boolean $hidden_endpoint |
|
1085 | - * @return array |
|
1086 | - */ |
|
1087 | - protected function _get_config_route_data_for_version($version, $hidden_endpoint) |
|
1088 | - { |
|
1089 | - return [ |
|
1090 | - 'config' => [ |
|
1091 | - [ |
|
1092 | - 'callback' => [ |
|
1093 | - 'EventEspresso\core\libraries\rest_api\controllers\config\Read', |
|
1094 | - 'handleRequest', |
|
1095 | - ], |
|
1096 | - 'methods' => WP_REST_Server::READABLE, |
|
1097 | - 'hidden_endpoint' => $hidden_endpoint, |
|
1098 | - 'callback_args' => [$version], |
|
1099 | - ], |
|
1100 | - ], |
|
1101 | - 'site_info' => [ |
|
1102 | - [ |
|
1103 | - 'callback' => [ |
|
1104 | - 'EventEspresso\core\libraries\rest_api\controllers\config\Read', |
|
1105 | - 'handleRequestSiteInfo', |
|
1106 | - ], |
|
1107 | - 'methods' => WP_REST_Server::READABLE, |
|
1108 | - 'hidden_endpoint' => $hidden_endpoint, |
|
1109 | - 'callback_args' => [$version], |
|
1110 | - ], |
|
1111 | - ], |
|
1112 | - ]; |
|
1113 | - } |
|
1114 | - |
|
1115 | - |
|
1116 | - /** |
|
1117 | - * Gets the meta info routes |
|
1118 | - * |
|
1119 | - * @return array @see _register_model_routes |
|
1120 | - * @deprecated since version 4.9.1 |
|
1121 | - */ |
|
1122 | - protected function _register_meta_routes() |
|
1123 | - { |
|
1124 | - $meta_routes = []; |
|
1125 | - foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
1126 | - $meta_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_meta_route_data_for_version( |
|
1127 | - $version, |
|
1128 | - $hidden_endpoint |
|
1129 | - ); |
|
1130 | - } |
|
1131 | - return $meta_routes; |
|
1132 | - } |
|
1133 | - |
|
1134 | - |
|
1135 | - /** |
|
1136 | - * @param string $version |
|
1137 | - * @param boolean $hidden_endpoint |
|
1138 | - * @return array |
|
1139 | - */ |
|
1140 | - protected function _get_meta_route_data_for_version($version, $hidden_endpoint = false) |
|
1141 | - { |
|
1142 | - return [ |
|
1143 | - 'resources' => [ |
|
1144 | - [ |
|
1145 | - 'callback' => [ |
|
1146 | - 'EventEspresso\core\libraries\rest_api\controllers\model\Meta', |
|
1147 | - 'handleRequestModelsMeta', |
|
1148 | - ], |
|
1149 | - 'methods' => WP_REST_Server::READABLE, |
|
1150 | - 'hidden_endpoint' => $hidden_endpoint, |
|
1151 | - 'callback_args' => [$version], |
|
1152 | - ], |
|
1153 | - ], |
|
1154 | - ]; |
|
1155 | - } |
|
1156 | - |
|
1157 | - |
|
1158 | - /** |
|
1159 | - * Tries to hide old 4.6 endpoints from the |
|
1160 | - * |
|
1161 | - * @param array $route_data |
|
1162 | - * @return array |
|
1163 | - * @throws EE_Error |
|
1164 | - * @throws ReflectionException |
|
1165 | - */ |
|
1166 | - public static function hide_old_endpoints($route_data) |
|
1167 | - { |
|
1168 | - // allow API clients to override which endpoints get hidden, in case |
|
1169 | - // they want to discover particular endpoints |
|
1170 | - // also, we don't have access to the request so we have to just grab it from the superglobal |
|
1171 | - $force_show_ee_namespace = ltrim( |
|
1172 | - EEH_Array::is_set($_REQUEST, 'force_show_ee_namespace', ''), |
|
1173 | - '/' |
|
1174 | - ); |
|
1175 | - foreach (EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_urls) { |
|
1176 | - foreach ($relative_urls as $resource_name => $endpoints) { |
|
1177 | - foreach ($endpoints as $key => $endpoint) { |
|
1178 | - // skip schema and other route options |
|
1179 | - if (! is_numeric($key)) { |
|
1180 | - continue; |
|
1181 | - } |
|
1182 | - // by default, hide "hidden_endpoint"s, unless the request indicates |
|
1183 | - // to $force_show_ee_namespace, in which case only show that one |
|
1184 | - // namespace's endpoints (and hide all others) |
|
1185 | - if (($force_show_ee_namespace !== '' && $force_show_ee_namespace !== $namespace) |
|
1186 | - || ($endpoint['hidden_endpoint'] && $force_show_ee_namespace === '') |
|
1187 | - ) { |
|
1188 | - $full_route = '/' . ltrim($namespace, '/'); |
|
1189 | - $full_route .= '/' . ltrim($resource_name, '/'); |
|
1190 | - unset($route_data[ $full_route ]); |
|
1191 | - } |
|
1192 | - } |
|
1193 | - } |
|
1194 | - } |
|
1195 | - return $route_data; |
|
1196 | - } |
|
1197 | - |
|
1198 | - |
|
1199 | - /** |
|
1200 | - * Returns an array describing which versions of core support serving requests for. |
|
1201 | - * Keys are core versions' major and minor version, and values are the |
|
1202 | - * LOWEST requested version they can serve. Eg, 4.7 can serve requests for 4.6-like |
|
1203 | - * data by just removing a few models and fields from the responses. However, 4.15 might remove |
|
1204 | - * the answers table entirely, in which case it would be very difficult for |
|
1205 | - * it to serve 4.6-style responses. |
|
1206 | - * Versions of core that are missing from this array are unknowns. |
|
1207 | - * previous ver |
|
1208 | - * |
|
1209 | - * @return array |
|
1210 | - */ |
|
1211 | - public static function version_compatibilities() |
|
1212 | - { |
|
1213 | - return apply_filters( |
|
1214 | - 'FHEE__EED_Core_REST_API__version_compatibilities', |
|
1215 | - [ |
|
1216 | - '4.8.29' => '4.8.29', |
|
1217 | - '4.8.33' => '4.8.29', |
|
1218 | - '4.8.34' => '4.8.29', |
|
1219 | - '4.8.36' => '4.8.29', |
|
1220 | - ] |
|
1221 | - ); |
|
1222 | - } |
|
1223 | - |
|
1224 | - |
|
1225 | - /** |
|
1226 | - * Gets the latest API version served. Eg if there |
|
1227 | - * are two versions served of the API, 4.8.29 and 4.8.32, and |
|
1228 | - * we are on core version 4.8.34, it will return the string "4.8.32" |
|
1229 | - * |
|
1230 | - * @return string |
|
1231 | - */ |
|
1232 | - public static function latest_rest_api_version() |
|
1233 | - { |
|
1234 | - $versions_served = EED_Core_Rest_Api::versions_served(); |
|
1235 | - $versions_served_keys = array_keys($versions_served); |
|
1236 | - return end($versions_served_keys); |
|
1237 | - } |
|
1238 | - |
|
1239 | - |
|
1240 | - /** |
|
1241 | - * Using EED_Core_Rest_Api::version_compatibilities(), determines what version of |
|
1242 | - * EE the API can serve requests for. Eg, if we are on 4.15 of core, and |
|
1243 | - * we can serve requests from 4.12 or later, this will return array( '4.12', '4.13', '4.14', '4.15' ). |
|
1244 | - * We also indicate whether or not this version should be put in the index or not |
|
1245 | - * |
|
1246 | - * @return array keys are API version numbers (just major and minor numbers), and values |
|
1247 | - * are whether or not they should be hidden |
|
1248 | - */ |
|
1249 | - public static function versions_served() |
|
1250 | - { |
|
1251 | - $versions_served = []; |
|
1252 | - $possibly_served_versions = EED_Core_Rest_Api::version_compatibilities(); |
|
1253 | - $lowest_compatible_version = end($possibly_served_versions); |
|
1254 | - reset($possibly_served_versions); |
|
1255 | - $versions_served_historically = array_keys($possibly_served_versions); |
|
1256 | - $latest_version = end($versions_served_historically); |
|
1257 | - reset($versions_served_historically); |
|
1258 | - // for each version of core we have ever served: |
|
1259 | - foreach ($versions_served_historically as $key_versioned_endpoint) { |
|
1260 | - // if it's not above the current core version, and it's compatible with the current version of core |
|
1261 | - |
|
1262 | - if ($key_versioned_endpoint === $latest_version) { |
|
1263 | - // don't hide the latest version in the index |
|
1264 | - $versions_served[ $key_versioned_endpoint ] = false; |
|
1265 | - } elseif (version_compare($key_versioned_endpoint, $lowest_compatible_version, '>=') |
|
1266 | - && version_compare($key_versioned_endpoint, EED_Core_Rest_Api::core_version(), '<') |
|
1267 | - ) { |
|
1268 | - // include, but hide, previous versions which are still supported |
|
1269 | - $versions_served[ $key_versioned_endpoint ] = true; |
|
1270 | - } elseif (apply_filters( |
|
1271 | - 'FHEE__EED_Core_Rest_Api__versions_served__include_incompatible_versions', |
|
1272 | - false, |
|
1273 | - $possibly_served_versions |
|
1274 | - )) { |
|
1275 | - // if a version is no longer supported, don't include it in index or list of versions served |
|
1276 | - $versions_served[ $key_versioned_endpoint ] = true; |
|
1277 | - } |
|
1278 | - } |
|
1279 | - return $versions_served; |
|
1280 | - } |
|
1281 | - |
|
1282 | - |
|
1283 | - /** |
|
1284 | - * Gets the major and minor version of EE core's version string |
|
1285 | - * |
|
1286 | - * @return string |
|
1287 | - */ |
|
1288 | - public static function core_version() |
|
1289 | - { |
|
1290 | - return apply_filters( |
|
1291 | - 'FHEE__EED_Core_REST_API__core_version', |
|
1292 | - implode( |
|
1293 | - '.', |
|
1294 | - array_slice( |
|
1295 | - explode( |
|
1296 | - '.', |
|
1297 | - espresso_version() |
|
1298 | - ), |
|
1299 | - 0, |
|
1300 | - 3 |
|
1301 | - ) |
|
1302 | - ) |
|
1303 | - ); |
|
1304 | - } |
|
1305 | - |
|
1306 | - |
|
1307 | - /** |
|
1308 | - * Gets the default limit that should be used when querying for resources |
|
1309 | - * |
|
1310 | - * @return int |
|
1311 | - */ |
|
1312 | - public static function get_default_query_limit() |
|
1313 | - { |
|
1314 | - // we actually don't use a const because we want folks to always use |
|
1315 | - // this method, not the const directly |
|
1316 | - return apply_filters( |
|
1317 | - 'FHEE__EED_Core_Rest_Api__get_default_query_limit', |
|
1318 | - 50 |
|
1319 | - ); |
|
1320 | - } |
|
1321 | - |
|
1322 | - |
|
1323 | - /** |
|
1324 | - * @param string $version api version string (i.e. '4.8.36') |
|
1325 | - * @return array |
|
1326 | - */ |
|
1327 | - public static function getCollectionRoutesIndexedByModelName($version = '') |
|
1328 | - { |
|
1329 | - $version = empty($version) ? EED_Core_Rest_Api::latest_rest_api_version() : $version; |
|
1330 | - $model_names = EED_Core_Rest_Api::model_names_with_plural_routes($version); |
|
1331 | - $collection_routes = []; |
|
1332 | - foreach ($model_names as $model_name => $model_class_name) { |
|
1333 | - $collection_routes[ strtolower($model_name) ] = '/' . EED_Core_Rest_Api::ee_api_namespace . $version . '/' |
|
1334 | - . EEH_Inflector::pluralize_and_lower($model_name); |
|
1335 | - } |
|
1336 | - return $collection_routes; |
|
1337 | - } |
|
1338 | - |
|
1339 | - |
|
1340 | - /** |
|
1341 | - * Returns an array of primary key names indexed by model names. |
|
1342 | - * |
|
1343 | - * @param string $version |
|
1344 | - * @return array |
|
1345 | - */ |
|
1346 | - public static function getPrimaryKeyNamesIndexedByModelName($version = '') |
|
1347 | - { |
|
1348 | - $version = empty($version) ? EED_Core_Rest_Api::latest_rest_api_version() : $version; |
|
1349 | - $model_names = EED_Core_Rest_Api::model_names_with_plural_routes($version); |
|
1350 | - $primary_key_items = []; |
|
1351 | - foreach ($model_names as $model_name => $model_class_name) { |
|
1352 | - $primary_keys = $model_class_name::instance()->get_combined_primary_key_fields(); |
|
1353 | - foreach ($primary_keys as $primary_key_name => $primary_key_field) { |
|
1354 | - if (count($primary_keys) > 1) { |
|
1355 | - $primary_key_items[ strtolower($model_name) ][] = $primary_key_name; |
|
1356 | - } else { |
|
1357 | - $primary_key_items[ strtolower($model_name) ] = $primary_key_name; |
|
1358 | - } |
|
1359 | - } |
|
1360 | - } |
|
1361 | - return $primary_key_items; |
|
1362 | - } |
|
1363 | - |
|
1364 | - |
|
1365 | - /** |
|
1366 | - * Determines the EE REST API debug mode is activated, or not. |
|
1367 | - * |
|
1368 | - * @return bool |
|
1369 | - * @since 4.9.76.p |
|
1370 | - */ |
|
1371 | - public static function debugMode() |
|
1372 | - { |
|
1373 | - static $debug_mode = null; // could be class prop |
|
1374 | - if ($debug_mode === null) { |
|
1375 | - $debug_mode = defined('EE_REST_API_DEBUG_MODE') && EE_REST_API_DEBUG_MODE; |
|
1376 | - } |
|
1377 | - return $debug_mode; |
|
1378 | - } |
|
1379 | - |
|
1380 | - |
|
1381 | - /** |
|
1382 | - * run - initial module setup |
|
1383 | - * |
|
1384 | - * @access public |
|
1385 | - * @param WP $WP |
|
1386 | - * @return void |
|
1387 | - */ |
|
1388 | - public function run($WP) |
|
1389 | - { |
|
1390 | - } |
|
25 | + const ee_api_namespace = Domain::API_NAMESPACE; |
|
26 | + |
|
27 | + const ee_api_namespace_for_regex = 'ee\/v([^/]*)\/'; |
|
28 | + |
|
29 | + const saved_routes_option_names = 'ee_core_routes'; |
|
30 | + |
|
31 | + /** |
|
32 | + * string used in _links response bodies to make them globally unique. |
|
33 | + * |
|
34 | + * @see http://v2.wp-api.org/extending/linking/ |
|
35 | + */ |
|
36 | + const ee_api_link_namespace = 'https://api.eventespresso.com/'; |
|
37 | + |
|
38 | + /** |
|
39 | + * @var CalculatedModelFields |
|
40 | + */ |
|
41 | + protected static $_field_calculator; |
|
42 | + |
|
43 | + |
|
44 | + /** |
|
45 | + * @return EED_Core_Rest_Api|EED_Module |
|
46 | + */ |
|
47 | + public static function instance() |
|
48 | + { |
|
49 | + return parent::get_instance(EED_Core_Rest_Api::class); |
|
50 | + } |
|
51 | + |
|
52 | + |
|
53 | + /** |
|
54 | + * set_hooks - for hooking into EE Core, other modules, etc |
|
55 | + * |
|
56 | + * @access public |
|
57 | + * @return void |
|
58 | + */ |
|
59 | + public static function set_hooks() |
|
60 | + { |
|
61 | + } |
|
62 | + |
|
63 | + |
|
64 | + /** |
|
65 | + * set_hooks_admin - for hooking into EE Admin Core, other modules, etc |
|
66 | + * |
|
67 | + * @access public |
|
68 | + * @return void |
|
69 | + */ |
|
70 | + public static function set_hooks_admin() |
|
71 | + { |
|
72 | + } |
|
73 | + |
|
74 | + |
|
75 | + public static function set_hooks_both() |
|
76 | + { |
|
77 | + add_action('rest_api_init', ['EED_Core_Rest_Api', 'set_hooks_rest_api'], 5); |
|
78 | + add_action('rest_api_init', ['EED_Core_Rest_Api', 'register_routes'], 10); |
|
79 | + add_filter('rest_route_data', ['EED_Core_Rest_Api', 'hide_old_endpoints'], 10, 2); |
|
80 | + add_filter( |
|
81 | + 'rest_index', |
|
82 | + ['EventEspresso\core\libraries\rest_api\controllers\model\Meta', 'filterEeMetadataIntoIndex'] |
|
83 | + ); |
|
84 | + } |
|
85 | + |
|
86 | + |
|
87 | + /** |
|
88 | + * @since $VID:$ |
|
89 | + */ |
|
90 | + public static function loadCalculatedModelFields() |
|
91 | + { |
|
92 | + EED_Core_Rest_Api::$_field_calculator = LoaderFactory::getLoader()->load( |
|
93 | + 'EventEspresso\core\libraries\rest_api\CalculatedModelFields' |
|
94 | + ); |
|
95 | + EED_Core_Rest_Api::invalidate_cached_route_data_on_version_change(); |
|
96 | + } |
|
97 | + |
|
98 | + |
|
99 | + /** |
|
100 | + * sets up hooks which only need to be included as part of REST API requests; |
|
101 | + * other requests like to the frontend or admin etc don't need them |
|
102 | + * |
|
103 | + * @throws EE_Error |
|
104 | + */ |
|
105 | + public static function set_hooks_rest_api() |
|
106 | + { |
|
107 | + // set hooks which account for changes made to the API |
|
108 | + EED_Core_Rest_Api::_set_hooks_for_changes(); |
|
109 | + } |
|
110 | + |
|
111 | + |
|
112 | + /** |
|
113 | + * public wrapper of _set_hooks_for_changes. |
|
114 | + * Loads all the hooks which make requests to old versions of the API |
|
115 | + * appear the same as they always did |
|
116 | + * |
|
117 | + * @throws EE_Error |
|
118 | + */ |
|
119 | + public static function set_hooks_for_changes() |
|
120 | + { |
|
121 | + EED_Core_Rest_Api::_set_hooks_for_changes(); |
|
122 | + } |
|
123 | + |
|
124 | + |
|
125 | + /** |
|
126 | + * Loads all the hooks which make requests to old versions of the API |
|
127 | + * appear the same as they always did |
|
128 | + * |
|
129 | + * @throws EE_Error |
|
130 | + */ |
|
131 | + protected static function _set_hooks_for_changes() |
|
132 | + { |
|
133 | + $folder_contents = EEH_File::get_contents_of_folders([EE_LIBRARIES . 'rest_api/changes'], false); |
|
134 | + foreach ($folder_contents as $classname_in_namespace => $filepath) { |
|
135 | + // ignore the base parent class |
|
136 | + // and legacy named classes |
|
137 | + if ($classname_in_namespace === 'ChangesInBase' |
|
138 | + || strpos($classname_in_namespace, 'Changes_In_') === 0 |
|
139 | + ) { |
|
140 | + continue; |
|
141 | + } |
|
142 | + $full_classname = 'EventEspresso\core\libraries\rest_api\changes\\' . $classname_in_namespace; |
|
143 | + if (class_exists($full_classname)) { |
|
144 | + $instance_of_class = new $full_classname; |
|
145 | + if ($instance_of_class instanceof ChangesInBase) { |
|
146 | + $instance_of_class->setHooks(); |
|
147 | + } |
|
148 | + } |
|
149 | + } |
|
150 | + } |
|
151 | + |
|
152 | + |
|
153 | + /** |
|
154 | + * Filters the WP routes to add our EE-related ones. This takes a bit of time |
|
155 | + * so we actually prefer to only do it when an EE plugin is activated or upgraded |
|
156 | + * |
|
157 | + * @throws EE_Error |
|
158 | + * @throws ReflectionException |
|
159 | + */ |
|
160 | + public static function register_routes() |
|
161 | + { |
|
162 | + foreach (EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_routes) { |
|
163 | + foreach ($relative_routes as $relative_route => $data_for_multiple_endpoints) { |
|
164 | + /** |
|
165 | + * @var array $data_for_multiple_endpoints numerically indexed array |
|
166 | + * but can also contain route options like { |
|
167 | + * @type array $schema { |
|
168 | + * @type callable $schema_callback |
|
169 | + * @type array $callback_args arguments that will be passed to the callback, after the |
|
170 | + * WP_REST_Request of course |
|
171 | + * } |
|
172 | + * } |
|
173 | + */ |
|
174 | + // when registering routes, register all the endpoints' data at the same time |
|
175 | + $multiple_endpoint_args = []; |
|
176 | + foreach ($data_for_multiple_endpoints as $endpoint_key => $data_for_single_endpoint) { |
|
177 | + /** |
|
178 | + * @var array $data_for_single_endpoint { |
|
179 | + * @type callable $callback |
|
180 | + * @type string methods |
|
181 | + * @type array args |
|
182 | + * @type array _links |
|
183 | + * @type array $callback_args arguments that will be passed to the callback, after the |
|
184 | + * WP_REST_Request of course |
|
185 | + * } |
|
186 | + */ |
|
187 | + // skip route options |
|
188 | + if (! is_numeric($endpoint_key)) { |
|
189 | + continue; |
|
190 | + } |
|
191 | + if (! isset($data_for_single_endpoint['callback'], $data_for_single_endpoint['methods'])) { |
|
192 | + throw new EE_Error( |
|
193 | + esc_html__( |
|
194 | + // @codingStandardsIgnoreStart |
|
195 | + 'Endpoint configuration data needs to have entries "callback" (callable) and "methods" (comma-separated list of accepts HTTP methods).', |
|
196 | + // @codingStandardsIgnoreEnd |
|
197 | + 'event_espresso' |
|
198 | + ) |
|
199 | + ); |
|
200 | + } |
|
201 | + $callback = $data_for_single_endpoint['callback']; |
|
202 | + $single_endpoint_args = [ |
|
203 | + 'methods' => $data_for_single_endpoint['methods'], |
|
204 | + 'args' => isset($data_for_single_endpoint['args']) ? $data_for_single_endpoint['args'] |
|
205 | + : [], |
|
206 | + ]; |
|
207 | + if (isset($data_for_single_endpoint['_links'])) { |
|
208 | + $single_endpoint_args['_links'] = $data_for_single_endpoint['_links']; |
|
209 | + } |
|
210 | + if (isset($data_for_single_endpoint['callback_args'])) { |
|
211 | + $callback_args = $data_for_single_endpoint['callback_args']; |
|
212 | + $single_endpoint_args['callback'] = static function (WP_REST_Request $request) use ( |
|
213 | + $callback, |
|
214 | + $callback_args |
|
215 | + ) { |
|
216 | + array_unshift($callback_args, $request); |
|
217 | + return call_user_func_array( |
|
218 | + $callback, |
|
219 | + $callback_args |
|
220 | + ); |
|
221 | + }; |
|
222 | + } else { |
|
223 | + $single_endpoint_args['callback'] = $data_for_single_endpoint['callback']; |
|
224 | + } |
|
225 | + // As of WordPress 5.5, if a permission_callback is not provided, |
|
226 | + // the REST API will issue a _doing_it_wrong notice. |
|
227 | + // Since the EE REST API defers capabilities to the db model system, |
|
228 | + // we will just use the generic WP callback for public endpoints |
|
229 | + if (! isset($single_endpoint_args['permission_callback'])) { |
|
230 | + $single_endpoint_args['permission_callback'] = '__return_true'; |
|
231 | + } |
|
232 | + $multiple_endpoint_args[] = $single_endpoint_args; |
|
233 | + } |
|
234 | + if (isset($data_for_multiple_endpoints['schema'])) { |
|
235 | + $schema_route_data = $data_for_multiple_endpoints['schema']; |
|
236 | + $schema_callback = $schema_route_data['schema_callback']; |
|
237 | + $callback_args = $schema_route_data['callback_args']; |
|
238 | + $multiple_endpoint_args['schema'] = static function () use ($schema_callback, $callback_args) { |
|
239 | + return call_user_func_array( |
|
240 | + $schema_callback, |
|
241 | + $callback_args |
|
242 | + ); |
|
243 | + }; |
|
244 | + } |
|
245 | + register_rest_route( |
|
246 | + $namespace, |
|
247 | + $relative_route, |
|
248 | + $multiple_endpoint_args |
|
249 | + ); |
|
250 | + } |
|
251 | + } |
|
252 | + } |
|
253 | + |
|
254 | + |
|
255 | + /** |
|
256 | + * Checks if there was a version change or something that merits invalidating the cached |
|
257 | + * route data. If so, invalidates the cached route data so that it gets refreshed |
|
258 | + * next time the WP API is used |
|
259 | + */ |
|
260 | + public static function invalidate_cached_route_data_on_version_change() |
|
261 | + { |
|
262 | + if (EE_System::instance()->detect_req_type() !== EE_System::req_type_normal) { |
|
263 | + EED_Core_Rest_Api::invalidate_cached_route_data(); |
|
264 | + } |
|
265 | + foreach (EE_Registry::instance()->addons as $addon) { |
|
266 | + if ($addon instanceof EE_Addon && $addon->detect_req_type() !== EE_System::req_type_normal) { |
|
267 | + EED_Core_Rest_Api::invalidate_cached_route_data(); |
|
268 | + } |
|
269 | + } |
|
270 | + } |
|
271 | + |
|
272 | + |
|
273 | + /** |
|
274 | + * Removes the cached route data so it will get refreshed next time the WP API is used |
|
275 | + */ |
|
276 | + public static function invalidate_cached_route_data() |
|
277 | + { |
|
278 | + // delete the saved EE REST API routes |
|
279 | + foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden) { |
|
280 | + delete_option(EED_Core_Rest_Api::saved_routes_option_names . $version); |
|
281 | + } |
|
282 | + } |
|
283 | + |
|
284 | + |
|
285 | + /** |
|
286 | + * Gets the EE route data |
|
287 | + * |
|
288 | + * @return array top-level key is the namespace, next-level key is the route and its value is array{ |
|
289 | + * @throws EE_Error |
|
290 | + * @throws ReflectionException |
|
291 | + * @type string|array $callback |
|
292 | + * @type string $methods |
|
293 | + * @type boolean $hidden_endpoint |
|
294 | + * } |
|
295 | + */ |
|
296 | + public static function get_ee_route_data() |
|
297 | + { |
|
298 | + $ee_routes = []; |
|
299 | + foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoints) { |
|
300 | + $ee_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = EED_Core_Rest_Api::_get_ee_route_data_for_version( |
|
301 | + $version, |
|
302 | + $hidden_endpoints |
|
303 | + ); |
|
304 | + } |
|
305 | + return $ee_routes; |
|
306 | + } |
|
307 | + |
|
308 | + |
|
309 | + /** |
|
310 | + * Gets the EE route data from the wp options if it exists already, |
|
311 | + * otherwise re-generates it and saves it to the option |
|
312 | + * |
|
313 | + * @param string $version |
|
314 | + * @param boolean $hidden_endpoints |
|
315 | + * @return array |
|
316 | + * @throws EE_Error |
|
317 | + * @throws ReflectionException |
|
318 | + */ |
|
319 | + protected static function _get_ee_route_data_for_version($version, $hidden_endpoints = false) |
|
320 | + { |
|
321 | + $ee_routes = get_option(EED_Core_Rest_Api::saved_routes_option_names . $version, null); |
|
322 | + if (! $ee_routes || EED_Core_Rest_Api::debugMode()) { |
|
323 | + $ee_routes = EED_Core_Rest_Api::_save_ee_route_data_for_version($version, $hidden_endpoints); |
|
324 | + } |
|
325 | + return $ee_routes; |
|
326 | + } |
|
327 | + |
|
328 | + |
|
329 | + /** |
|
330 | + * Saves the EE REST API route data to a wp option and returns it |
|
331 | + * |
|
332 | + * @param string $version |
|
333 | + * @param boolean $hidden_endpoints |
|
334 | + * @return mixed|null |
|
335 | + * @throws EE_Error |
|
336 | + * @throws ReflectionException |
|
337 | + */ |
|
338 | + protected static function _save_ee_route_data_for_version($version, $hidden_endpoints = false) |
|
339 | + { |
|
340 | + $instance = EED_Core_Rest_Api::instance(); |
|
341 | + $routes = apply_filters( |
|
342 | + 'EED_Core_Rest_Api__save_ee_route_data_for_version__routes', |
|
343 | + array_replace_recursive( |
|
344 | + $instance->_get_config_route_data_for_version($version, $hidden_endpoints), |
|
345 | + $instance->_get_meta_route_data_for_version($version, $hidden_endpoints), |
|
346 | + $instance->_get_model_route_data_for_version($version, $hidden_endpoints), |
|
347 | + $instance->_get_rpc_route_data_for_version($version, $hidden_endpoints) |
|
348 | + ) |
|
349 | + ); |
|
350 | + $option_name = EED_Core_Rest_Api::saved_routes_option_names . $version; |
|
351 | + if (get_option($option_name)) { |
|
352 | + update_option($option_name, $routes, true); |
|
353 | + } else { |
|
354 | + add_option($option_name, $routes, null, 'no'); |
|
355 | + } |
|
356 | + return $routes; |
|
357 | + } |
|
358 | + |
|
359 | + |
|
360 | + /** |
|
361 | + * Calculates all the EE routes and saves it to a WordPress option so we don't |
|
362 | + * need to calculate it on every request |
|
363 | + * |
|
364 | + * @return void |
|
365 | + * @deprecated since version 4.9.1 |
|
366 | + */ |
|
367 | + public static function save_ee_routes() |
|
368 | + { |
|
369 | + if (EE_Maintenance_Mode::instance()->models_can_query()) { |
|
370 | + $instance = EED_Core_Rest_Api::instance(); |
|
371 | + $routes = apply_filters( |
|
372 | + 'EED_Core_Rest_Api__save_ee_routes__routes', |
|
373 | + array_replace_recursive( |
|
374 | + $instance->_register_config_routes(), |
|
375 | + $instance->_register_meta_routes(), |
|
376 | + $instance->_register_model_routes(), |
|
377 | + $instance->_register_rpc_routes() |
|
378 | + ) |
|
379 | + ); |
|
380 | + update_option(EED_Core_Rest_Api::saved_routes_option_names, $routes, true); |
|
381 | + } |
|
382 | + } |
|
383 | + |
|
384 | + |
|
385 | + /** |
|
386 | + * Gets all the route information relating to EE models |
|
387 | + * |
|
388 | + * @return array @see get_ee_route_data |
|
389 | + * @deprecated since version 4.9.1 |
|
390 | + */ |
|
391 | + protected function _register_model_routes() |
|
392 | + { |
|
393 | + $model_routes = []; |
|
394 | + foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
395 | + $model_routes[ EED_Core_Rest_Api::ee_api_namespace |
|
396 | + . $version ] = $this->_get_config_route_data_for_version($version, $hidden_endpoint); |
|
397 | + } |
|
398 | + return $model_routes; |
|
399 | + } |
|
400 | + |
|
401 | + |
|
402 | + /** |
|
403 | + * Decides whether or not to add write endpoints for this model. |
|
404 | + * Currently, this defaults to exclude all global tables and models |
|
405 | + * which would allow inserting WP core data (we don't want to duplicate |
|
406 | + * what WP API does, as it's unnecessary, extra work, and potentially extra bugs) |
|
407 | + * |
|
408 | + * @param EEM_Base $model |
|
409 | + * @return bool |
|
410 | + */ |
|
411 | + public static function should_have_write_endpoints(EEM_Base $model) |
|
412 | + { |
|
413 | + if ($model->is_wp_core_model()) { |
|
414 | + return false; |
|
415 | + } |
|
416 | + foreach ($model->get_tables() as $table) { |
|
417 | + if ($table->is_global()) { |
|
418 | + return false; |
|
419 | + } |
|
420 | + } |
|
421 | + return true; |
|
422 | + } |
|
423 | + |
|
424 | + |
|
425 | + /** |
|
426 | + * Gets the names of all models which should have plural routes (eg `ee/v4.8.36/events`) |
|
427 | + * in this versioned namespace of EE4 |
|
428 | + * |
|
429 | + * @param $version |
|
430 | + * @return array keys are model names (eg 'Event') and values ar either classnames (eg 'EEM_Event') |
|
431 | + */ |
|
432 | + public static function model_names_with_plural_routes($version) |
|
433 | + { |
|
434 | + $model_version_info = new ModelVersionInfo($version); |
|
435 | + $models_to_register = $model_version_info->modelsForRequestedVersion(); |
|
436 | + // let's not bother having endpoints for extra metas |
|
437 | + unset( |
|
438 | + $models_to_register['Extra_Meta'], |
|
439 | + $models_to_register['Extra_Join'], |
|
440 | + $models_to_register['Post_Meta'] |
|
441 | + ); |
|
442 | + return apply_filters( |
|
443 | + 'FHEE__EED_Core_REST_API___register_model_routes', |
|
444 | + $models_to_register |
|
445 | + ); |
|
446 | + } |
|
447 | + |
|
448 | + |
|
449 | + /** |
|
450 | + * Gets the route data for EE models in the specified version |
|
451 | + * |
|
452 | + * @param string $version |
|
453 | + * @param boolean $hidden_endpoint |
|
454 | + * @return array |
|
455 | + * @throws EE_Error |
|
456 | + * @throws ReflectionException |
|
457 | + */ |
|
458 | + protected function _get_model_route_data_for_version($version, $hidden_endpoint = false) |
|
459 | + { |
|
460 | + $model_routes = []; |
|
461 | + $model_version_info = new ModelVersionInfo($version); |
|
462 | + foreach (EED_Core_Rest_Api::model_names_with_plural_routes($version) as $model_name => $model_classname) { |
|
463 | + $model = EE_Registry::instance()->load_model($model_name); |
|
464 | + // if this isn't a valid model then let's skip iterate to the next item in the loop. |
|
465 | + if (! $model instanceof EEM_Base) { |
|
466 | + continue; |
|
467 | + } |
|
468 | + // yes we could just register one route for ALL models, but then they wouldn't show up in the index |
|
469 | + $plural_model_route = EED_Core_Rest_Api::get_collection_route($model); |
|
470 | + $singular_model_route = EED_Core_Rest_Api::get_entity_route($model, '(?P<id>[^\/]+)'); |
|
471 | + $model_routes[ $plural_model_route ] = [ |
|
472 | + [ |
|
473 | + 'callback' => [ |
|
474 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
475 | + 'handleRequestGetAll', |
|
476 | + ], |
|
477 | + 'callback_args' => [$version, $model_name], |
|
478 | + 'methods' => WP_REST_Server::READABLE, |
|
479 | + 'hidden_endpoint' => $hidden_endpoint, |
|
480 | + 'args' => $this->_get_read_query_params($model, $version), |
|
481 | + '_links' => [ |
|
482 | + 'self' => rest_url(EED_Core_Rest_Api::ee_api_namespace . $version . $singular_model_route), |
|
483 | + ], |
|
484 | + ], |
|
485 | + 'schema' => [ |
|
486 | + 'schema_callback' => [ |
|
487 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
488 | + 'handleSchemaRequest', |
|
489 | + ], |
|
490 | + 'callback_args' => [$version, $model_name], |
|
491 | + ], |
|
492 | + ]; |
|
493 | + $model_routes[ $singular_model_route ] = [ |
|
494 | + [ |
|
495 | + 'callback' => [ |
|
496 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
497 | + 'handleRequestGetOne', |
|
498 | + ], |
|
499 | + 'callback_args' => [$version, $model_name], |
|
500 | + 'methods' => WP_REST_Server::READABLE, |
|
501 | + 'hidden_endpoint' => $hidden_endpoint, |
|
502 | + 'args' => $this->_get_response_selection_query_params($model, $version, true), |
|
503 | + ], |
|
504 | + ]; |
|
505 | + if (apply_filters( |
|
506 | + 'FHEE__EED_Core_Rest_Api___get_model_route_data_for_version__add_write_endpoints', |
|
507 | + EED_Core_Rest_Api::should_have_write_endpoints($model), |
|
508 | + $model |
|
509 | + )) { |
|
510 | + $model_routes[ $plural_model_route ][] = [ |
|
511 | + 'callback' => [ |
|
512 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
513 | + 'handleRequestInsert', |
|
514 | + ], |
|
515 | + 'callback_args' => [$version, $model_name], |
|
516 | + 'methods' => WP_REST_Server::CREATABLE, |
|
517 | + 'hidden_endpoint' => $hidden_endpoint, |
|
518 | + 'args' => $this->_get_write_params($model_name, $model_version_info, true), |
|
519 | + ]; |
|
520 | + $model_routes[ $singular_model_route ] = array_merge( |
|
521 | + $model_routes[ $singular_model_route ], |
|
522 | + [ |
|
523 | + [ |
|
524 | + 'callback' => [ |
|
525 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
526 | + 'handleRequestUpdate', |
|
527 | + ], |
|
528 | + 'callback_args' => [$version, $model_name], |
|
529 | + 'methods' => WP_REST_Server::EDITABLE, |
|
530 | + 'hidden_endpoint' => $hidden_endpoint, |
|
531 | + 'args' => $this->_get_write_params($model_name, $model_version_info), |
|
532 | + ], |
|
533 | + [ |
|
534 | + 'callback' => [ |
|
535 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
536 | + 'handleRequestDelete', |
|
537 | + ], |
|
538 | + 'callback_args' => [$version, $model_name], |
|
539 | + 'methods' => WP_REST_Server::DELETABLE, |
|
540 | + 'hidden_endpoint' => $hidden_endpoint, |
|
541 | + 'args' => $this->_get_delete_query_params($model, $version), |
|
542 | + ], |
|
543 | + ] |
|
544 | + ); |
|
545 | + } |
|
546 | + foreach ($model->relation_settings() as $relation_name => $relation_obj) { |
|
547 | + $related_route = EED_Core_Rest_Api::get_relation_route_via( |
|
548 | + $model, |
|
549 | + '(?P<id>[^\/]+)', |
|
550 | + $relation_obj |
|
551 | + ); |
|
552 | + $model_routes[ $related_route ] = [ |
|
553 | + [ |
|
554 | + 'callback' => [ |
|
555 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
|
556 | + 'handleRequestGetRelated', |
|
557 | + ], |
|
558 | + 'callback_args' => [$version, $model_name, $relation_name], |
|
559 | + 'methods' => WP_REST_Server::READABLE, |
|
560 | + 'hidden_endpoint' => $hidden_endpoint, |
|
561 | + 'args' => $this->_get_read_query_params($relation_obj->get_other_model(), $version), |
|
562 | + ], |
|
563 | + ]; |
|
564 | + |
|
565 | + $related_write_route = $related_route . '/' . '(?P<related_id>[^\/]+)'; |
|
566 | + $model_routes[ $related_write_route ] = [ |
|
567 | + [ |
|
568 | + 'callback' => [ |
|
569 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
570 | + 'handleRequestAddRelation', |
|
571 | + ], |
|
572 | + 'callback_args' => [$version, $model_name, $relation_name], |
|
573 | + 'methods' => WP_REST_Server::EDITABLE, |
|
574 | + 'hidden_endpoint' => $hidden_endpoint, |
|
575 | + 'args' => $this->_get_add_relation_query_params( |
|
576 | + $model, |
|
577 | + $relation_obj->get_other_model(), |
|
578 | + $version |
|
579 | + ), |
|
580 | + ], |
|
581 | + [ |
|
582 | + 'callback' => [ |
|
583 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
|
584 | + 'handleRequestRemoveRelation', |
|
585 | + ], |
|
586 | + 'callback_args' => [$version, $model_name, $relation_name], |
|
587 | + 'methods' => WP_REST_Server::DELETABLE, |
|
588 | + 'hidden_endpoint' => $hidden_endpoint, |
|
589 | + 'args' => [], |
|
590 | + ], |
|
591 | + ]; |
|
592 | + } |
|
593 | + } |
|
594 | + return $model_routes; |
|
595 | + } |
|
596 | + |
|
597 | + |
|
598 | + /** |
|
599 | + * Gets the relative URI to a model's REST API plural route, after the EE4 versioned namespace, |
|
600 | + * excluding the preceding slash. |
|
601 | + * Eg you pass get_plural_route_to('Event') = 'events' |
|
602 | + * |
|
603 | + * @param EEM_Base $model |
|
604 | + * @return string |
|
605 | + */ |
|
606 | + public static function get_collection_route(EEM_Base $model) |
|
607 | + { |
|
608 | + return EEH_Inflector::pluralize_and_lower($model->get_this_model_name()); |
|
609 | + } |
|
610 | + |
|
611 | + |
|
612 | + /** |
|
613 | + * Gets the relative URI to a model's REST API singular route, after the EE4 versioned namespace, |
|
614 | + * excluding the preceding slash. |
|
615 | + * Eg you pass get_plural_route_to('Event', 12) = 'events/12' |
|
616 | + * |
|
617 | + * @param EEM_Base $model eg Event or Venue |
|
618 | + * @param string $id |
|
619 | + * @return string |
|
620 | + */ |
|
621 | + public static function get_entity_route($model, $id) |
|
622 | + { |
|
623 | + return EED_Core_Rest_Api::get_collection_route($model) . '/' . $id; |
|
624 | + } |
|
625 | + |
|
626 | + |
|
627 | + /** |
|
628 | + * Gets the relative URI to a model's REST API singular route, after the EE4 versioned namespace, |
|
629 | + * excluding the preceding slash. |
|
630 | + * Eg you pass get_plural_route_to('Event', 12) = 'events/12' |
|
631 | + * |
|
632 | + * @param EEM_Base $model eg Event or Venue |
|
633 | + * @param string $id |
|
634 | + * @param EE_Model_Relation_Base $relation_obj |
|
635 | + * @return string |
|
636 | + */ |
|
637 | + public static function get_relation_route_via(EEM_Base $model, $id, EE_Model_Relation_Base $relation_obj) |
|
638 | + { |
|
639 | + $related_model_name_endpoint_part = ModelRead::getRelatedEntityName( |
|
640 | + $relation_obj->get_other_model()->get_this_model_name(), |
|
641 | + $relation_obj |
|
642 | + ); |
|
643 | + return EED_Core_Rest_Api::get_entity_route($model, $id) . '/' . $related_model_name_endpoint_part; |
|
644 | + } |
|
645 | + |
|
646 | + |
|
647 | + /** |
|
648 | + * Adds onto the $relative_route the EE4 REST API versioned namespace. |
|
649 | + * Eg if given '4.8.36' and 'events', will return 'ee/v4.8.36/events' |
|
650 | + * |
|
651 | + * @param string $relative_route |
|
652 | + * @param string $version |
|
653 | + * @return string |
|
654 | + */ |
|
655 | + public static function get_versioned_route_to($relative_route, $version = '4.8.36') |
|
656 | + { |
|
657 | + return '/' . EED_Core_Rest_Api::ee_api_namespace . $version . '/' . $relative_route; |
|
658 | + } |
|
659 | + |
|
660 | + |
|
661 | + /** |
|
662 | + * Adds all the RPC-style routes (remote procedure call-like routes, ie |
|
663 | + * routes that don't conform to the traditional REST CRUD-style). |
|
664 | + * |
|
665 | + * @deprecated since 4.9.1 |
|
666 | + */ |
|
667 | + protected function _register_rpc_routes() |
|
668 | + { |
|
669 | + $routes = []; |
|
670 | + foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
671 | + $routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_rpc_route_data_for_version( |
|
672 | + $version, |
|
673 | + $hidden_endpoint |
|
674 | + ); |
|
675 | + } |
|
676 | + return $routes; |
|
677 | + } |
|
678 | + |
|
679 | + |
|
680 | + /** |
|
681 | + * @param string $version |
|
682 | + * @param boolean $hidden_endpoint |
|
683 | + * @return array |
|
684 | + */ |
|
685 | + protected function _get_rpc_route_data_for_version($version, $hidden_endpoint = false) |
|
686 | + { |
|
687 | + $this_versions_routes = []; |
|
688 | + // checkin endpoint |
|
689 | + $this_versions_routes['registrations/(?P<REG_ID>\d+)/toggle_checkin_for_datetime/(?P<DTT_ID>\d+)'] = [ |
|
690 | + [ |
|
691 | + 'callback' => [ |
|
692 | + 'EventEspresso\core\libraries\rest_api\controllers\rpc\Checkin', |
|
693 | + 'handleRequestToggleCheckin', |
|
694 | + ], |
|
695 | + 'methods' => WP_REST_Server::CREATABLE, |
|
696 | + 'hidden_endpoint' => $hidden_endpoint, |
|
697 | + 'args' => [ |
|
698 | + 'force' => [ |
|
699 | + 'required' => false, |
|
700 | + 'default' => false, |
|
701 | + 'description' => __( |
|
702 | + // @codingStandardsIgnoreStart |
|
703 | + 'Whether to force toggle checkin, or to verify the registration status and allowed ticket uses', |
|
704 | + // @codingStandardsIgnoreEnd |
|
705 | + 'event_espresso' |
|
706 | + ), |
|
707 | + ], |
|
708 | + ], |
|
709 | + 'callback_args' => [$version], |
|
710 | + ], |
|
711 | + ]; |
|
712 | + return apply_filters( |
|
713 | + 'FHEE__EED_Core_Rest_Api___register_rpc_routes__this_versions_routes', |
|
714 | + $this_versions_routes, |
|
715 | + $version, |
|
716 | + $hidden_endpoint |
|
717 | + ); |
|
718 | + } |
|
719 | + |
|
720 | + |
|
721 | + /** |
|
722 | + * Gets the query params that can be used when request one or many |
|
723 | + * |
|
724 | + * @param EEM_Base $model |
|
725 | + * @param string $version |
|
726 | + * @return array |
|
727 | + */ |
|
728 | + protected function _get_response_selection_query_params(EEM_Base $model, $version, $single_only = false) |
|
729 | + { |
|
730 | + EED_Core_Rest_Api::loadCalculatedModelFields(); |
|
731 | + $query_params = [ |
|
732 | + 'include' => [ |
|
733 | + 'required' => false, |
|
734 | + 'default' => '*', |
|
735 | + 'type' => 'string', |
|
736 | + ], |
|
737 | + 'calculate' => [ |
|
738 | + 'required' => false, |
|
739 | + 'default' => '', |
|
740 | + 'enum' => EED_Core_Rest_Api::$_field_calculator->retrieveCalculatedFieldsForModel($model), |
|
741 | + 'type' => 'string', |
|
742 | + // because we accept a CSV list of the enumerated strings, WP core validation and sanitization |
|
743 | + // freaks out. We'll just validate this argument while handling the request |
|
744 | + 'validate_callback' => null, |
|
745 | + 'sanitize_callback' => null, |
|
746 | + ], |
|
747 | + 'password' => [ |
|
748 | + 'required' => false, |
|
749 | + 'default' => '', |
|
750 | + 'type' => 'string', |
|
751 | + ], |
|
752 | + ]; |
|
753 | + return apply_filters( |
|
754 | + 'FHEE__EED_Core_Rest_Api___get_response_selection_query_params', |
|
755 | + $query_params, |
|
756 | + $model, |
|
757 | + $version |
|
758 | + ); |
|
759 | + } |
|
760 | + |
|
761 | + |
|
762 | + /** |
|
763 | + * Gets the parameters acceptable for delete requests |
|
764 | + * |
|
765 | + * @param EEM_Base $model |
|
766 | + * @param string $version |
|
767 | + * @return array |
|
768 | + */ |
|
769 | + protected function _get_delete_query_params(EEM_Base $model, $version) |
|
770 | + { |
|
771 | + $params_for_delete = [ |
|
772 | + 'allow_blocking' => [ |
|
773 | + 'required' => false, |
|
774 | + 'default' => true, |
|
775 | + 'type' => 'boolean', |
|
776 | + ], |
|
777 | + ]; |
|
778 | + $params_for_delete['force'] = [ |
|
779 | + 'required' => false, |
|
780 | + 'default' => false, |
|
781 | + 'type' => 'boolean', |
|
782 | + ]; |
|
783 | + return apply_filters( |
|
784 | + 'FHEE__EED_Core_Rest_Api___get_delete_query_params', |
|
785 | + $params_for_delete, |
|
786 | + $model, |
|
787 | + $version |
|
788 | + ); |
|
789 | + } |
|
790 | + |
|
791 | + |
|
792 | + /** |
|
793 | + * @param EEM_Base $source_model |
|
794 | + * @param EEM_Base $related_model |
|
795 | + * @param $version |
|
796 | + * @return array |
|
797 | + * @throws EE_Error |
|
798 | + * @since $VID:$ |
|
799 | + */ |
|
800 | + protected function _get_add_relation_query_params(EEM_Base $source_model, EEM_Base $related_model, $version) |
|
801 | + { |
|
802 | + // if they're related through a HABTM relation, check for any non-FKs |
|
803 | + $all_relation_settings = $source_model->relation_settings(); |
|
804 | + $relation_settings = $all_relation_settings[ $related_model->get_this_model_name() ]; |
|
805 | + $params = []; |
|
806 | + if ($relation_settings instanceof EE_HABTM_Relation && $relation_settings->hasNonKeyFields()) { |
|
807 | + foreach ($relation_settings->getNonKeyFields() as $field) { |
|
808 | + /* @var $field EE_Model_Field_Base */ |
|
809 | + $params[ $field->get_name() ] = [ |
|
810 | + 'required' => ! $field->is_nullable(), |
|
811 | + 'default' => ModelDataTranslator::prepareFieldValueForJson( |
|
812 | + $field, |
|
813 | + $field->get_default_value(), |
|
814 | + $version |
|
815 | + ), |
|
816 | + 'type' => $field->getSchemaType(), |
|
817 | + 'validate_callback' => null, |
|
818 | + 'sanitize_callback' => null, |
|
819 | + ]; |
|
820 | + } |
|
821 | + } |
|
822 | + return $params; |
|
823 | + } |
|
824 | + |
|
825 | + |
|
826 | + /** |
|
827 | + * Gets info about reading query params that are acceptable |
|
828 | + * |
|
829 | + * @param EEM_Base $model eg 'Event' or 'Venue' |
|
830 | + * @param string $version |
|
831 | + * @return array describing the args acceptable when querying this model |
|
832 | + * @throws EE_Error |
|
833 | + */ |
|
834 | + protected function _get_read_query_params(EEM_Base $model, $version) |
|
835 | + { |
|
836 | + $default_orderby = []; |
|
837 | + foreach ($model->get_combined_primary_key_fields() as $key_field) { |
|
838 | + $default_orderby[ $key_field->get_name() ] = 'ASC'; |
|
839 | + } |
|
840 | + return array_merge( |
|
841 | + $this->_get_response_selection_query_params($model, $version), |
|
842 | + [ |
|
843 | + 'where' => [ |
|
844 | + 'required' => false, |
|
845 | + 'default' => [], |
|
846 | + 'type' => 'object', |
|
847 | + // because we accept an almost infinite list of possible where conditions, WP |
|
848 | + // core validation and sanitization freaks out. We'll just validate this argument |
|
849 | + // while handling the request |
|
850 | + 'validate_callback' => null, |
|
851 | + 'sanitize_callback' => null, |
|
852 | + ], |
|
853 | + 'limit' => [ |
|
854 | + 'required' => false, |
|
855 | + 'default' => EED_Core_Rest_Api::get_default_query_limit(), |
|
856 | + 'type' => [ |
|
857 | + 'array', |
|
858 | + 'string', |
|
859 | + 'integer', |
|
860 | + ], |
|
861 | + // because we accept a variety of types, WP core validation and sanitization |
|
862 | + // freaks out. We'll just validate this argument while handling the request |
|
863 | + 'validate_callback' => null, |
|
864 | + 'sanitize_callback' => null, |
|
865 | + ], |
|
866 | + 'order_by' => [ |
|
867 | + 'required' => false, |
|
868 | + 'default' => $default_orderby, |
|
869 | + 'type' => [ |
|
870 | + 'object', |
|
871 | + 'string', |
|
872 | + ],// because we accept a variety of types, WP core validation and sanitization |
|
873 | + // freaks out. We'll just validate this argument while handling the request |
|
874 | + 'validate_callback' => null, |
|
875 | + 'sanitize_callback' => null, |
|
876 | + ], |
|
877 | + 'group_by' => [ |
|
878 | + 'required' => false, |
|
879 | + 'default' => null, |
|
880 | + 'type' => [ |
|
881 | + 'object', |
|
882 | + 'string', |
|
883 | + ], |
|
884 | + // because we accept an almost infinite list of possible groupings, |
|
885 | + // WP core validation and sanitization |
|
886 | + // freaks out. We'll just validate this argument while handling the request |
|
887 | + 'validate_callback' => null, |
|
888 | + 'sanitize_callback' => null, |
|
889 | + ], |
|
890 | + 'having' => [ |
|
891 | + 'required' => false, |
|
892 | + 'default' => null, |
|
893 | + 'type' => 'object', |
|
894 | + // because we accept an almost infinite list of possible where conditions, WP |
|
895 | + // core validation and sanitization freaks out. We'll just validate this argument |
|
896 | + // while handling the request |
|
897 | + 'validate_callback' => null, |
|
898 | + 'sanitize_callback' => null, |
|
899 | + ], |
|
900 | + 'caps' => [ |
|
901 | + 'required' => false, |
|
902 | + 'default' => EEM_Base::caps_read, |
|
903 | + 'type' => 'string', |
|
904 | + 'enum' => [ |
|
905 | + EEM_Base::caps_read, |
|
906 | + EEM_Base::caps_read_admin, |
|
907 | + EEM_Base::caps_edit, |
|
908 | + EEM_Base::caps_delete, |
|
909 | + ], |
|
910 | + ], |
|
911 | + ] |
|
912 | + ); |
|
913 | + } |
|
914 | + |
|
915 | + |
|
916 | + /** |
|
917 | + * Gets parameter information for a model regarding writing data |
|
918 | + * |
|
919 | + * @param string $model_name |
|
920 | + * @param ModelVersionInfo $model_version_info |
|
921 | + * @param boolean $create whether this is for request to create (in |
|
922 | + * which case we need all required params) or |
|
923 | + * just to update (in which case we don't |
|
924 | + * need those on every request) |
|
925 | + * @return array |
|
926 | + * @throws EE_Error |
|
927 | + * @throws ReflectionException |
|
928 | + */ |
|
929 | + protected function _get_write_params( |
|
930 | + $model_name, |
|
931 | + ModelVersionInfo $model_version_info, |
|
932 | + $create = false |
|
933 | + ) { |
|
934 | + $model = EE_Registry::instance()->load_model($model_name); |
|
935 | + $fields = $model_version_info->fieldsOnModelInThisVersion($model); |
|
936 | + |
|
937 | + // we do our own validation and sanitization within the controller |
|
938 | + $sanitize_callback = function_exists('rest_validate_value_from_schema') |
|
939 | + ? ['EED_Core_Rest_Api', 'default_sanitize_callback'] |
|
940 | + : null; |
|
941 | + $args_info = []; |
|
942 | + foreach ($fields as $field_name => $field_obj) { |
|
943 | + if ($field_obj->is_auto_increment()) { |
|
944 | + // totally ignore auto increment IDs |
|
945 | + continue; |
|
946 | + } |
|
947 | + $arg_info = $field_obj->getSchema(); |
|
948 | + $required = $create && ! $field_obj->is_nullable() && $field_obj->get_default_value() === null; |
|
949 | + $arg_info['required'] = $required; |
|
950 | + // remove the read-only flag. If it were read-only we wouldn't list it as an argument while writing, right? |
|
951 | + unset($arg_info['readonly']); |
|
952 | + $schema_properties = $field_obj->getSchemaProperties(); |
|
953 | + if (isset($schema_properties['raw']) |
|
954 | + && $field_obj->getSchemaType() === 'object' |
|
955 | + ) { |
|
956 | + // if there's a "raw" form of this argument, use those properties instead |
|
957 | + $arg_info = array_replace( |
|
958 | + $arg_info, |
|
959 | + $schema_properties['raw'] |
|
960 | + ); |
|
961 | + } |
|
962 | + $arg_info['default'] = ModelDataTranslator::prepareFieldValueForJson( |
|
963 | + $field_obj, |
|
964 | + $field_obj->get_default_value(), |
|
965 | + $model_version_info->requestedVersion() |
|
966 | + ); |
|
967 | + $arg_info['sanitize_callback'] = $sanitize_callback; |
|
968 | + $args_info[ $field_name ] = $arg_info; |
|
969 | + if ($field_obj instanceof EE_Datetime_Field) { |
|
970 | + $gmt_arg_info = $arg_info; |
|
971 | + $gmt_arg_info['description'] = sprintf( |
|
972 | + esc_html__( |
|
973 | + '%1$s - the value for this field in UTC. Ignored if %2$s is provided.', |
|
974 | + 'event_espresso' |
|
975 | + ), |
|
976 | + $field_obj->get_nicename(), |
|
977 | + $field_name |
|
978 | + ); |
|
979 | + $args_info[ $field_name . '_gmt' ] = $gmt_arg_info; |
|
980 | + } |
|
981 | + } |
|
982 | + return $args_info; |
|
983 | + } |
|
984 | + |
|
985 | + |
|
986 | + /** |
|
987 | + * Replacement for WP API's 'rest_parse_request_arg'. |
|
988 | + * If the value is blank but not required, don't bother validating it. |
|
989 | + * Also, it uses our email validation instead of WP API's default. |
|
990 | + * |
|
991 | + * @param $value |
|
992 | + * @param WP_REST_Request $request |
|
993 | + * @param $param |
|
994 | + * @return bool|true|WP_Error |
|
995 | + * @throws InvalidArgumentException |
|
996 | + * @throws InvalidInterfaceException |
|
997 | + * @throws InvalidDataTypeException |
|
998 | + */ |
|
999 | + public static function default_sanitize_callback($value, WP_REST_Request $request, $param) |
|
1000 | + { |
|
1001 | + $attributes = $request->get_attributes(); |
|
1002 | + if (! isset($attributes['args'][ $param ]) |
|
1003 | + || ! is_array($attributes['args'][ $param ])) { |
|
1004 | + $validation_result = true; |
|
1005 | + } else { |
|
1006 | + $args = $attributes['args'][ $param ]; |
|
1007 | + if (( |
|
1008 | + $value === '' |
|
1009 | + || $value === null |
|
1010 | + ) |
|
1011 | + && (! isset($args['required']) |
|
1012 | + || $args['required'] === false |
|
1013 | + ) |
|
1014 | + ) { |
|
1015 | + // not required and not provided? that's cool |
|
1016 | + $validation_result = true; |
|
1017 | + } elseif (isset($args['format']) |
|
1018 | + && $args['format'] === 'email' |
|
1019 | + ) { |
|
1020 | + $validation_result = true; |
|
1021 | + if (! EED_Core_Rest_Api::_validate_email($value)) { |
|
1022 | + $validation_result = new WP_Error( |
|
1023 | + 'rest_invalid_param', |
|
1024 | + esc_html__( |
|
1025 | + 'The email address is not valid or does not exist.', |
|
1026 | + 'event_espresso' |
|
1027 | + ) |
|
1028 | + ); |
|
1029 | + } |
|
1030 | + } else { |
|
1031 | + $validation_result = rest_validate_value_from_schema($value, $args, $param); |
|
1032 | + } |
|
1033 | + } |
|
1034 | + if (is_wp_error($validation_result)) { |
|
1035 | + return $validation_result; |
|
1036 | + } |
|
1037 | + return rest_sanitize_request_arg($value, $request, $param); |
|
1038 | + } |
|
1039 | + |
|
1040 | + |
|
1041 | + /** |
|
1042 | + * Returns whether or not this email address is valid. Copied from EE_Email_Validation_Strategy::_validate_email() |
|
1043 | + * |
|
1044 | + * @param $email |
|
1045 | + * @return bool |
|
1046 | + * @throws InvalidArgumentException |
|
1047 | + * @throws InvalidInterfaceException |
|
1048 | + * @throws InvalidDataTypeException |
|
1049 | + */ |
|
1050 | + protected static function _validate_email($email) |
|
1051 | + { |
|
1052 | + try { |
|
1053 | + EmailAddressFactory::create($email); |
|
1054 | + return true; |
|
1055 | + } catch (EmailValidationException $e) { |
|
1056 | + return false; |
|
1057 | + } |
|
1058 | + } |
|
1059 | + |
|
1060 | + |
|
1061 | + /** |
|
1062 | + * Gets routes for the config |
|
1063 | + * |
|
1064 | + * @return array @see _register_model_routes |
|
1065 | + * @deprecated since version 4.9.1 |
|
1066 | + */ |
|
1067 | + protected function _register_config_routes() |
|
1068 | + { |
|
1069 | + $config_routes = []; |
|
1070 | + foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
1071 | + $config_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_config_route_data_for_version( |
|
1072 | + $version, |
|
1073 | + $hidden_endpoint |
|
1074 | + ); |
|
1075 | + } |
|
1076 | + return $config_routes; |
|
1077 | + } |
|
1078 | + |
|
1079 | + |
|
1080 | + /** |
|
1081 | + * Gets routes for the config for the specified version |
|
1082 | + * |
|
1083 | + * @param string $version |
|
1084 | + * @param boolean $hidden_endpoint |
|
1085 | + * @return array |
|
1086 | + */ |
|
1087 | + protected function _get_config_route_data_for_version($version, $hidden_endpoint) |
|
1088 | + { |
|
1089 | + return [ |
|
1090 | + 'config' => [ |
|
1091 | + [ |
|
1092 | + 'callback' => [ |
|
1093 | + 'EventEspresso\core\libraries\rest_api\controllers\config\Read', |
|
1094 | + 'handleRequest', |
|
1095 | + ], |
|
1096 | + 'methods' => WP_REST_Server::READABLE, |
|
1097 | + 'hidden_endpoint' => $hidden_endpoint, |
|
1098 | + 'callback_args' => [$version], |
|
1099 | + ], |
|
1100 | + ], |
|
1101 | + 'site_info' => [ |
|
1102 | + [ |
|
1103 | + 'callback' => [ |
|
1104 | + 'EventEspresso\core\libraries\rest_api\controllers\config\Read', |
|
1105 | + 'handleRequestSiteInfo', |
|
1106 | + ], |
|
1107 | + 'methods' => WP_REST_Server::READABLE, |
|
1108 | + 'hidden_endpoint' => $hidden_endpoint, |
|
1109 | + 'callback_args' => [$version], |
|
1110 | + ], |
|
1111 | + ], |
|
1112 | + ]; |
|
1113 | + } |
|
1114 | + |
|
1115 | + |
|
1116 | + /** |
|
1117 | + * Gets the meta info routes |
|
1118 | + * |
|
1119 | + * @return array @see _register_model_routes |
|
1120 | + * @deprecated since version 4.9.1 |
|
1121 | + */ |
|
1122 | + protected function _register_meta_routes() |
|
1123 | + { |
|
1124 | + $meta_routes = []; |
|
1125 | + foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
|
1126 | + $meta_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_meta_route_data_for_version( |
|
1127 | + $version, |
|
1128 | + $hidden_endpoint |
|
1129 | + ); |
|
1130 | + } |
|
1131 | + return $meta_routes; |
|
1132 | + } |
|
1133 | + |
|
1134 | + |
|
1135 | + /** |
|
1136 | + * @param string $version |
|
1137 | + * @param boolean $hidden_endpoint |
|
1138 | + * @return array |
|
1139 | + */ |
|
1140 | + protected function _get_meta_route_data_for_version($version, $hidden_endpoint = false) |
|
1141 | + { |
|
1142 | + return [ |
|
1143 | + 'resources' => [ |
|
1144 | + [ |
|
1145 | + 'callback' => [ |
|
1146 | + 'EventEspresso\core\libraries\rest_api\controllers\model\Meta', |
|
1147 | + 'handleRequestModelsMeta', |
|
1148 | + ], |
|
1149 | + 'methods' => WP_REST_Server::READABLE, |
|
1150 | + 'hidden_endpoint' => $hidden_endpoint, |
|
1151 | + 'callback_args' => [$version], |
|
1152 | + ], |
|
1153 | + ], |
|
1154 | + ]; |
|
1155 | + } |
|
1156 | + |
|
1157 | + |
|
1158 | + /** |
|
1159 | + * Tries to hide old 4.6 endpoints from the |
|
1160 | + * |
|
1161 | + * @param array $route_data |
|
1162 | + * @return array |
|
1163 | + * @throws EE_Error |
|
1164 | + * @throws ReflectionException |
|
1165 | + */ |
|
1166 | + public static function hide_old_endpoints($route_data) |
|
1167 | + { |
|
1168 | + // allow API clients to override which endpoints get hidden, in case |
|
1169 | + // they want to discover particular endpoints |
|
1170 | + // also, we don't have access to the request so we have to just grab it from the superglobal |
|
1171 | + $force_show_ee_namespace = ltrim( |
|
1172 | + EEH_Array::is_set($_REQUEST, 'force_show_ee_namespace', ''), |
|
1173 | + '/' |
|
1174 | + ); |
|
1175 | + foreach (EED_Core_Rest_Api::get_ee_route_data() as $namespace => $relative_urls) { |
|
1176 | + foreach ($relative_urls as $resource_name => $endpoints) { |
|
1177 | + foreach ($endpoints as $key => $endpoint) { |
|
1178 | + // skip schema and other route options |
|
1179 | + if (! is_numeric($key)) { |
|
1180 | + continue; |
|
1181 | + } |
|
1182 | + // by default, hide "hidden_endpoint"s, unless the request indicates |
|
1183 | + // to $force_show_ee_namespace, in which case only show that one |
|
1184 | + // namespace's endpoints (and hide all others) |
|
1185 | + if (($force_show_ee_namespace !== '' && $force_show_ee_namespace !== $namespace) |
|
1186 | + || ($endpoint['hidden_endpoint'] && $force_show_ee_namespace === '') |
|
1187 | + ) { |
|
1188 | + $full_route = '/' . ltrim($namespace, '/'); |
|
1189 | + $full_route .= '/' . ltrim($resource_name, '/'); |
|
1190 | + unset($route_data[ $full_route ]); |
|
1191 | + } |
|
1192 | + } |
|
1193 | + } |
|
1194 | + } |
|
1195 | + return $route_data; |
|
1196 | + } |
|
1197 | + |
|
1198 | + |
|
1199 | + /** |
|
1200 | + * Returns an array describing which versions of core support serving requests for. |
|
1201 | + * Keys are core versions' major and minor version, and values are the |
|
1202 | + * LOWEST requested version they can serve. Eg, 4.7 can serve requests for 4.6-like |
|
1203 | + * data by just removing a few models and fields from the responses. However, 4.15 might remove |
|
1204 | + * the answers table entirely, in which case it would be very difficult for |
|
1205 | + * it to serve 4.6-style responses. |
|
1206 | + * Versions of core that are missing from this array are unknowns. |
|
1207 | + * previous ver |
|
1208 | + * |
|
1209 | + * @return array |
|
1210 | + */ |
|
1211 | + public static function version_compatibilities() |
|
1212 | + { |
|
1213 | + return apply_filters( |
|
1214 | + 'FHEE__EED_Core_REST_API__version_compatibilities', |
|
1215 | + [ |
|
1216 | + '4.8.29' => '4.8.29', |
|
1217 | + '4.8.33' => '4.8.29', |
|
1218 | + '4.8.34' => '4.8.29', |
|
1219 | + '4.8.36' => '4.8.29', |
|
1220 | + ] |
|
1221 | + ); |
|
1222 | + } |
|
1223 | + |
|
1224 | + |
|
1225 | + /** |
|
1226 | + * Gets the latest API version served. Eg if there |
|
1227 | + * are two versions served of the API, 4.8.29 and 4.8.32, and |
|
1228 | + * we are on core version 4.8.34, it will return the string "4.8.32" |
|
1229 | + * |
|
1230 | + * @return string |
|
1231 | + */ |
|
1232 | + public static function latest_rest_api_version() |
|
1233 | + { |
|
1234 | + $versions_served = EED_Core_Rest_Api::versions_served(); |
|
1235 | + $versions_served_keys = array_keys($versions_served); |
|
1236 | + return end($versions_served_keys); |
|
1237 | + } |
|
1238 | + |
|
1239 | + |
|
1240 | + /** |
|
1241 | + * Using EED_Core_Rest_Api::version_compatibilities(), determines what version of |
|
1242 | + * EE the API can serve requests for. Eg, if we are on 4.15 of core, and |
|
1243 | + * we can serve requests from 4.12 or later, this will return array( '4.12', '4.13', '4.14', '4.15' ). |
|
1244 | + * We also indicate whether or not this version should be put in the index or not |
|
1245 | + * |
|
1246 | + * @return array keys are API version numbers (just major and minor numbers), and values |
|
1247 | + * are whether or not they should be hidden |
|
1248 | + */ |
|
1249 | + public static function versions_served() |
|
1250 | + { |
|
1251 | + $versions_served = []; |
|
1252 | + $possibly_served_versions = EED_Core_Rest_Api::version_compatibilities(); |
|
1253 | + $lowest_compatible_version = end($possibly_served_versions); |
|
1254 | + reset($possibly_served_versions); |
|
1255 | + $versions_served_historically = array_keys($possibly_served_versions); |
|
1256 | + $latest_version = end($versions_served_historically); |
|
1257 | + reset($versions_served_historically); |
|
1258 | + // for each version of core we have ever served: |
|
1259 | + foreach ($versions_served_historically as $key_versioned_endpoint) { |
|
1260 | + // if it's not above the current core version, and it's compatible with the current version of core |
|
1261 | + |
|
1262 | + if ($key_versioned_endpoint === $latest_version) { |
|
1263 | + // don't hide the latest version in the index |
|
1264 | + $versions_served[ $key_versioned_endpoint ] = false; |
|
1265 | + } elseif (version_compare($key_versioned_endpoint, $lowest_compatible_version, '>=') |
|
1266 | + && version_compare($key_versioned_endpoint, EED_Core_Rest_Api::core_version(), '<') |
|
1267 | + ) { |
|
1268 | + // include, but hide, previous versions which are still supported |
|
1269 | + $versions_served[ $key_versioned_endpoint ] = true; |
|
1270 | + } elseif (apply_filters( |
|
1271 | + 'FHEE__EED_Core_Rest_Api__versions_served__include_incompatible_versions', |
|
1272 | + false, |
|
1273 | + $possibly_served_versions |
|
1274 | + )) { |
|
1275 | + // if a version is no longer supported, don't include it in index or list of versions served |
|
1276 | + $versions_served[ $key_versioned_endpoint ] = true; |
|
1277 | + } |
|
1278 | + } |
|
1279 | + return $versions_served; |
|
1280 | + } |
|
1281 | + |
|
1282 | + |
|
1283 | + /** |
|
1284 | + * Gets the major and minor version of EE core's version string |
|
1285 | + * |
|
1286 | + * @return string |
|
1287 | + */ |
|
1288 | + public static function core_version() |
|
1289 | + { |
|
1290 | + return apply_filters( |
|
1291 | + 'FHEE__EED_Core_REST_API__core_version', |
|
1292 | + implode( |
|
1293 | + '.', |
|
1294 | + array_slice( |
|
1295 | + explode( |
|
1296 | + '.', |
|
1297 | + espresso_version() |
|
1298 | + ), |
|
1299 | + 0, |
|
1300 | + 3 |
|
1301 | + ) |
|
1302 | + ) |
|
1303 | + ); |
|
1304 | + } |
|
1305 | + |
|
1306 | + |
|
1307 | + /** |
|
1308 | + * Gets the default limit that should be used when querying for resources |
|
1309 | + * |
|
1310 | + * @return int |
|
1311 | + */ |
|
1312 | + public static function get_default_query_limit() |
|
1313 | + { |
|
1314 | + // we actually don't use a const because we want folks to always use |
|
1315 | + // this method, not the const directly |
|
1316 | + return apply_filters( |
|
1317 | + 'FHEE__EED_Core_Rest_Api__get_default_query_limit', |
|
1318 | + 50 |
|
1319 | + ); |
|
1320 | + } |
|
1321 | + |
|
1322 | + |
|
1323 | + /** |
|
1324 | + * @param string $version api version string (i.e. '4.8.36') |
|
1325 | + * @return array |
|
1326 | + */ |
|
1327 | + public static function getCollectionRoutesIndexedByModelName($version = '') |
|
1328 | + { |
|
1329 | + $version = empty($version) ? EED_Core_Rest_Api::latest_rest_api_version() : $version; |
|
1330 | + $model_names = EED_Core_Rest_Api::model_names_with_plural_routes($version); |
|
1331 | + $collection_routes = []; |
|
1332 | + foreach ($model_names as $model_name => $model_class_name) { |
|
1333 | + $collection_routes[ strtolower($model_name) ] = '/' . EED_Core_Rest_Api::ee_api_namespace . $version . '/' |
|
1334 | + . EEH_Inflector::pluralize_and_lower($model_name); |
|
1335 | + } |
|
1336 | + return $collection_routes; |
|
1337 | + } |
|
1338 | + |
|
1339 | + |
|
1340 | + /** |
|
1341 | + * Returns an array of primary key names indexed by model names. |
|
1342 | + * |
|
1343 | + * @param string $version |
|
1344 | + * @return array |
|
1345 | + */ |
|
1346 | + public static function getPrimaryKeyNamesIndexedByModelName($version = '') |
|
1347 | + { |
|
1348 | + $version = empty($version) ? EED_Core_Rest_Api::latest_rest_api_version() : $version; |
|
1349 | + $model_names = EED_Core_Rest_Api::model_names_with_plural_routes($version); |
|
1350 | + $primary_key_items = []; |
|
1351 | + foreach ($model_names as $model_name => $model_class_name) { |
|
1352 | + $primary_keys = $model_class_name::instance()->get_combined_primary_key_fields(); |
|
1353 | + foreach ($primary_keys as $primary_key_name => $primary_key_field) { |
|
1354 | + if (count($primary_keys) > 1) { |
|
1355 | + $primary_key_items[ strtolower($model_name) ][] = $primary_key_name; |
|
1356 | + } else { |
|
1357 | + $primary_key_items[ strtolower($model_name) ] = $primary_key_name; |
|
1358 | + } |
|
1359 | + } |
|
1360 | + } |
|
1361 | + return $primary_key_items; |
|
1362 | + } |
|
1363 | + |
|
1364 | + |
|
1365 | + /** |
|
1366 | + * Determines the EE REST API debug mode is activated, or not. |
|
1367 | + * |
|
1368 | + * @return bool |
|
1369 | + * @since 4.9.76.p |
|
1370 | + */ |
|
1371 | + public static function debugMode() |
|
1372 | + { |
|
1373 | + static $debug_mode = null; // could be class prop |
|
1374 | + if ($debug_mode === null) { |
|
1375 | + $debug_mode = defined('EE_REST_API_DEBUG_MODE') && EE_REST_API_DEBUG_MODE; |
|
1376 | + } |
|
1377 | + return $debug_mode; |
|
1378 | + } |
|
1379 | + |
|
1380 | + |
|
1381 | + /** |
|
1382 | + * run - initial module setup |
|
1383 | + * |
|
1384 | + * @access public |
|
1385 | + * @param WP $WP |
|
1386 | + * @return void |
|
1387 | + */ |
|
1388 | + public function run($WP) |
|
1389 | + { |
|
1390 | + } |
|
1391 | 1391 | } |
@@ -130,7 +130,7 @@ discard block |
||
130 | 130 | */ |
131 | 131 | protected static function _set_hooks_for_changes() |
132 | 132 | { |
133 | - $folder_contents = EEH_File::get_contents_of_folders([EE_LIBRARIES . 'rest_api/changes'], false); |
|
133 | + $folder_contents = EEH_File::get_contents_of_folders([EE_LIBRARIES.'rest_api/changes'], false); |
|
134 | 134 | foreach ($folder_contents as $classname_in_namespace => $filepath) { |
135 | 135 | // ignore the base parent class |
136 | 136 | // and legacy named classes |
@@ -139,7 +139,7 @@ discard block |
||
139 | 139 | ) { |
140 | 140 | continue; |
141 | 141 | } |
142 | - $full_classname = 'EventEspresso\core\libraries\rest_api\changes\\' . $classname_in_namespace; |
|
142 | + $full_classname = 'EventEspresso\core\libraries\rest_api\changes\\'.$classname_in_namespace; |
|
143 | 143 | if (class_exists($full_classname)) { |
144 | 144 | $instance_of_class = new $full_classname; |
145 | 145 | if ($instance_of_class instanceof ChangesInBase) { |
@@ -185,10 +185,10 @@ discard block |
||
185 | 185 | * } |
186 | 186 | */ |
187 | 187 | // skip route options |
188 | - if (! is_numeric($endpoint_key)) { |
|
188 | + if ( ! is_numeric($endpoint_key)) { |
|
189 | 189 | continue; |
190 | 190 | } |
191 | - if (! isset($data_for_single_endpoint['callback'], $data_for_single_endpoint['methods'])) { |
|
191 | + if ( ! isset($data_for_single_endpoint['callback'], $data_for_single_endpoint['methods'])) { |
|
192 | 192 | throw new EE_Error( |
193 | 193 | esc_html__( |
194 | 194 | // @codingStandardsIgnoreStart |
@@ -209,7 +209,7 @@ discard block |
||
209 | 209 | } |
210 | 210 | if (isset($data_for_single_endpoint['callback_args'])) { |
211 | 211 | $callback_args = $data_for_single_endpoint['callback_args']; |
212 | - $single_endpoint_args['callback'] = static function (WP_REST_Request $request) use ( |
|
212 | + $single_endpoint_args['callback'] = static function(WP_REST_Request $request) use ( |
|
213 | 213 | $callback, |
214 | 214 | $callback_args |
215 | 215 | ) { |
@@ -226,7 +226,7 @@ discard block |
||
226 | 226 | // the REST API will issue a _doing_it_wrong notice. |
227 | 227 | // Since the EE REST API defers capabilities to the db model system, |
228 | 228 | // we will just use the generic WP callback for public endpoints |
229 | - if (! isset($single_endpoint_args['permission_callback'])) { |
|
229 | + if ( ! isset($single_endpoint_args['permission_callback'])) { |
|
230 | 230 | $single_endpoint_args['permission_callback'] = '__return_true'; |
231 | 231 | } |
232 | 232 | $multiple_endpoint_args[] = $single_endpoint_args; |
@@ -235,7 +235,7 @@ discard block |
||
235 | 235 | $schema_route_data = $data_for_multiple_endpoints['schema']; |
236 | 236 | $schema_callback = $schema_route_data['schema_callback']; |
237 | 237 | $callback_args = $schema_route_data['callback_args']; |
238 | - $multiple_endpoint_args['schema'] = static function () use ($schema_callback, $callback_args) { |
|
238 | + $multiple_endpoint_args['schema'] = static function() use ($schema_callback, $callback_args) { |
|
239 | 239 | return call_user_func_array( |
240 | 240 | $schema_callback, |
241 | 241 | $callback_args |
@@ -277,7 +277,7 @@ discard block |
||
277 | 277 | { |
278 | 278 | // delete the saved EE REST API routes |
279 | 279 | foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden) { |
280 | - delete_option(EED_Core_Rest_Api::saved_routes_option_names . $version); |
|
280 | + delete_option(EED_Core_Rest_Api::saved_routes_option_names.$version); |
|
281 | 281 | } |
282 | 282 | } |
283 | 283 | |
@@ -297,7 +297,7 @@ discard block |
||
297 | 297 | { |
298 | 298 | $ee_routes = []; |
299 | 299 | foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoints) { |
300 | - $ee_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = EED_Core_Rest_Api::_get_ee_route_data_for_version( |
|
300 | + $ee_routes[EED_Core_Rest_Api::ee_api_namespace.$version] = EED_Core_Rest_Api::_get_ee_route_data_for_version( |
|
301 | 301 | $version, |
302 | 302 | $hidden_endpoints |
303 | 303 | ); |
@@ -318,8 +318,8 @@ discard block |
||
318 | 318 | */ |
319 | 319 | protected static function _get_ee_route_data_for_version($version, $hidden_endpoints = false) |
320 | 320 | { |
321 | - $ee_routes = get_option(EED_Core_Rest_Api::saved_routes_option_names . $version, null); |
|
322 | - if (! $ee_routes || EED_Core_Rest_Api::debugMode()) { |
|
321 | + $ee_routes = get_option(EED_Core_Rest_Api::saved_routes_option_names.$version, null); |
|
322 | + if ( ! $ee_routes || EED_Core_Rest_Api::debugMode()) { |
|
323 | 323 | $ee_routes = EED_Core_Rest_Api::_save_ee_route_data_for_version($version, $hidden_endpoints); |
324 | 324 | } |
325 | 325 | return $ee_routes; |
@@ -347,7 +347,7 @@ discard block |
||
347 | 347 | $instance->_get_rpc_route_data_for_version($version, $hidden_endpoints) |
348 | 348 | ) |
349 | 349 | ); |
350 | - $option_name = EED_Core_Rest_Api::saved_routes_option_names . $version; |
|
350 | + $option_name = EED_Core_Rest_Api::saved_routes_option_names.$version; |
|
351 | 351 | if (get_option($option_name)) { |
352 | 352 | update_option($option_name, $routes, true); |
353 | 353 | } else { |
@@ -392,8 +392,8 @@ discard block |
||
392 | 392 | { |
393 | 393 | $model_routes = []; |
394 | 394 | foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
395 | - $model_routes[ EED_Core_Rest_Api::ee_api_namespace |
|
396 | - . $version ] = $this->_get_config_route_data_for_version($version, $hidden_endpoint); |
|
395 | + $model_routes[EED_Core_Rest_Api::ee_api_namespace |
|
396 | + . $version] = $this->_get_config_route_data_for_version($version, $hidden_endpoint); |
|
397 | 397 | } |
398 | 398 | return $model_routes; |
399 | 399 | } |
@@ -462,13 +462,13 @@ discard block |
||
462 | 462 | foreach (EED_Core_Rest_Api::model_names_with_plural_routes($version) as $model_name => $model_classname) { |
463 | 463 | $model = EE_Registry::instance()->load_model($model_name); |
464 | 464 | // if this isn't a valid model then let's skip iterate to the next item in the loop. |
465 | - if (! $model instanceof EEM_Base) { |
|
465 | + if ( ! $model instanceof EEM_Base) { |
|
466 | 466 | continue; |
467 | 467 | } |
468 | 468 | // yes we could just register one route for ALL models, but then they wouldn't show up in the index |
469 | 469 | $plural_model_route = EED_Core_Rest_Api::get_collection_route($model); |
470 | 470 | $singular_model_route = EED_Core_Rest_Api::get_entity_route($model, '(?P<id>[^\/]+)'); |
471 | - $model_routes[ $plural_model_route ] = [ |
|
471 | + $model_routes[$plural_model_route] = [ |
|
472 | 472 | [ |
473 | 473 | 'callback' => [ |
474 | 474 | 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
@@ -479,7 +479,7 @@ discard block |
||
479 | 479 | 'hidden_endpoint' => $hidden_endpoint, |
480 | 480 | 'args' => $this->_get_read_query_params($model, $version), |
481 | 481 | '_links' => [ |
482 | - 'self' => rest_url(EED_Core_Rest_Api::ee_api_namespace . $version . $singular_model_route), |
|
482 | + 'self' => rest_url(EED_Core_Rest_Api::ee_api_namespace.$version.$singular_model_route), |
|
483 | 483 | ], |
484 | 484 | ], |
485 | 485 | 'schema' => [ |
@@ -490,7 +490,7 @@ discard block |
||
490 | 490 | 'callback_args' => [$version, $model_name], |
491 | 491 | ], |
492 | 492 | ]; |
493 | - $model_routes[ $singular_model_route ] = [ |
|
493 | + $model_routes[$singular_model_route] = [ |
|
494 | 494 | [ |
495 | 495 | 'callback' => [ |
496 | 496 | 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | EED_Core_Rest_Api::should_have_write_endpoints($model), |
508 | 508 | $model |
509 | 509 | )) { |
510 | - $model_routes[ $plural_model_route ][] = [ |
|
510 | + $model_routes[$plural_model_route][] = [ |
|
511 | 511 | 'callback' => [ |
512 | 512 | 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
513 | 513 | 'handleRequestInsert', |
@@ -517,8 +517,8 @@ discard block |
||
517 | 517 | 'hidden_endpoint' => $hidden_endpoint, |
518 | 518 | 'args' => $this->_get_write_params($model_name, $model_version_info, true), |
519 | 519 | ]; |
520 | - $model_routes[ $singular_model_route ] = array_merge( |
|
521 | - $model_routes[ $singular_model_route ], |
|
520 | + $model_routes[$singular_model_route] = array_merge( |
|
521 | + $model_routes[$singular_model_route], |
|
522 | 522 | [ |
523 | 523 | [ |
524 | 524 | 'callback' => [ |
@@ -549,7 +549,7 @@ discard block |
||
549 | 549 | '(?P<id>[^\/]+)', |
550 | 550 | $relation_obj |
551 | 551 | ); |
552 | - $model_routes[ $related_route ] = [ |
|
552 | + $model_routes[$related_route] = [ |
|
553 | 553 | [ |
554 | 554 | 'callback' => [ |
555 | 555 | 'EventEspresso\core\libraries\rest_api\controllers\model\Read', |
@@ -562,8 +562,8 @@ discard block |
||
562 | 562 | ], |
563 | 563 | ]; |
564 | 564 | |
565 | - $related_write_route = $related_route . '/' . '(?P<related_id>[^\/]+)'; |
|
566 | - $model_routes[ $related_write_route ] = [ |
|
565 | + $related_write_route = $related_route.'/'.'(?P<related_id>[^\/]+)'; |
|
566 | + $model_routes[$related_write_route] = [ |
|
567 | 567 | [ |
568 | 568 | 'callback' => [ |
569 | 569 | 'EventEspresso\core\libraries\rest_api\controllers\model\Write', |
@@ -620,7 +620,7 @@ discard block |
||
620 | 620 | */ |
621 | 621 | public static function get_entity_route($model, $id) |
622 | 622 | { |
623 | - return EED_Core_Rest_Api::get_collection_route($model) . '/' . $id; |
|
623 | + return EED_Core_Rest_Api::get_collection_route($model).'/'.$id; |
|
624 | 624 | } |
625 | 625 | |
626 | 626 | |
@@ -640,7 +640,7 @@ discard block |
||
640 | 640 | $relation_obj->get_other_model()->get_this_model_name(), |
641 | 641 | $relation_obj |
642 | 642 | ); |
643 | - return EED_Core_Rest_Api::get_entity_route($model, $id) . '/' . $related_model_name_endpoint_part; |
|
643 | + return EED_Core_Rest_Api::get_entity_route($model, $id).'/'.$related_model_name_endpoint_part; |
|
644 | 644 | } |
645 | 645 | |
646 | 646 | |
@@ -654,7 +654,7 @@ discard block |
||
654 | 654 | */ |
655 | 655 | public static function get_versioned_route_to($relative_route, $version = '4.8.36') |
656 | 656 | { |
657 | - return '/' . EED_Core_Rest_Api::ee_api_namespace . $version . '/' . $relative_route; |
|
657 | + return '/'.EED_Core_Rest_Api::ee_api_namespace.$version.'/'.$relative_route; |
|
658 | 658 | } |
659 | 659 | |
660 | 660 | |
@@ -668,7 +668,7 @@ discard block |
||
668 | 668 | { |
669 | 669 | $routes = []; |
670 | 670 | foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
671 | - $routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_rpc_route_data_for_version( |
|
671 | + $routes[EED_Core_Rest_Api::ee_api_namespace.$version] = $this->_get_rpc_route_data_for_version( |
|
672 | 672 | $version, |
673 | 673 | $hidden_endpoint |
674 | 674 | ); |
@@ -801,12 +801,12 @@ discard block |
||
801 | 801 | { |
802 | 802 | // if they're related through a HABTM relation, check for any non-FKs |
803 | 803 | $all_relation_settings = $source_model->relation_settings(); |
804 | - $relation_settings = $all_relation_settings[ $related_model->get_this_model_name() ]; |
|
804 | + $relation_settings = $all_relation_settings[$related_model->get_this_model_name()]; |
|
805 | 805 | $params = []; |
806 | 806 | if ($relation_settings instanceof EE_HABTM_Relation && $relation_settings->hasNonKeyFields()) { |
807 | 807 | foreach ($relation_settings->getNonKeyFields() as $field) { |
808 | 808 | /* @var $field EE_Model_Field_Base */ |
809 | - $params[ $field->get_name() ] = [ |
|
809 | + $params[$field->get_name()] = [ |
|
810 | 810 | 'required' => ! $field->is_nullable(), |
811 | 811 | 'default' => ModelDataTranslator::prepareFieldValueForJson( |
812 | 812 | $field, |
@@ -835,7 +835,7 @@ discard block |
||
835 | 835 | { |
836 | 836 | $default_orderby = []; |
837 | 837 | foreach ($model->get_combined_primary_key_fields() as $key_field) { |
838 | - $default_orderby[ $key_field->get_name() ] = 'ASC'; |
|
838 | + $default_orderby[$key_field->get_name()] = 'ASC'; |
|
839 | 839 | } |
840 | 840 | return array_merge( |
841 | 841 | $this->_get_response_selection_query_params($model, $version), |
@@ -869,7 +869,7 @@ discard block |
||
869 | 869 | 'type' => [ |
870 | 870 | 'object', |
871 | 871 | 'string', |
872 | - ],// because we accept a variety of types, WP core validation and sanitization |
|
872 | + ], // because we accept a variety of types, WP core validation and sanitization |
|
873 | 873 | // freaks out. We'll just validate this argument while handling the request |
874 | 874 | 'validate_callback' => null, |
875 | 875 | 'sanitize_callback' => null, |
@@ -965,7 +965,7 @@ discard block |
||
965 | 965 | $model_version_info->requestedVersion() |
966 | 966 | ); |
967 | 967 | $arg_info['sanitize_callback'] = $sanitize_callback; |
968 | - $args_info[ $field_name ] = $arg_info; |
|
968 | + $args_info[$field_name] = $arg_info; |
|
969 | 969 | if ($field_obj instanceof EE_Datetime_Field) { |
970 | 970 | $gmt_arg_info = $arg_info; |
971 | 971 | $gmt_arg_info['description'] = sprintf( |
@@ -976,7 +976,7 @@ discard block |
||
976 | 976 | $field_obj->get_nicename(), |
977 | 977 | $field_name |
978 | 978 | ); |
979 | - $args_info[ $field_name . '_gmt' ] = $gmt_arg_info; |
|
979 | + $args_info[$field_name.'_gmt'] = $gmt_arg_info; |
|
980 | 980 | } |
981 | 981 | } |
982 | 982 | return $args_info; |
@@ -999,16 +999,16 @@ discard block |
||
999 | 999 | public static function default_sanitize_callback($value, WP_REST_Request $request, $param) |
1000 | 1000 | { |
1001 | 1001 | $attributes = $request->get_attributes(); |
1002 | - if (! isset($attributes['args'][ $param ]) |
|
1003 | - || ! is_array($attributes['args'][ $param ])) { |
|
1002 | + if ( ! isset($attributes['args'][$param]) |
|
1003 | + || ! is_array($attributes['args'][$param])) { |
|
1004 | 1004 | $validation_result = true; |
1005 | 1005 | } else { |
1006 | - $args = $attributes['args'][ $param ]; |
|
1006 | + $args = $attributes['args'][$param]; |
|
1007 | 1007 | if (( |
1008 | 1008 | $value === '' |
1009 | 1009 | || $value === null |
1010 | 1010 | ) |
1011 | - && (! isset($args['required']) |
|
1011 | + && ( ! isset($args['required']) |
|
1012 | 1012 | || $args['required'] === false |
1013 | 1013 | ) |
1014 | 1014 | ) { |
@@ -1018,7 +1018,7 @@ discard block |
||
1018 | 1018 | && $args['format'] === 'email' |
1019 | 1019 | ) { |
1020 | 1020 | $validation_result = true; |
1021 | - if (! EED_Core_Rest_Api::_validate_email($value)) { |
|
1021 | + if ( ! EED_Core_Rest_Api::_validate_email($value)) { |
|
1022 | 1022 | $validation_result = new WP_Error( |
1023 | 1023 | 'rest_invalid_param', |
1024 | 1024 | esc_html__( |
@@ -1068,7 +1068,7 @@ discard block |
||
1068 | 1068 | { |
1069 | 1069 | $config_routes = []; |
1070 | 1070 | foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
1071 | - $config_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_config_route_data_for_version( |
|
1071 | + $config_routes[EED_Core_Rest_Api::ee_api_namespace.$version] = $this->_get_config_route_data_for_version( |
|
1072 | 1072 | $version, |
1073 | 1073 | $hidden_endpoint |
1074 | 1074 | ); |
@@ -1123,7 +1123,7 @@ discard block |
||
1123 | 1123 | { |
1124 | 1124 | $meta_routes = []; |
1125 | 1125 | foreach (EED_Core_Rest_Api::versions_served() as $version => $hidden_endpoint) { |
1126 | - $meta_routes[ EED_Core_Rest_Api::ee_api_namespace . $version ] = $this->_get_meta_route_data_for_version( |
|
1126 | + $meta_routes[EED_Core_Rest_Api::ee_api_namespace.$version] = $this->_get_meta_route_data_for_version( |
|
1127 | 1127 | $version, |
1128 | 1128 | $hidden_endpoint |
1129 | 1129 | ); |
@@ -1176,7 +1176,7 @@ discard block |
||
1176 | 1176 | foreach ($relative_urls as $resource_name => $endpoints) { |
1177 | 1177 | foreach ($endpoints as $key => $endpoint) { |
1178 | 1178 | // skip schema and other route options |
1179 | - if (! is_numeric($key)) { |
|
1179 | + if ( ! is_numeric($key)) { |
|
1180 | 1180 | continue; |
1181 | 1181 | } |
1182 | 1182 | // by default, hide "hidden_endpoint"s, unless the request indicates |
@@ -1185,9 +1185,9 @@ discard block |
||
1185 | 1185 | if (($force_show_ee_namespace !== '' && $force_show_ee_namespace !== $namespace) |
1186 | 1186 | || ($endpoint['hidden_endpoint'] && $force_show_ee_namespace === '') |
1187 | 1187 | ) { |
1188 | - $full_route = '/' . ltrim($namespace, '/'); |
|
1189 | - $full_route .= '/' . ltrim($resource_name, '/'); |
|
1190 | - unset($route_data[ $full_route ]); |
|
1188 | + $full_route = '/'.ltrim($namespace, '/'); |
|
1189 | + $full_route .= '/'.ltrim($resource_name, '/'); |
|
1190 | + unset($route_data[$full_route]); |
|
1191 | 1191 | } |
1192 | 1192 | } |
1193 | 1193 | } |
@@ -1261,19 +1261,19 @@ discard block |
||
1261 | 1261 | |
1262 | 1262 | if ($key_versioned_endpoint === $latest_version) { |
1263 | 1263 | // don't hide the latest version in the index |
1264 | - $versions_served[ $key_versioned_endpoint ] = false; |
|
1264 | + $versions_served[$key_versioned_endpoint] = false; |
|
1265 | 1265 | } elseif (version_compare($key_versioned_endpoint, $lowest_compatible_version, '>=') |
1266 | 1266 | && version_compare($key_versioned_endpoint, EED_Core_Rest_Api::core_version(), '<') |
1267 | 1267 | ) { |
1268 | 1268 | // include, but hide, previous versions which are still supported |
1269 | - $versions_served[ $key_versioned_endpoint ] = true; |
|
1269 | + $versions_served[$key_versioned_endpoint] = true; |
|
1270 | 1270 | } elseif (apply_filters( |
1271 | 1271 | 'FHEE__EED_Core_Rest_Api__versions_served__include_incompatible_versions', |
1272 | 1272 | false, |
1273 | 1273 | $possibly_served_versions |
1274 | 1274 | )) { |
1275 | 1275 | // if a version is no longer supported, don't include it in index or list of versions served |
1276 | - $versions_served[ $key_versioned_endpoint ] = true; |
|
1276 | + $versions_served[$key_versioned_endpoint] = true; |
|
1277 | 1277 | } |
1278 | 1278 | } |
1279 | 1279 | return $versions_served; |
@@ -1330,7 +1330,7 @@ discard block |
||
1330 | 1330 | $model_names = EED_Core_Rest_Api::model_names_with_plural_routes($version); |
1331 | 1331 | $collection_routes = []; |
1332 | 1332 | foreach ($model_names as $model_name => $model_class_name) { |
1333 | - $collection_routes[ strtolower($model_name) ] = '/' . EED_Core_Rest_Api::ee_api_namespace . $version . '/' |
|
1333 | + $collection_routes[strtolower($model_name)] = '/'.EED_Core_Rest_Api::ee_api_namespace.$version.'/' |
|
1334 | 1334 | . EEH_Inflector::pluralize_and_lower($model_name); |
1335 | 1335 | } |
1336 | 1336 | return $collection_routes; |
@@ -1352,9 +1352,9 @@ discard block |
||
1352 | 1352 | $primary_keys = $model_class_name::instance()->get_combined_primary_key_fields(); |
1353 | 1353 | foreach ($primary_keys as $primary_key_name => $primary_key_field) { |
1354 | 1354 | if (count($primary_keys) > 1) { |
1355 | - $primary_key_items[ strtolower($model_name) ][] = $primary_key_name; |
|
1355 | + $primary_key_items[strtolower($model_name)][] = $primary_key_name; |
|
1356 | 1356 | } else { |
1357 | - $primary_key_items[ strtolower($model_name) ] = $primary_key_name; |
|
1357 | + $primary_key_items[strtolower($model_name)] = $primary_key_name; |
|
1358 | 1358 | } |
1359 | 1359 | } |
1360 | 1360 | } |
@@ -26,122 +26,122 @@ |
||
26 | 26 | { |
27 | 27 | |
28 | 28 | |
29 | - /** |
|
30 | - * @param WP_REST_Request $request |
|
31 | - * @param string $version |
|
32 | - * @return array|WP_REST_Response |
|
33 | - */ |
|
34 | - public static function handleRequestModelsMeta(WP_REST_Request $request, $version) |
|
35 | - { |
|
36 | - $controller = new Meta(); |
|
37 | - try { |
|
38 | - $controller->setRequestedVersion($version); |
|
39 | - return $controller->sendResponse($controller->getModelsMetadataEntity()); |
|
40 | - } catch (Exception $e) { |
|
41 | - return $controller->sendResponse($e); |
|
42 | - } |
|
43 | - } |
|
29 | + /** |
|
30 | + * @param WP_REST_Request $request |
|
31 | + * @param string $version |
|
32 | + * @return array|WP_REST_Response |
|
33 | + */ |
|
34 | + public static function handleRequestModelsMeta(WP_REST_Request $request, $version) |
|
35 | + { |
|
36 | + $controller = new Meta(); |
|
37 | + try { |
|
38 | + $controller->setRequestedVersion($version); |
|
39 | + return $controller->sendResponse($controller->getModelsMetadataEntity()); |
|
40 | + } catch (Exception $e) { |
|
41 | + return $controller->sendResponse($e); |
|
42 | + } |
|
43 | + } |
|
44 | 44 | |
45 | 45 | |
46 | - /* |
|
46 | + /* |
|
47 | 47 | * Gets the model metadata resource entity |
48 | 48 | * @return array for JSON response, describing all the models available in teh requested version |
49 | 49 | */ |
50 | - protected function getModelsMetadataEntity() |
|
51 | - { |
|
52 | - $response = array(); |
|
53 | - foreach ($this->getModelVersionInfo()->modelsForRequestedVersion() as $model_name => $model_classname) { |
|
54 | - $model = $this->getModelVersionInfo()->loadModel($model_name); |
|
55 | - $fields_json = array(); |
|
56 | - foreach ($this->getModelVersionInfo()->fieldsOnModelInThisVersion($model) as $field_name => $field_obj) { |
|
57 | - if ($this->getModelVersionInfo()->fieldIsIgnored($field_obj)) { |
|
58 | - continue; |
|
59 | - } |
|
60 | - if ($field_obj instanceof EE_Boolean_Field) { |
|
61 | - $datatype = 'Boolean'; |
|
62 | - } elseif ($field_obj->get_wpdb_data_type() == '%d') { |
|
63 | - $datatype = 'Number'; |
|
64 | - } elseif ($field_name instanceof EE_Serialized_Text_Field) { |
|
65 | - $datatype = 'Object'; |
|
66 | - } else { |
|
67 | - $datatype = 'String'; |
|
68 | - } |
|
69 | - $default_value = ModelDataTranslator::prepareFieldValueForJson( |
|
70 | - $field_obj, |
|
71 | - $field_obj->get_default_value(), |
|
72 | - $this->getModelVersionInfo()->requestedVersion() |
|
73 | - ); |
|
74 | - $field_json = array( |
|
75 | - 'name' => $field_name, |
|
76 | - 'nicename' => wp_specialchars_decode($field_obj->get_nicename(), ENT_QUOTES), |
|
77 | - 'has_rendered_format' => $this->getModelVersionInfo()->fieldHasRenderedFormat($field_obj), |
|
78 | - 'has_pretty_format' => $this->getModelVersionInfo()->fieldHasPrettyFormat($field_obj), |
|
79 | - 'type' => str_replace('EE_', '', get_class($field_obj)), |
|
80 | - 'datatype' => $datatype, |
|
81 | - 'nullable' => $field_obj->is_nullable(), |
|
82 | - 'default' => $default_value, |
|
83 | - 'table_alias' => $field_obj->get_table_alias(), |
|
84 | - 'table_column' => $field_obj->get_table_column(), |
|
85 | - ); |
|
86 | - $fields_json[ $field_json['name'] ] = $field_json; |
|
87 | - } |
|
88 | - $fields_json = array_merge( |
|
89 | - $fields_json, |
|
90 | - $this->getModelVersionInfo()->extraResourcePropertiesForModel($model) |
|
91 | - ); |
|
92 | - $response[ $model_name ]['fields'] = apply_filters( |
|
93 | - 'FHEE__Meta__handle_request_models_meta__fields', |
|
94 | - $fields_json, |
|
95 | - $model |
|
96 | - ); |
|
97 | - $relations_json = array(); |
|
98 | - foreach ($model->relation_settings() as $relation_name => $relation_obj) { |
|
99 | - $relation_json = array( |
|
100 | - 'name' => $relation_name, |
|
101 | - 'type' => str_replace('EE_', '', get_class($relation_obj)), |
|
102 | - 'single' => $relation_obj instanceof EE_Belongs_To_Relation, |
|
103 | - ); |
|
104 | - $relations_json[ $relation_name ] = $relation_json; |
|
105 | - } |
|
106 | - $response[ $model_name ]['relations'] = apply_filters( |
|
107 | - 'FHEE__Meta__handle_request_models_meta__relations', |
|
108 | - $relations_json, |
|
109 | - $model |
|
110 | - ); |
|
111 | - } |
|
112 | - return $response; |
|
113 | - } |
|
50 | + protected function getModelsMetadataEntity() |
|
51 | + { |
|
52 | + $response = array(); |
|
53 | + foreach ($this->getModelVersionInfo()->modelsForRequestedVersion() as $model_name => $model_classname) { |
|
54 | + $model = $this->getModelVersionInfo()->loadModel($model_name); |
|
55 | + $fields_json = array(); |
|
56 | + foreach ($this->getModelVersionInfo()->fieldsOnModelInThisVersion($model) as $field_name => $field_obj) { |
|
57 | + if ($this->getModelVersionInfo()->fieldIsIgnored($field_obj)) { |
|
58 | + continue; |
|
59 | + } |
|
60 | + if ($field_obj instanceof EE_Boolean_Field) { |
|
61 | + $datatype = 'Boolean'; |
|
62 | + } elseif ($field_obj->get_wpdb_data_type() == '%d') { |
|
63 | + $datatype = 'Number'; |
|
64 | + } elseif ($field_name instanceof EE_Serialized_Text_Field) { |
|
65 | + $datatype = 'Object'; |
|
66 | + } else { |
|
67 | + $datatype = 'String'; |
|
68 | + } |
|
69 | + $default_value = ModelDataTranslator::prepareFieldValueForJson( |
|
70 | + $field_obj, |
|
71 | + $field_obj->get_default_value(), |
|
72 | + $this->getModelVersionInfo()->requestedVersion() |
|
73 | + ); |
|
74 | + $field_json = array( |
|
75 | + 'name' => $field_name, |
|
76 | + 'nicename' => wp_specialchars_decode($field_obj->get_nicename(), ENT_QUOTES), |
|
77 | + 'has_rendered_format' => $this->getModelVersionInfo()->fieldHasRenderedFormat($field_obj), |
|
78 | + 'has_pretty_format' => $this->getModelVersionInfo()->fieldHasPrettyFormat($field_obj), |
|
79 | + 'type' => str_replace('EE_', '', get_class($field_obj)), |
|
80 | + 'datatype' => $datatype, |
|
81 | + 'nullable' => $field_obj->is_nullable(), |
|
82 | + 'default' => $default_value, |
|
83 | + 'table_alias' => $field_obj->get_table_alias(), |
|
84 | + 'table_column' => $field_obj->get_table_column(), |
|
85 | + ); |
|
86 | + $fields_json[ $field_json['name'] ] = $field_json; |
|
87 | + } |
|
88 | + $fields_json = array_merge( |
|
89 | + $fields_json, |
|
90 | + $this->getModelVersionInfo()->extraResourcePropertiesForModel($model) |
|
91 | + ); |
|
92 | + $response[ $model_name ]['fields'] = apply_filters( |
|
93 | + 'FHEE__Meta__handle_request_models_meta__fields', |
|
94 | + $fields_json, |
|
95 | + $model |
|
96 | + ); |
|
97 | + $relations_json = array(); |
|
98 | + foreach ($model->relation_settings() as $relation_name => $relation_obj) { |
|
99 | + $relation_json = array( |
|
100 | + 'name' => $relation_name, |
|
101 | + 'type' => str_replace('EE_', '', get_class($relation_obj)), |
|
102 | + 'single' => $relation_obj instanceof EE_Belongs_To_Relation, |
|
103 | + ); |
|
104 | + $relations_json[ $relation_name ] = $relation_json; |
|
105 | + } |
|
106 | + $response[ $model_name ]['relations'] = apply_filters( |
|
107 | + 'FHEE__Meta__handle_request_models_meta__relations', |
|
108 | + $relations_json, |
|
109 | + $model |
|
110 | + ); |
|
111 | + } |
|
112 | + return $response; |
|
113 | + } |
|
114 | 114 | |
115 | 115 | |
116 | - /** |
|
117 | - * Adds EE metadata to the index |
|
118 | - * |
|
119 | - * @param WP_REST_Response $rest_response_obj |
|
120 | - * @return WP_REST_Response |
|
121 | - */ |
|
122 | - public static function filterEeMetadataIntoIndex(WP_REST_Response $rest_response_obj) |
|
123 | - { |
|
124 | - $response_data = $rest_response_obj->get_data(); |
|
125 | - $addons = array(); |
|
126 | - foreach (EE_Registry::instance()->addons as $addon) { |
|
127 | - $addon_json = array( |
|
128 | - 'name' => $addon->name(), |
|
129 | - 'version' => $addon->version(), |
|
130 | - ); |
|
131 | - $addons[ $addon_json['name'] ] = $addon_json; |
|
132 | - } |
|
133 | - $response_data['ee'] = array( |
|
134 | - 'version' => EEM_System_Status::instance()->get_ee_version(), |
|
135 | - // @codingStandardsIgnoreStart |
|
136 | - 'documentation_url' => 'https://github.com/eventespresso/event-espresso-core/tree/master/docs/C--REST-API', |
|
137 | - // @codingStandardsIgnoreEnd |
|
138 | - 'addons' => $addons, |
|
139 | - 'maintenance_mode' => EE_Maintenance_Mode::instance()->real_level(), |
|
140 | - 'served_core_versions' => array_keys(EED_Core_Rest_Api::versions_served()), |
|
141 | - ); |
|
142 | - $rest_response_obj->set_data($response_data); |
|
143 | - return $rest_response_obj; |
|
144 | - } |
|
116 | + /** |
|
117 | + * Adds EE metadata to the index |
|
118 | + * |
|
119 | + * @param WP_REST_Response $rest_response_obj |
|
120 | + * @return WP_REST_Response |
|
121 | + */ |
|
122 | + public static function filterEeMetadataIntoIndex(WP_REST_Response $rest_response_obj) |
|
123 | + { |
|
124 | + $response_data = $rest_response_obj->get_data(); |
|
125 | + $addons = array(); |
|
126 | + foreach (EE_Registry::instance()->addons as $addon) { |
|
127 | + $addon_json = array( |
|
128 | + 'name' => $addon->name(), |
|
129 | + 'version' => $addon->version(), |
|
130 | + ); |
|
131 | + $addons[ $addon_json['name'] ] = $addon_json; |
|
132 | + } |
|
133 | + $response_data['ee'] = array( |
|
134 | + 'version' => EEM_System_Status::instance()->get_ee_version(), |
|
135 | + // @codingStandardsIgnoreStart |
|
136 | + 'documentation_url' => 'https://github.com/eventespresso/event-espresso-core/tree/master/docs/C--REST-API', |
|
137 | + // @codingStandardsIgnoreEnd |
|
138 | + 'addons' => $addons, |
|
139 | + 'maintenance_mode' => EE_Maintenance_Mode::instance()->real_level(), |
|
140 | + 'served_core_versions' => array_keys(EED_Core_Rest_Api::versions_served()), |
|
141 | + ); |
|
142 | + $rest_response_obj->set_data($response_data); |
|
143 | + return $rest_response_obj; |
|
144 | + } |
|
145 | 145 | } |
146 | 146 | |
147 | 147 |
@@ -83,13 +83,13 @@ discard block |
||
83 | 83 | 'table_alias' => $field_obj->get_table_alias(), |
84 | 84 | 'table_column' => $field_obj->get_table_column(), |
85 | 85 | ); |
86 | - $fields_json[ $field_json['name'] ] = $field_json; |
|
86 | + $fields_json[$field_json['name']] = $field_json; |
|
87 | 87 | } |
88 | 88 | $fields_json = array_merge( |
89 | 89 | $fields_json, |
90 | 90 | $this->getModelVersionInfo()->extraResourcePropertiesForModel($model) |
91 | 91 | ); |
92 | - $response[ $model_name ]['fields'] = apply_filters( |
|
92 | + $response[$model_name]['fields'] = apply_filters( |
|
93 | 93 | 'FHEE__Meta__handle_request_models_meta__fields', |
94 | 94 | $fields_json, |
95 | 95 | $model |
@@ -101,9 +101,9 @@ discard block |
||
101 | 101 | 'type' => str_replace('EE_', '', get_class($relation_obj)), |
102 | 102 | 'single' => $relation_obj instanceof EE_Belongs_To_Relation, |
103 | 103 | ); |
104 | - $relations_json[ $relation_name ] = $relation_json; |
|
104 | + $relations_json[$relation_name] = $relation_json; |
|
105 | 105 | } |
106 | - $response[ $model_name ]['relations'] = apply_filters( |
|
106 | + $response[$model_name]['relations'] = apply_filters( |
|
107 | 107 | 'FHEE__Meta__handle_request_models_meta__relations', |
108 | 108 | $relations_json, |
109 | 109 | $model |
@@ -128,7 +128,7 @@ discard block |
||
128 | 128 | 'name' => $addon->name(), |
129 | 129 | 'version' => $addon->version(), |
130 | 130 | ); |
131 | - $addons[ $addon_json['name'] ] = $addon_json; |
|
131 | + $addons[$addon_json['name']] = $addon_json; |
|
132 | 132 | } |
133 | 133 | $response_data['ee'] = array( |
134 | 134 | 'version' => EEM_System_Status::instance()->get_ee_version(), |
@@ -17,53 +17,53 @@ |
||
17 | 17 | class RestApiRequests extends Route |
18 | 18 | { |
19 | 19 | |
20 | - /** |
|
21 | - * returns true if the current request matches this route |
|
22 | - * |
|
23 | - * @return bool |
|
24 | - * @since $VID:$ |
|
25 | - */ |
|
26 | - public function matchesCurrentRequest(): bool |
|
27 | - { |
|
28 | - return $this->request->isApi() || $this->request->isWordPressApi(); |
|
29 | - } |
|
20 | + /** |
|
21 | + * returns true if the current request matches this route |
|
22 | + * |
|
23 | + * @return bool |
|
24 | + * @since $VID:$ |
|
25 | + */ |
|
26 | + public function matchesCurrentRequest(): bool |
|
27 | + { |
|
28 | + return $this->request->isApi() || $this->request->isWordPressApi(); |
|
29 | + } |
|
30 | 30 | |
31 | 31 | |
32 | - /** |
|
33 | - * @since $VID:$ |
|
34 | - */ |
|
35 | - protected function registerDependencies() |
|
36 | - { |
|
37 | - $this->dependency_map->registerDependencies( |
|
38 | - 'EventEspresso\core\libraries\rest_api\calculations\Datetime', |
|
39 | - [ |
|
40 | - 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
41 | - 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
42 | - ] |
|
43 | - ); |
|
44 | - $this->dependency_map->registerDependencies( |
|
45 | - 'EventEspresso\core\libraries\rest_api\calculations\Event', |
|
46 | - [ |
|
47 | - 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
48 | - 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
49 | - ] |
|
50 | - ); |
|
51 | - $this->dependency_map->registerDependencies( |
|
52 | - 'EventEspresso\core\libraries\rest_api\calculations\Registration', |
|
53 | - ['EEM_Registration' => EE_Dependency_Map::load_from_cache] |
|
54 | - ); |
|
55 | - } |
|
32 | + /** |
|
33 | + * @since $VID:$ |
|
34 | + */ |
|
35 | + protected function registerDependencies() |
|
36 | + { |
|
37 | + $this->dependency_map->registerDependencies( |
|
38 | + 'EventEspresso\core\libraries\rest_api\calculations\Datetime', |
|
39 | + [ |
|
40 | + 'EEM_Datetime' => EE_Dependency_Map::load_from_cache, |
|
41 | + 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
42 | + ] |
|
43 | + ); |
|
44 | + $this->dependency_map->registerDependencies( |
|
45 | + 'EventEspresso\core\libraries\rest_api\calculations\Event', |
|
46 | + [ |
|
47 | + 'EEM_Event' => EE_Dependency_Map::load_from_cache, |
|
48 | + 'EEM_Registration' => EE_Dependency_Map::load_from_cache |
|
49 | + ] |
|
50 | + ); |
|
51 | + $this->dependency_map->registerDependencies( |
|
52 | + 'EventEspresso\core\libraries\rest_api\calculations\Registration', |
|
53 | + ['EEM_Registration' => EE_Dependency_Map::load_from_cache] |
|
54 | + ); |
|
55 | + } |
|
56 | 56 | |
57 | 57 | |
58 | - /** |
|
59 | - * implements logic required to run during request |
|
60 | - * |
|
61 | - * @return bool |
|
62 | - * @since $VID:$ |
|
63 | - */ |
|
64 | - protected function requestHandler(): bool |
|
65 | - { |
|
66 | - EED_Core_Rest_Api::set_hooks_both(); |
|
67 | - return true; |
|
68 | - } |
|
58 | + /** |
|
59 | + * implements logic required to run during request |
|
60 | + * |
|
61 | + * @return bool |
|
62 | + * @since $VID:$ |
|
63 | + */ |
|
64 | + protected function requestHandler(): bool |
|
65 | + { |
|
66 | + EED_Core_Rest_Api::set_hooks_both(); |
|
67 | + return true; |
|
68 | + } |
|
69 | 69 | } |
@@ -2,224 +2,224 @@ 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/blocks/src/components/AvatarImage.tsx:27 |
20 | - __( 'contact avatar', 'event_espresso' ), |
|
20 | + __('contact avatar', 'event_espresso'), |
|
21 | 21 | |
22 | 22 | // Reference: domains/blocks/src/components/OrderByControl.tsx:12 |
23 | - __( 'Order by', 'event_espresso' ), |
|
23 | + __('Order by', 'event_espresso'), |
|
24 | 24 | |
25 | 25 | // Reference: domains/blocks/src/components/RegStatusControl.tsx:17 |
26 | 26 | // Reference: domains/blocks/src/event-attendees/controls/SelectStatus.tsx:13 |
27 | - __( 'Select Registration Status', 'event_espresso' ), |
|
27 | + __('Select Registration Status', 'event_espresso'), |
|
28 | 28 | |
29 | 29 | // Reference: domains/blocks/src/components/SortOrderControl.tsx:14 |
30 | - __( 'Ascending', 'event_espresso' ), |
|
30 | + __('Ascending', 'event_espresso'), |
|
31 | 31 | |
32 | 32 | // Reference: domains/blocks/src/components/SortOrderControl.tsx:18 |
33 | - __( 'Descending', 'event_espresso' ), |
|
33 | + __('Descending', 'event_espresso'), |
|
34 | 34 | |
35 | 35 | // Reference: domains/blocks/src/components/SortOrderControl.tsx:24 |
36 | - __( 'Sort order:', 'event_espresso' ), |
|
36 | + __('Sort order:', 'event_espresso'), |
|
37 | 37 | |
38 | 38 | // Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:41 |
39 | - __( 'There was some error fetching attendees list', 'event_espresso' ), |
|
39 | + __('There was some error fetching attendees list', 'event_espresso'), |
|
40 | 40 | |
41 | 41 | // Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:47 |
42 | - __( 'To get started, select what event you want to show attendees from in the block settings.', 'event_espresso' ), |
|
42 | + __('To get started, select what event you want to show attendees from in the block settings.', 'event_espresso'), |
|
43 | 43 | |
44 | 44 | // Reference: domains/blocks/src/event-attendees/AttendeesDisplay.tsx:53 |
45 | - __( 'There are no attendees for selected options.', 'event_espresso' ), |
|
45 | + __('There are no attendees for selected options.', 'event_espresso'), |
|
46 | 46 | |
47 | 47 | // Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:12 |
48 | - __( 'Display on Archives', 'event_espresso' ), |
|
48 | + __('Display on Archives', 'event_espresso'), |
|
49 | 49 | |
50 | 50 | // Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:17 |
51 | - __( 'Attendees are shown whenever this post is listed in an archive view.', 'event_espresso' ), |
|
51 | + __('Attendees are shown whenever this post is listed in an archive view.', 'event_espresso'), |
|
52 | 52 | |
53 | 53 | // Reference: domains/blocks/src/event-attendees/controls/ArchiveSettings.tsx:18 |
54 | - __( 'Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso' ), |
|
54 | + __('Attendees are hidden whenever this post is listed in an archive view.', 'event_espresso'), |
|
55 | 55 | |
56 | 56 | // Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:29 |
57 | - __( 'Number of Attendees to Display:', 'event_espresso' ), |
|
57 | + __('Number of Attendees to Display:', 'event_espresso'), |
|
58 | 58 | |
59 | 59 | // Reference: domains/blocks/src/event-attendees/controls/AttendeeLimit.tsx:34 |
60 | 60 | /* translators: %d attendees count */ |
61 | - _n_noop( 'Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso' ), |
|
61 | + _n_noop('Used to adjust the number of attendees displayed (There is %d total attendee for the current filter settings).', 'Used to adjust the number of attendees displayed (There are %d total attendees for the current filter settings).', 'event_espresso'), |
|
62 | 62 | |
63 | 63 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:27 |
64 | - __( 'Display Gravatar', 'event_espresso' ), |
|
64 | + __('Display Gravatar', 'event_espresso'), |
|
65 | 65 | |
66 | 66 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:32 |
67 | - __( 'Gravatar images are shown for each attendee.', 'event_espresso' ), |
|
67 | + __('Gravatar images are shown for each attendee.', 'event_espresso'), |
|
68 | 68 | |
69 | 69 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:33 |
70 | - __( 'No gravatar images are shown for each attendee.', 'event_espresso' ), |
|
70 | + __('No gravatar images are shown for each attendee.', 'event_espresso'), |
|
71 | 71 | |
72 | 72 | // Reference: domains/blocks/src/event-attendees/controls/GravatarSettings.tsx:38 |
73 | - __( 'Size of Gravatar', 'event_espresso' ), |
|
73 | + __('Size of Gravatar', 'event_espresso'), |
|
74 | 74 | |
75 | 75 | // Reference: domains/blocks/src/event-attendees/controls/SelectDatetime.tsx:22 |
76 | - __( 'Select Datetime', 'event_espresso' ), |
|
76 | + __('Select Datetime', 'event_espresso'), |
|
77 | 77 | |
78 | 78 | // Reference: domains/blocks/src/event-attendees/controls/SelectEvent.tsx:22 |
79 | - __( 'Select Event', 'event_espresso' ), |
|
79 | + __('Select Event', 'event_espresso'), |
|
80 | 80 | |
81 | 81 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:11 |
82 | - __( 'Attendee id', 'event_espresso' ), |
|
82 | + __('Attendee id', 'event_espresso'), |
|
83 | 83 | |
84 | 84 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:15 |
85 | - __( 'Last name only', 'event_espresso' ), |
|
85 | + __('Last name only', 'event_espresso'), |
|
86 | 86 | |
87 | 87 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:19 |
88 | - __( 'First name only', 'event_espresso' ), |
|
88 | + __('First name only', 'event_espresso'), |
|
89 | 89 | |
90 | 90 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:23 |
91 | - __( 'First, then Last name', 'event_espresso' ), |
|
91 | + __('First, then Last name', 'event_espresso'), |
|
92 | 92 | |
93 | 93 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:27 |
94 | - __( 'Last, then First name', 'event_espresso' ), |
|
94 | + __('Last, then First name', 'event_espresso'), |
|
95 | 95 | |
96 | 96 | // Reference: domains/blocks/src/event-attendees/controls/SelectOrderBy.tsx:41 |
97 | - __( 'Order Attendees by:', 'event_espresso' ), |
|
97 | + __('Order Attendees by:', 'event_espresso'), |
|
98 | 98 | |
99 | 99 | // Reference: domains/blocks/src/event-attendees/controls/SelectTicket.tsx:22 |
100 | - __( 'Select Ticket', 'event_espresso' ), |
|
100 | + __('Select Ticket', 'event_espresso'), |
|
101 | 101 | |
102 | 102 | // Reference: domains/blocks/src/event-attendees/controls/index.tsx:21 |
103 | - __( 'Filter By Settings', 'event_espresso' ), |
|
103 | + __('Filter By Settings', 'event_espresso'), |
|
104 | 104 | |
105 | 105 | // Reference: domains/blocks/src/event-attendees/controls/index.tsx:36 |
106 | - __( 'Gravatar Setttings', 'event_espresso' ), |
|
106 | + __('Gravatar Setttings', 'event_espresso'), |
|
107 | 107 | |
108 | 108 | // Reference: domains/blocks/src/event-attendees/controls/index.tsx:39 |
109 | - __( 'Archive Settings', 'event_espresso' ), |
|
109 | + __('Archive Settings', 'event_espresso'), |
|
110 | 110 | |
111 | 111 | // Reference: domains/blocks/src/event-attendees/index.tsx:10 |
112 | - __( 'Event Attendees', 'event_espresso' ), |
|
112 | + __('Event Attendees', 'event_espresso'), |
|
113 | 113 | |
114 | 114 | // Reference: domains/blocks/src/event-attendees/index.tsx:11 |
115 | - __( 'Displays a list of people that have registered for the specified event', 'event_espresso' ), |
|
115 | + __('Displays a list of people that have registered for the specified event', 'event_espresso'), |
|
116 | 116 | |
117 | 117 | // Reference: domains/blocks/src/event-attendees/index.tsx:14 |
118 | - __( 'event', 'event_espresso' ), |
|
118 | + __('event', 'event_espresso'), |
|
119 | 119 | |
120 | 120 | // Reference: domains/blocks/src/event-attendees/index.tsx:14 |
121 | - __( 'attendees', 'event_espresso' ), |
|
121 | + __('attendees', 'event_espresso'), |
|
122 | 122 | |
123 | 123 | // Reference: domains/blocks/src/event-attendees/index.tsx:14 |
124 | - __( 'list', 'event_espresso' ), |
|
124 | + __('list', 'event_espresso'), |
|
125 | 125 | |
126 | 126 | // Reference: domains/blocks/src/services/utils.ts:11 |
127 | - __( 'Loading…', 'event_espresso' ), |
|
127 | + __('Loading…', 'event_espresso'), |
|
128 | 128 | |
129 | 129 | // Reference: domains/blocks/src/services/utils.ts:19 |
130 | - __( 'Error', 'event_espresso' ), |
|
130 | + __('Error', 'event_espresso'), |
|
131 | 131 | |
132 | 132 | // Reference: domains/blocks/src/services/utils.ts:26 |
133 | - __( 'Select…', 'event_espresso' ), |
|
133 | + __('Select…', 'event_espresso'), |
|
134 | 134 | |
135 | 135 | // Reference: domains/eventEditor/src/ui/EventDescription.tsx:32 |
136 | - __( 'Event Description', 'event_espresso' ), |
|
136 | + __('Event Description', 'event_espresso'), |
|
137 | 137 | |
138 | 138 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/ActiveStatus.tsx:22 |
139 | - __( 'Active status', 'event_espresso' ), |
|
139 | + __('Active status', 'event_espresso'), |
|
140 | 140 | |
141 | 141 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/AltRegPage.tsx:14 |
142 | - __( 'Alternative Registration Page', 'event_espresso' ), |
|
142 | + __('Alternative Registration Page', 'event_espresso'), |
|
143 | 143 | |
144 | 144 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/DefaultRegistrationStatus.tsx:15 |
145 | - __( 'Default Registration Status', 'event_espresso' ), |
|
145 | + __('Default Registration Status', 'event_espresso'), |
|
146 | 146 | |
147 | 147 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:9 |
148 | - __( 'Donations Enabled', 'event_espresso' ), |
|
148 | + __('Donations Enabled', 'event_espresso'), |
|
149 | 149 | |
150 | 150 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/Donations.tsx:9 |
151 | - __( 'Donations Disabled', 'event_espresso' ), |
|
151 | + __('Donations Disabled', 'event_espresso'), |
|
152 | 152 | |
153 | 153 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventManager.tsx:16 |
154 | - __( 'Event Manager', 'event_espresso' ), |
|
154 | + __('Event Manager', 'event_espresso'), |
|
155 | 155 | |
156 | 156 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/EventPhoneNumber.tsx:11 |
157 | - __( 'Event Phone Number', 'event_espresso' ), |
|
157 | + __('Event Phone Number', 'event_espresso'), |
|
158 | 158 | |
159 | 159 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/MaxRegistrations.tsx:12 |
160 | - __( 'Max Registrations per Transaction', 'event_espresso' ), |
|
160 | + __('Max Registrations per Transaction', 'event_espresso'), |
|
161 | 161 | |
162 | 162 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:9 |
163 | - __( 'Ticket Selector Enabled', 'event_espresso' ), |
|
163 | + __('Ticket Selector Enabled', 'event_espresso'), |
|
164 | 164 | |
165 | 165 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/TicketSelector.tsx:9 |
166 | - __( 'Ticket Selector Disabled', 'event_espresso' ), |
|
166 | + __('Ticket Selector Disabled', 'event_espresso'), |
|
167 | 167 | |
168 | 168 | // Reference: domains/eventEditor/src/ui/EventRegistrationOptions/index.tsx:42 |
169 | - __( 'Registration Options', 'event_espresso' ), |
|
169 | + __('Registration Options', 'event_espresso'), |
|
170 | 170 | |
171 | 171 | // Reference: domains/eventEditor/src/ui/datetimes/DateRegistrationsLink.tsx:13 |
172 | - __( 'view ALL registrations for this date.', 'event_espresso' ), |
|
172 | + __('view ALL registrations for this date.', 'event_espresso'), |
|
173 | 173 | |
174 | 174 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10 |
175 | - __( 'primary information about the date', 'event_espresso' ), |
|
175 | + __('primary information about the date', 'event_espresso'), |
|
176 | 176 | |
177 | 177 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:10 |
178 | - __( 'Date Details', 'event_espresso' ), |
|
178 | + __('Date Details', 'event_espresso'), |
|
179 | 179 | |
180 | 180 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11 |
181 | 181 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16 |
182 | - __( 'relations between tickets and dates', 'event_espresso' ), |
|
182 | + __('relations between tickets and dates', 'event_espresso'), |
|
183 | 183 | |
184 | 184 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/DateFormSteps.tsx:11 |
185 | - __( 'Assign Tickets', 'event_espresso' ), |
|
185 | + __('Assign Tickets', 'event_espresso'), |
|
186 | 186 | |
187 | 187 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/FooterButtons.tsx:22 |
188 | - __( 'Save and assign tickets', 'event_espresso' ), |
|
188 | + __('Save and assign tickets', 'event_espresso'), |
|
189 | 189 | |
190 | 190 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:33 |
191 | 191 | /* translators: %s datetime id */ |
192 | - __( 'Edit datetime %s', 'event_espresso' ), |
|
192 | + __('Edit datetime %s', 'event_espresso'), |
|
193 | 193 | |
194 | 194 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/multiStep/Modal.tsx:36 |
195 | - __( 'New Datetime', 'event_espresso' ), |
|
195 | + __('New Datetime', 'event_espresso'), |
|
196 | 196 | |
197 | 197 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:106 |
198 | 198 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:108 |
199 | 199 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:115 |
200 | 200 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:108 |
201 | - __( 'Details', 'event_espresso' ), |
|
201 | + __('Details', 'event_espresso'), |
|
202 | 202 | |
203 | 203 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:110 |
204 | 204 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:112 |
205 | 205 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:81 |
206 | - __( 'Capacity', 'event_espresso' ), |
|
206 | + __('Capacity', 'event_espresso'), |
|
207 | 207 | |
208 | 208 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:115 |
209 | - __( 'The maximum number of registrants that can attend the event at this particular date.', 'event_espresso' ), |
|
209 | + __('The maximum number of registrants that can attend the event at this particular date.', 'event_espresso'), |
|
210 | 210 | |
211 | 211 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:119 |
212 | - __( 'Set to 0 to close registration or leave blank for no limit.', 'event_espresso' ), |
|
212 | + __('Set to 0 to close registration or leave blank for no limit.', 'event_espresso'), |
|
213 | 213 | |
214 | 214 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:124 |
215 | 215 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:194 |
216 | - __( 'Trash', 'event_espresso' ), |
|
216 | + __('Trash', 'event_espresso'), |
|
217 | 217 | |
218 | 218 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:70 |
219 | 219 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:45 |
220 | 220 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:79 |
221 | 221 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:45 |
222 | - __( 'Basics', 'event_espresso' ), |
|
222 | + __('Basics', 'event_espresso'), |
|
223 | 223 | |
224 | 224 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:74 |
225 | 225 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:49 |
@@ -227,246 +227,246 @@ discard block |
||
227 | 227 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:83 |
228 | 228 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:49 |
229 | 229 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:40 |
230 | - __( 'Name', 'event_espresso' ), |
|
230 | + __('Name', 'event_espresso'), |
|
231 | 231 | |
232 | 232 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:79 |
233 | 233 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:55 |
234 | 234 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:88 |
235 | 235 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:55 |
236 | 236 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:41 |
237 | - __( 'Description', 'event_espresso' ), |
|
237 | + __('Description', 'event_espresso'), |
|
238 | 238 | |
239 | 239 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:87 |
240 | 240 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:63 |
241 | 241 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:63 |
242 | - __( 'Dates', 'event_espresso' ), |
|
242 | + __('Dates', 'event_espresso'), |
|
243 | 243 | |
244 | 244 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:91 |
245 | 245 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:51 |
246 | 246 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:100 |
247 | - __( 'Start Date', 'event_espresso' ), |
|
247 | + __('Start Date', 'event_espresso'), |
|
248 | 248 | |
249 | 249 | // Reference: domains/eventEditor/src/ui/datetimes/dateForm/useDateFormConfig.ts:97 |
250 | 250 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:65 |
251 | 251 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:106 |
252 | - __( 'End Date', 'event_espresso' ), |
|
252 | + __('End Date', 'event_espresso'), |
|
253 | 253 | |
254 | 254 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:34 |
255 | 255 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/TableView.tsx:33 |
256 | - __( 'Event Dates', 'event_espresso' ), |
|
256 | + __('Event Dates', 'event_espresso'), |
|
257 | 257 | |
258 | 258 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesList.tsx:37 |
259 | - __( 'loading event dates…', 'event_espresso' ), |
|
259 | + __('loading event dates…', 'event_espresso'), |
|
260 | 260 | |
261 | 261 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/DatesListButtons.tsx:23 |
262 | - __( 'Ticket Assignments', 'event_espresso' ), |
|
262 | + __('Ticket Assignments', 'event_espresso'), |
|
263 | 263 | |
264 | 264 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:25 |
265 | - __( 'Number of related tickets', 'event_espresso' ), |
|
265 | + __('Number of related tickets', 'event_espresso'), |
|
266 | 266 | |
267 | 267 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:26 |
268 | - __( 'There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso' ), |
|
268 | + __('There are no tickets assigned to this datetime. Please click the ticket icon to update the assignments.', 'event_espresso'), |
|
269 | 269 | |
270 | 270 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/AssignTicketsButton.tsx:34 |
271 | - __( 'assign tickets', 'event_espresso' ), |
|
271 | + __('assign tickets', 'event_espresso'), |
|
272 | 272 | |
273 | 273 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:19 |
274 | - __( 'event date main menu', 'event_espresso' ), |
|
274 | + __('event date main menu', 'event_espresso'), |
|
275 | 275 | |
276 | 276 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:27 |
277 | - __( 'Permanently delete Datetime?', 'event_espresso' ), |
|
277 | + __('Permanently delete Datetime?', 'event_espresso'), |
|
278 | 278 | |
279 | 279 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:27 |
280 | - __( 'Move Datetime to Trash?', 'event_espresso' ), |
|
280 | + __('Move Datetime to Trash?', 'event_espresso'), |
|
281 | 281 | |
282 | 282 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:29 |
283 | - __( 'Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso' ), |
|
283 | + __('Are you sure you want to permanently delete this datetime? This action is permanent and can not be undone.', 'event_espresso'), |
|
284 | 284 | |
285 | 285 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:32 |
286 | - __( 'Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso' ), |
|
286 | + __('Are you sure you want to move this datetime to the trash? You can "untrash" this datetime later if you need to.', 'event_espresso'), |
|
287 | 287 | |
288 | 288 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:41 |
289 | 289 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:40 |
290 | - __( 'delete permanently', 'event_espresso' ), |
|
290 | + __('delete permanently', 'event_espresso'), |
|
291 | 291 | |
292 | 292 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:41 |
293 | - __( 'trash datetime', 'event_espresso' ), |
|
293 | + __('trash datetime', 'event_espresso'), |
|
294 | 294 | |
295 | 295 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:52 |
296 | - __( 'edit datetime', 'event_espresso' ), |
|
296 | + __('edit datetime', 'event_espresso'), |
|
297 | 297 | |
298 | 298 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/actionsMenu/dropdown/DateMainMenu.tsx:53 |
299 | - __( 'copy datetime', 'event_espresso' ), |
|
299 | + __('copy datetime', 'event_espresso'), |
|
300 | 300 | |
301 | 301 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:36 |
302 | 302 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:38 |
303 | 303 | // Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:43 |
304 | - __( 'bulk actions', 'event_espresso' ), |
|
304 | + __('bulk actions', 'event_espresso'), |
|
305 | 305 | |
306 | 306 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:40 |
307 | - __( 'edit datetime details', 'event_espresso' ), |
|
307 | + __('edit datetime details', 'event_espresso'), |
|
308 | 308 | |
309 | 309 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44 |
310 | - __( 'delete datetimes', 'event_espresso' ), |
|
310 | + __('delete datetimes', 'event_espresso'), |
|
311 | 311 | |
312 | 312 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/actions/Actions.tsx:44 |
313 | - __( 'trash datetimes', 'event_espresso' ), |
|
313 | + __('trash datetimes', 'event_espresso'), |
|
314 | 314 | |
315 | 315 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:14 |
316 | - __( 'Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso' ), |
|
316 | + __('Are you sure you want to permanently delete these datetimes? This action can NOT be undone!', 'event_espresso'), |
|
317 | 317 | |
318 | 318 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:15 |
319 | - __( 'Are you sure you want to trash these datetimes?', 'event_espresso' ), |
|
319 | + __('Are you sure you want to trash these datetimes?', 'event_espresso'), |
|
320 | 320 | |
321 | 321 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16 |
322 | - __( 'Delete datetimes permanently', 'event_espresso' ), |
|
322 | + __('Delete datetimes permanently', 'event_espresso'), |
|
323 | 323 | |
324 | 324 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/delete/Delete.tsx:16 |
325 | - __( 'Trash datetimes', 'event_espresso' ), |
|
325 | + __('Trash datetimes', 'event_espresso'), |
|
326 | 326 | |
327 | 327 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:21 |
328 | - __( 'Bulk edit date details', 'event_espresso' ), |
|
328 | + __('Bulk edit date details', 'event_espresso'), |
|
329 | 329 | |
330 | 330 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/EditDetails.tsx:22 |
331 | - __( 'any changes will be applied to ALL of the selected dates.', 'event_espresso' ), |
|
331 | + __('any changes will be applied to ALL of the selected dates.', 'event_espresso'), |
|
332 | 332 | |
333 | 333 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/formValidation.ts:12 |
334 | 334 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/formValidation.ts:12 |
335 | - __( 'Name must be at least three characters', 'event_espresso' ), |
|
335 | + __('Name must be at least three characters', 'event_espresso'), |
|
336 | 336 | |
337 | 337 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:67 |
338 | 338 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:67 |
339 | - __( 'Shift dates', 'event_espresso' ), |
|
339 | + __('Shift dates', 'event_espresso'), |
|
340 | 340 | |
341 | 341 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:92 |
342 | 342 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:92 |
343 | - __( 'earlier', 'event_espresso' ), |
|
343 | + __('earlier', 'event_espresso'), |
|
344 | 344 | |
345 | 345 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/bulkEdit/details/useBulkEditFormConfig.ts:96 |
346 | 346 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:96 |
347 | - __( 'later', 'event_espresso' ), |
|
347 | + __('later', 'event_espresso'), |
|
348 | 348 | |
349 | 349 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCapacity.tsx:36 |
350 | - __( 'edit capacity (registration limit)…', 'event_espresso' ), |
|
350 | + __('edit capacity (registration limit)…', 'event_espresso'), |
|
351 | 351 | |
352 | 352 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:38 |
353 | - __( 'Edit Event Date', 'event_espresso' ), |
|
353 | + __('Edit Event Date', 'event_espresso'), |
|
354 | 354 | |
355 | 355 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateCardSidebar.tsx:41 |
356 | - __( 'edit start and end dates', 'event_espresso' ), |
|
356 | + __('edit start and end dates', 'event_espresso'), |
|
357 | 357 | |
358 | 358 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:15 |
359 | 359 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:15 |
360 | - __( 'sold', 'event_espresso' ), |
|
360 | + __('sold', 'event_espresso'), |
|
361 | 361 | |
362 | 362 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:28 |
363 | - __( 'capacity', 'event_espresso' ), |
|
363 | + __('capacity', 'event_espresso'), |
|
364 | 364 | |
365 | 365 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/DateDetailsPanel.tsx:34 |
366 | 366 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:33 |
367 | - __( 'reg list', 'event_espresso' ), |
|
367 | + __('reg list', 'event_espresso'), |
|
368 | 368 | |
369 | 369 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:42 |
370 | 370 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:41 |
371 | - __( 'Edit description', 'event_espresso' ), |
|
371 | + __('Edit description', 'event_espresso'), |
|
372 | 372 | |
373 | 373 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/cardView/Details.tsx:43 |
374 | 374 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/Details.tsx:42 |
375 | - __( 'edit description…', 'event_espresso' ), |
|
375 | + __('edit description…', 'event_espresso'), |
|
376 | 376 | |
377 | 377 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:10 |
378 | - __( 'Move Date to Trash', 'event_espresso' ), |
|
378 | + __('Move Date to Trash', 'event_espresso'), |
|
379 | 379 | |
380 | 380 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:13 |
381 | 381 | // Reference: packages/constants/src/datetime.ts:6 |
382 | - __( 'Active', 'event_espresso' ), |
|
382 | + __('Active', 'event_espresso'), |
|
383 | 383 | |
384 | 384 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:14 |
385 | 385 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:13 |
386 | - __( 'Trashed', 'event_espresso' ), |
|
386 | + __('Trashed', 'event_espresso'), |
|
387 | 387 | |
388 | 388 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:15 |
389 | 389 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:14 |
390 | 390 | // Reference: packages/constants/src/datetime.ts:8 |
391 | - __( 'Expired', 'event_espresso' ), |
|
391 | + __('Expired', 'event_espresso'), |
|
392 | 392 | |
393 | 393 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:16 |
394 | 394 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:16 |
395 | - __( 'Sold Out', 'event_espresso' ), |
|
395 | + __('Sold Out', 'event_espresso'), |
|
396 | 396 | |
397 | 397 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:17 |
398 | 398 | // Reference: packages/constants/src/datetime.ts:12 |
399 | - __( 'Upcoming', 'event_espresso' ), |
|
399 | + __('Upcoming', 'event_espresso'), |
|
400 | 400 | |
401 | 401 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:7 |
402 | - __( 'Edit Event Date Details', 'event_espresso' ), |
|
402 | + __('Edit Event Date Details', 'event_espresso'), |
|
403 | 403 | |
404 | 404 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:8 |
405 | - __( 'View Registrations for this Date', 'event_espresso' ), |
|
405 | + __('View Registrations for this Date', 'event_espresso'), |
|
406 | 406 | |
407 | 407 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/config.ts:9 |
408 | - __( 'Manage Ticket Assignments', 'event_espresso' ), |
|
408 | + __('Manage Ticket Assignments', 'event_espresso'), |
|
409 | 409 | |
410 | 410 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/editable/EditableName.tsx:17 |
411 | 411 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditableName.tsx:28 |
412 | - __( 'edit title…', 'event_espresso' ), |
|
412 | + __('edit title…', 'event_espresso'), |
|
413 | 413 | |
414 | 414 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/ActiveDatesFilters.tsx:25 |
415 | 415 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/ActiveTicketsFilters.tsx:25 |
416 | - __( 'ON', 'event_espresso' ), |
|
416 | + __('ON', 'event_espresso'), |
|
417 | 417 | |
418 | 418 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:10 |
419 | - __( 'end dates only', 'event_espresso' ), |
|
419 | + __('end dates only', 'event_espresso'), |
|
420 | 420 | |
421 | 421 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:11 |
422 | - __( 'start and end dates', 'event_espresso' ), |
|
422 | + __('start and end dates', 'event_espresso'), |
|
423 | 423 | |
424 | 424 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:16 |
425 | - __( 'dates above 90% capacity', 'event_espresso' ), |
|
425 | + __('dates above 90% capacity', 'event_espresso'), |
|
426 | 426 | |
427 | 427 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:17 |
428 | - __( 'dates above 75% capacity', 'event_espresso' ), |
|
428 | + __('dates above 75% capacity', 'event_espresso'), |
|
429 | 429 | |
430 | 430 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:18 |
431 | - __( 'dates above 50% capacity', 'event_espresso' ), |
|
431 | + __('dates above 50% capacity', 'event_espresso'), |
|
432 | 432 | |
433 | 433 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:19 |
434 | - __( 'dates below 50% capacity', 'event_espresso' ), |
|
434 | + __('dates below 50% capacity', 'event_espresso'), |
|
435 | 435 | |
436 | 436 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:23 |
437 | - __( 'all dates', 'event_espresso' ), |
|
437 | + __('all dates', 'event_espresso'), |
|
438 | 438 | |
439 | 439 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:24 |
440 | - __( 'all active and upcoming', 'event_espresso' ), |
|
440 | + __('all active and upcoming', 'event_espresso'), |
|
441 | 441 | |
442 | 442 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:25 |
443 | - __( 'active dates only', 'event_espresso' ), |
|
443 | + __('active dates only', 'event_espresso'), |
|
444 | 444 | |
445 | 445 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:26 |
446 | - __( 'upcoming dates only', 'event_espresso' ), |
|
446 | + __('upcoming dates only', 'event_espresso'), |
|
447 | 447 | |
448 | 448 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:27 |
449 | - __( 'next active or upcoming only', 'event_espresso' ), |
|
449 | + __('next active or upcoming only', 'event_espresso'), |
|
450 | 450 | |
451 | 451 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:28 |
452 | - __( 'sold out dates only', 'event_espresso' ), |
|
452 | + __('sold out dates only', 'event_espresso'), |
|
453 | 453 | |
454 | 454 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:29 |
455 | - __( 'recently expired dates', 'event_espresso' ), |
|
455 | + __('recently expired dates', 'event_espresso'), |
|
456 | 456 | |
457 | 457 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:30 |
458 | - __( 'all expired dates', 'event_espresso' ), |
|
458 | + __('all expired dates', 'event_espresso'), |
|
459 | 459 | |
460 | 460 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:31 |
461 | - __( 'trashed dates only', 'event_espresso' ), |
|
461 | + __('trashed dates only', 'event_espresso'), |
|
462 | 462 | |
463 | 463 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:35 |
464 | 464 | // Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:9 |
465 | 465 | // Reference: packages/dates/src/components/DateRangePicker/index.tsx:43 |
466 | - __( 'start date', 'event_espresso' ), |
|
466 | + __('start date', 'event_espresso'), |
|
467 | 467 | |
468 | 468 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:36 |
469 | - __( 'name', 'event_espresso' ), |
|
469 | + __('name', 'event_espresso'), |
|
470 | 470 | |
471 | 471 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:37 |
472 | 472 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:31 |
@@ -474,137 +474,137 @@ discard block |
||
474 | 474 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/HeaderCell.tsx:27 |
475 | 475 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:31 |
476 | 476 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:23 |
477 | - __( 'ID', 'event_espresso' ), |
|
477 | + __('ID', 'event_espresso'), |
|
478 | 478 | |
479 | 479 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:38 |
480 | 480 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:47 |
481 | - __( 'custom order', 'event_espresso' ), |
|
481 | + __('custom order', 'event_espresso'), |
|
482 | 482 | |
483 | 483 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:42 |
484 | 484 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:51 |
485 | - __( 'display', 'event_espresso' ), |
|
485 | + __('display', 'event_espresso'), |
|
486 | 486 | |
487 | 487 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:43 |
488 | - __( 'recurrence', 'event_espresso' ), |
|
488 | + __('recurrence', 'event_espresso'), |
|
489 | 489 | |
490 | 490 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:44 |
491 | 491 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:53 |
492 | - __( 'sales', 'event_espresso' ), |
|
492 | + __('sales', 'event_espresso'), |
|
493 | 493 | |
494 | 494 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:45 |
495 | 495 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:55 |
496 | - __( 'sort by', 'event_espresso' ), |
|
496 | + __('sort by', 'event_espresso'), |
|
497 | 497 | |
498 | 498 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:46 |
499 | 499 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:54 |
500 | 500 | // Reference: packages/ee-components/src/EntityList/EntityListFilterBar.tsx:52 |
501 | - __( 'search', 'event_espresso' ), |
|
501 | + __('search', 'event_espresso'), |
|
502 | 502 | |
503 | 503 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:47 |
504 | 504 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:56 |
505 | - __( 'status', 'event_espresso' ), |
|
505 | + __('status', 'event_espresso'), |
|
506 | 506 | |
507 | 507 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/filterBar/controls/options.ts:9 |
508 | - __( 'start dates only', 'event_espresso' ), |
|
508 | + __('start dates only', 'event_espresso'), |
|
509 | 509 | |
510 | 510 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:18 |
511 | 511 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/NewDateModal.tsx:14 |
512 | 512 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/OptionsModalButton.tsx:10 |
513 | - __( 'Add New Date', 'event_espresso' ), |
|
513 | + __('Add New Date', 'event_espresso'), |
|
514 | 514 | |
515 | 515 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:18 |
516 | - __( 'Add Single Date', 'event_espresso' ), |
|
516 | + __('Add Single Date', 'event_espresso'), |
|
517 | 517 | |
518 | 518 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:32 |
519 | - __( 'Add a single date that only occurs once', 'event_espresso' ), |
|
519 | + __('Add a single date that only occurs once', 'event_espresso'), |
|
520 | 520 | |
521 | 521 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/newDateOptions/AddSingleDate.tsx:34 |
522 | - __( 'Single Date', 'event_espresso' ), |
|
522 | + __('Single Date', 'event_espresso'), |
|
523 | 523 | |
524 | 524 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:106 |
525 | - __( 'Reg list', 'event_espresso' ), |
|
525 | + __('Reg list', 'event_espresso'), |
|
526 | 526 | |
527 | 527 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:107 |
528 | 528 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:111 |
529 | - __( 'Regs', 'event_espresso' ), |
|
529 | + __('Regs', 'event_espresso'), |
|
530 | 530 | |
531 | 531 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:122 |
532 | 532 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:126 |
533 | 533 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:53 |
534 | - __( 'Actions', 'event_espresso' ), |
|
534 | + __('Actions', 'event_espresso'), |
|
535 | 535 | |
536 | 536 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:52 |
537 | - __( 'Start', 'event_espresso' ), |
|
537 | + __('Start', 'event_espresso'), |
|
538 | 538 | |
539 | 539 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:66 |
540 | - __( 'End', 'event_espresso' ), |
|
540 | + __('End', 'event_espresso'), |
|
541 | 541 | |
542 | 542 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:82 |
543 | - __( 'Cap', 'event_espresso' ), |
|
543 | + __('Cap', 'event_espresso'), |
|
544 | 544 | |
545 | 545 | // Reference: domains/eventEditor/src/ui/datetimes/datesList/tableView/useHeaderRowGenerator.tsx:94 |
546 | 546 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:98 |
547 | - __( 'Sold', 'event_espresso' ), |
|
547 | + __('Sold', 'event_espresso'), |
|
548 | 548 | |
549 | 549 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:18 |
550 | - __( 'Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. |
|
551 | -Please correct the assignments for the highlighted cells.', 'event_espresso' ), |
|
550 | + __('Tickets must always have at least one date assigned to them but one or more of the tickets below does not have any. |
|
551 | +Please correct the assignments for the highlighted cells.', 'event_espresso'), |
|
552 | 552 | |
553 | 553 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:22 |
554 | - __( '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. |
|
555 | -Please correct the assignments for the highlighted cells.', 'event_espresso' ), |
|
554 | + __('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. |
|
555 | +Please correct the assignments for the highlighted cells.', 'event_espresso'), |
|
556 | 556 | |
557 | 557 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ErrorMessage.tsx:32 |
558 | - __( 'Please Update Assignments', 'event_espresso' ), |
|
558 | + __('Please Update Assignments', 'event_espresso'), |
|
559 | 559 | |
560 | 560 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:26 |
561 | - __( 'There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso' ), |
|
561 | + __('There seem to be some dates/tickets which have no tickets/dates assigned. Do you want to fix them now?', 'event_espresso'), |
|
562 | 562 | |
563 | 563 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:29 |
564 | 564 | // Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:21 |
565 | - __( 'Alert!', 'event_espresso' ), |
|
565 | + __('Alert!', 'event_espresso'), |
|
566 | 566 | |
567 | 567 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:42 |
568 | 568 | /* translators: 1 entity id, 2 entity name */ |
569 | - __( 'Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso' ), |
|
569 | + __('Ticket Assignment Manager for Datetime: %1$s - %2$s', 'event_espresso'), |
|
570 | 570 | |
571 | 571 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/ModalContainer.tsx:49 |
572 | 572 | /* translators: 1 entity id, 2 entity name */ |
573 | - __( 'Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso' ), |
|
573 | + __('Ticket Assignment Manager for Ticket: %1$s - %2$s', 'event_espresso'), |
|
574 | 574 | |
575 | 575 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/TicketAssignmentsManagerModal.tsx:28 |
576 | 576 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/Table.tsx:13 |
577 | - __( 'Ticket Assignment Manager', 'event_espresso' ), |
|
577 | + __('Ticket Assignment Manager', 'event_espresso'), |
|
578 | 578 | |
579 | 579 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:10 |
580 | - __( 'existing relation', 'event_espresso' ), |
|
580 | + __('existing relation', 'event_espresso'), |
|
581 | 581 | |
582 | 582 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:15 |
583 | - __( 'remove existing relation', 'event_espresso' ), |
|
583 | + __('remove existing relation', 'event_espresso'), |
|
584 | 584 | |
585 | 585 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:20 |
586 | - __( 'add new relation', 'event_espresso' ), |
|
586 | + __('add new relation', 'event_espresso'), |
|
587 | 587 | |
588 | 588 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:25 |
589 | - __( 'invalid relation', 'event_espresso' ), |
|
589 | + __('invalid relation', 'event_espresso'), |
|
590 | 590 | |
591 | 591 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/config.ts:29 |
592 | - __( 'no relation', 'event_espresso' ), |
|
592 | + __('no relation', 'event_espresso'), |
|
593 | 593 | |
594 | 594 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/BodyCell.tsx:24 |
595 | - __( 'assign ticket', 'event_espresso' ), |
|
595 | + __('assign ticket', 'event_espresso'), |
|
596 | 596 | |
597 | 597 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:15 |
598 | - __( 'Assignments', 'event_espresso' ), |
|
598 | + __('Assignments', 'event_espresso'), |
|
599 | 599 | |
600 | 600 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:16 |
601 | - __( 'Event Dates are listed below', 'event_espresso' ), |
|
601 | + __('Event Dates are listed below', 'event_espresso'), |
|
602 | 602 | |
603 | 603 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:17 |
604 | - __( 'Tickets are listed along the top', 'event_espresso' ), |
|
604 | + __('Tickets are listed along the top', 'event_espresso'), |
|
605 | 605 | |
606 | 606 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/table/useGetHeaderRows.tsx:18 |
607 | - __( 'Click the cell buttons to toggle assigments', 'event_espresso' ), |
|
607 | + __('Click the cell buttons to toggle assigments', 'event_espresso'), |
|
608 | 608 | |
609 | 609 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/components/useSubmitButtonProps.ts:29 |
610 | 610 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:16 |
@@ -613,943 +613,943 @@ discard block |
||
613 | 613 | // Reference: packages/tpc/src/buttons/useSubmitButtonProps.tsx:29 |
614 | 614 | // Reference: packages/ui-components/src/Modal/useSubmitButtonProps.tsx:13 |
615 | 615 | // Reference: packages/ui-components/src/Stepper/buttons/Submit.tsx:7 |
616 | - __( 'Submit', 'event_espresso' ), |
|
616 | + __('Submit', 'event_espresso'), |
|
617 | 617 | |
618 | 618 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:19 |
619 | - __( 'All Dates', 'event_espresso' ), |
|
619 | + __('All Dates', 'event_espresso'), |
|
620 | 620 | |
621 | 621 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/DatesByMonthControl.tsx:26 |
622 | - __( 'dates by month', 'event_espresso' ), |
|
622 | + __('dates by month', 'event_espresso'), |
|
623 | 623 | |
624 | 624 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowExpiredTicketsControl.tsx:15 |
625 | - __( 'show expired tickets', 'event_espresso' ), |
|
625 | + __('show expired tickets', 'event_espresso'), |
|
626 | 626 | |
627 | 627 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedDatesControl.tsx:9 |
628 | - __( 'show trashed dates', 'event_espresso' ), |
|
628 | + __('show trashed dates', 'event_espresso'), |
|
629 | 629 | |
630 | 630 | // Reference: domains/eventEditor/src/ui/ticketAssignmentsManager/filters/controls/ShowTrashedTicketsControl.tsx:15 |
631 | - __( 'show trashed tickets', 'event_espresso' ), |
|
631 | + __('show trashed tickets', 'event_espresso'), |
|
632 | 632 | |
633 | 633 | // Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:13 |
634 | - __( 'total registrations.', 'event_espresso' ), |
|
634 | + __('total registrations.', 'event_espresso'), |
|
635 | 635 | |
636 | 636 | // Reference: domains/eventEditor/src/ui/tickets/TicketRegistrationsLink.tsx:14 |
637 | - __( 'view ALL registrations for this ticket.', 'event_espresso' ), |
|
637 | + __('view ALL registrations for this ticket.', 'event_espresso'), |
|
638 | 638 | |
639 | 639 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:37 |
640 | - __( 'Set ticket prices', 'event_espresso' ), |
|
640 | + __('Set ticket prices', 'event_espresso'), |
|
641 | 641 | |
642 | 642 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:44 |
643 | - __( 'Skip prices - assign dates', 'event_espresso' ), |
|
643 | + __('Skip prices - assign dates', 'event_espresso'), |
|
644 | 644 | |
645 | 645 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:55 |
646 | - __( 'Save and assign dates', 'event_espresso' ), |
|
646 | + __('Save and assign dates', 'event_espresso'), |
|
647 | 647 | |
648 | 648 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/FooterButtons.tsx:62 |
649 | - __( 'Ticket details', 'event_espresso' ), |
|
649 | + __('Ticket details', 'event_espresso'), |
|
650 | 650 | |
651 | 651 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:33 |
652 | 652 | /* translators: %s ticket id */ |
653 | - __( 'Edit ticket %s', 'event_espresso' ), |
|
653 | + __('Edit ticket %s', 'event_espresso'), |
|
654 | 654 | |
655 | 655 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/Modal.tsx:36 |
656 | - __( 'New Ticket Details', 'event_espresso' ), |
|
656 | + __('New Ticket Details', 'event_espresso'), |
|
657 | 657 | |
658 | 658 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10 |
659 | - __( 'primary information about the ticket', 'event_espresso' ), |
|
659 | + __('primary information about the ticket', 'event_espresso'), |
|
660 | 660 | |
661 | 661 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:10 |
662 | - __( 'Ticket Details', 'event_espresso' ), |
|
662 | + __('Ticket Details', 'event_espresso'), |
|
663 | 663 | |
664 | 664 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:12 |
665 | - __( 'apply ticket price modifiers and taxes', 'event_espresso' ), |
|
665 | + __('apply ticket price modifiers and taxes', 'event_espresso'), |
|
666 | 666 | |
667 | 667 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:14 |
668 | - __( 'Price Calculator', 'event_espresso' ), |
|
668 | + __('Price Calculator', 'event_espresso'), |
|
669 | 669 | |
670 | 670 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/multiStep/TicketFormSteps.tsx:16 |
671 | - __( 'Assign Dates', 'event_espresso' ), |
|
671 | + __('Assign Dates', 'event_espresso'), |
|
672 | 672 | |
673 | 673 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:119 |
674 | 674 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:112 |
675 | - __( 'Quantity For Sale', 'event_espresso' ), |
|
675 | + __('Quantity For Sale', 'event_espresso'), |
|
676 | 676 | |
677 | 677 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:125 |
678 | - __( 'The maximum number of this ticket available for sale.', 'event_espresso' ), |
|
678 | + __('The maximum number of this ticket available for sale.', 'event_espresso'), |
|
679 | 679 | |
680 | 680 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:127 |
681 | - __( 'Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso' ), |
|
681 | + __('Set to 0 to stop sales, or leave blank for no limit.', 'event_espresso'), |
|
682 | 682 | |
683 | 683 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:132 |
684 | 684 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:121 |
685 | - __( 'Number of Uses', 'event_espresso' ), |
|
685 | + __('Number of Uses', 'event_espresso'), |
|
686 | 686 | |
687 | 687 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:138 |
688 | - __( 'Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso' ), |
|
688 | + __('Controls the total number of times this ticket can be used, regardless of the number of dates it is assigned to.', 'event_espresso'), |
|
689 | 689 | |
690 | 690 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:142 |
691 | - __( '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' ), |
|
691 | + __('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'), |
|
692 | 692 | |
693 | 693 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:149 |
694 | 694 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:129 |
695 | - __( 'Minimum Quantity', 'event_espresso' ), |
|
695 | + __('Minimum Quantity', 'event_espresso'), |
|
696 | 696 | |
697 | 697 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:154 |
698 | - __( 'The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ), |
|
698 | + __('The minimum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'), |
|
699 | 699 | |
700 | 700 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:158 |
701 | - __( 'Leave blank for no minimum.', 'event_espresso' ), |
|
701 | + __('Leave blank for no minimum.', 'event_espresso'), |
|
702 | 702 | |
703 | 703 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:163 |
704 | 704 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:137 |
705 | - __( 'Maximum Quantity', 'event_espresso' ), |
|
705 | + __('Maximum Quantity', 'event_espresso'), |
|
706 | 706 | |
707 | 707 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:169 |
708 | - __( 'The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso' ), |
|
708 | + __('The maximum quantity that can be selected for this ticket. Use this to create ticket bundles or graduated pricing.', 'event_espresso'), |
|
709 | 709 | |
710 | 710 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:173 |
711 | - __( 'Leave blank for no maximum.', 'event_espresso' ), |
|
711 | + __('Leave blank for no maximum.', 'event_espresso'), |
|
712 | 712 | |
713 | 713 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:178 |
714 | 714 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/useBulkEditFormConfig.ts:146 |
715 | - __( 'Required Ticket', 'event_espresso' ), |
|
715 | + __('Required Ticket', 'event_espresso'), |
|
716 | 716 | |
717 | 717 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:180 |
718 | - __( 'If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso' ), |
|
718 | + __('If enabled, the ticket must be selected and will appear first in frontend ticket lists.', 'event_espresso'), |
|
719 | 719 | |
720 | 720 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:187 |
721 | - __( 'Default Ticket', 'event_espresso' ), |
|
721 | + __('Default Ticket', 'event_espresso'), |
|
722 | 722 | |
723 | 723 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:189 |
724 | - __( 'If enabled, the ticket will appear on all new events.', 'event_espresso' ), |
|
724 | + __('If enabled, the ticket will appear on all new events.', 'event_espresso'), |
|
725 | 725 | |
726 | 726 | // Reference: domains/eventEditor/src/ui/tickets/ticketForm/useTicketFormConfig.ts:96 |
727 | - __( 'Ticket Sales', 'event_espresso' ), |
|
727 | + __('Ticket Sales', 'event_espresso'), |
|
728 | 728 | |
729 | 729 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:36 |
730 | - __( 'Available Tickets', 'event_espresso' ), |
|
730 | + __('Available Tickets', 'event_espresso'), |
|
731 | 731 | |
732 | 732 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/TicketsList.tsx:39 |
733 | - __( 'loading tickets…', 'event_espresso' ), |
|
733 | + __('loading tickets…', 'event_espresso'), |
|
734 | 734 | |
735 | 735 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:26 |
736 | - __( 'Number of related dates', 'event_espresso' ), |
|
736 | + __('Number of related dates', 'event_espresso'), |
|
737 | 737 | |
738 | 738 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:27 |
739 | - __( 'There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso' ), |
|
739 | + __('There are no event dates assigned to this ticket. Please click the calendar icon to update the assignments.', 'event_espresso'), |
|
740 | 740 | |
741 | 741 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/AssignDatesButton.tsx:37 |
742 | - __( 'assign dates', 'event_espresso' ), |
|
742 | + __('assign dates', 'event_espresso'), |
|
743 | 743 | |
744 | 744 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:19 |
745 | - __( 'ticket main menu', 'event_espresso' ), |
|
745 | + __('ticket main menu', 'event_espresso'), |
|
746 | 746 | |
747 | 747 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:27 |
748 | - __( 'Permanently delete Ticket?', 'event_espresso' ), |
|
748 | + __('Permanently delete Ticket?', 'event_espresso'), |
|
749 | 749 | |
750 | 750 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:27 |
751 | - __( 'Move Ticket to Trash?', 'event_espresso' ), |
|
751 | + __('Move Ticket to Trash?', 'event_espresso'), |
|
752 | 752 | |
753 | 753 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:29 |
754 | - __( 'Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso' ), |
|
754 | + __('Are you sure you want to permanently delete this ticket? This action is permanent and can not be undone.', 'event_espresso'), |
|
755 | 755 | |
756 | 756 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:30 |
757 | - __( 'Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso' ), |
|
757 | + __('Are you sure you want to move this ticket to the trash? You can "untrash" this ticket later if you need to.', 'event_espresso'), |
|
758 | 758 | |
759 | 759 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:40 |
760 | - __( 'trash ticket', 'event_espresso' ), |
|
760 | + __('trash ticket', 'event_espresso'), |
|
761 | 761 | |
762 | 762 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:51 |
763 | - __( 'edit ticket', 'event_espresso' ), |
|
763 | + __('edit ticket', 'event_espresso'), |
|
764 | 764 | |
765 | 765 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/actionsMenu/dropdown/TicketMainMenu.tsx:52 |
766 | - __( 'copy ticket', 'event_espresso' ), |
|
766 | + __('copy ticket', 'event_espresso'), |
|
767 | 767 | |
768 | 768 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:42 |
769 | - __( 'edit ticket details', 'event_espresso' ), |
|
769 | + __('edit ticket details', 'event_espresso'), |
|
770 | 770 | |
771 | 771 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:46 |
772 | - __( 'delete tickets', 'event_espresso' ), |
|
772 | + __('delete tickets', 'event_espresso'), |
|
773 | 773 | |
774 | 774 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:46 |
775 | - __( 'trash tickets', 'event_espresso' ), |
|
775 | + __('trash tickets', 'event_espresso'), |
|
776 | 776 | |
777 | 777 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/actions/Actions.tsx:50 |
778 | - __( 'edit ticket prices', 'event_espresso' ), |
|
778 | + __('edit ticket prices', 'event_espresso'), |
|
779 | 779 | |
780 | 780 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:14 |
781 | - __( 'Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso' ), |
|
781 | + __('Are you sure you want to permanently delete these tickets? This action can NOT be undone!', 'event_espresso'), |
|
782 | 782 | |
783 | 783 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:15 |
784 | - __( 'Are you sure you want to trash these tickets?', 'event_espresso' ), |
|
784 | + __('Are you sure you want to trash these tickets?', 'event_espresso'), |
|
785 | 785 | |
786 | 786 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16 |
787 | - __( 'Delete tickets permanently', 'event_espresso' ), |
|
787 | + __('Delete tickets permanently', 'event_espresso'), |
|
788 | 788 | |
789 | 789 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/delete/Delete.tsx:16 |
790 | - __( 'Trash tickets', 'event_espresso' ), |
|
790 | + __('Trash tickets', 'event_espresso'), |
|
791 | 791 | |
792 | 792 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:21 |
793 | - __( 'Bulk edit ticket details', 'event_espresso' ), |
|
793 | + __('Bulk edit ticket details', 'event_espresso'), |
|
794 | 794 | |
795 | 795 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/details/EditDetails.tsx:22 |
796 | - __( 'any changes will be applied to ALL of the selected tickets.', 'event_espresso' ), |
|
796 | + __('any changes will be applied to ALL of the selected tickets.', 'event_espresso'), |
|
797 | 797 | |
798 | 798 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/EditPrices.tsx:19 |
799 | - __( 'Bulk edit ticket prices', 'event_espresso' ), |
|
799 | + __('Bulk edit ticket prices', 'event_espresso'), |
|
800 | 800 | |
801 | 801 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:20 |
802 | - __( 'Edit all prices together', 'event_espresso' ), |
|
802 | + __('Edit all prices together', 'event_espresso'), |
|
803 | 803 | |
804 | 804 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:21 |
805 | - __( 'Edit all the selected ticket prices dynamically', 'event_espresso' ), |
|
805 | + __('Edit all the selected ticket prices dynamically', 'event_espresso'), |
|
806 | 806 | |
807 | 807 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:25 |
808 | - __( 'Edit prices individually', 'event_espresso' ), |
|
808 | + __('Edit prices individually', 'event_espresso'), |
|
809 | 809 | |
810 | 810 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/EditModeButtons.tsx:26 |
811 | - __( 'Edit prices for each ticket individually', 'event_espresso' ), |
|
811 | + __('Edit prices for each ticket individually', 'event_espresso'), |
|
812 | 812 | |
813 | 813 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:14 |
814 | 814 | // Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:34 |
815 | 815 | // Reference: packages/form/src/ResetButton.tsx:18 |
816 | 816 | // Reference: packages/tpc/src/buttons/useResetButtonProps.tsx:12 |
817 | - __( 'Reset', 'event_espresso' ), |
|
817 | + __('Reset', 'event_espresso'), |
|
818 | 818 | |
819 | 819 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/buttons/FooterButtons.tsx:15 |
820 | 820 | // Reference: packages/ui-components/src/Modal/useCancelButtonProps.tsx:10 |
821 | - __( 'Cancel', 'event_espresso' ), |
|
821 | + __('Cancel', 'event_espresso'), |
|
822 | 822 | |
823 | 823 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/bulkEdit/prices/editSeparately/TPCInstance.tsx:27 |
824 | 824 | /* translators: %s ticket name */ |
825 | - __( 'Edit prices for Ticket: %s', 'event_espresso' ), |
|
825 | + __('Edit prices for Ticket: %s', 'event_espresso'), |
|
826 | 826 | |
827 | 827 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:37 |
828 | - __( 'Edit Ticket Sale Dates', 'event_espresso' ), |
|
828 | + __('Edit Ticket Sale Dates', 'event_espresso'), |
|
829 | 829 | |
830 | 830 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketCardSidebar.tsx:39 |
831 | - __( 'edit ticket sales start and end dates', 'event_espresso' ), |
|
831 | + __('edit ticket sales start and end dates', 'event_espresso'), |
|
832 | 832 | |
833 | 833 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketDetailsPanel.tsx:28 |
834 | - __( 'quantity', 'event_espresso' ), |
|
834 | + __('quantity', 'event_espresso'), |
|
835 | 835 | |
836 | 836 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/cardView/TicketQuantity.tsx:27 |
837 | - __( 'edit quantity of tickets available…', 'event_espresso' ), |
|
837 | + __('edit quantity of tickets available…', 'event_espresso'), |
|
838 | 838 | |
839 | 839 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:10 |
840 | - __( 'Move Ticket to Trash', 'event_espresso' ), |
|
840 | + __('Move Ticket to Trash', 'event_espresso'), |
|
841 | 841 | |
842 | 842 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:15 |
843 | 843 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:52 |
844 | - __( 'On Sale', 'event_espresso' ), |
|
844 | + __('On Sale', 'event_espresso'), |
|
845 | 845 | |
846 | 846 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:17 |
847 | - __( 'Pending', 'event_espresso' ), |
|
847 | + __('Pending', 'event_espresso'), |
|
848 | 848 | |
849 | 849 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:7 |
850 | - __( 'Edit Ticket Details', 'event_espresso' ), |
|
850 | + __('Edit Ticket Details', 'event_espresso'), |
|
851 | 851 | |
852 | 852 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:8 |
853 | - __( 'Manage Date Assignments', 'event_espresso' ), |
|
853 | + __('Manage Date Assignments', 'event_espresso'), |
|
854 | 854 | |
855 | 855 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/config.ts:9 |
856 | 856 | // Reference: packages/tpc/src/components/table/Table.tsx:44 |
857 | - __( 'Ticket Price Calculator', 'event_espresso' ), |
|
857 | + __('Ticket Price Calculator', 'event_espresso'), |
|
858 | 858 | |
859 | 859 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:33 |
860 | - __( 'edit ticket total…', 'event_espresso' ), |
|
860 | + __('edit ticket total…', 'event_espresso'), |
|
861 | 861 | |
862 | 862 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/editable/EditablePrice.tsx:43 |
863 | - __( 'set price…', 'event_espresso' ), |
|
863 | + __('set price…', 'event_espresso'), |
|
864 | 864 | |
865 | 865 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:23 |
866 | - __( 'tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso' ), |
|
866 | + __('tickets list is linked to dates list and is showing tickets for above dates only', 'event_espresso'), |
|
867 | 867 | |
868 | 868 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/IsChainedButton.tsx:24 |
869 | - __( 'tickets list is unlinked and is showing tickets for all event dates', 'event_espresso' ), |
|
869 | + __('tickets list is unlinked and is showing tickets for all event dates', 'event_espresso'), |
|
870 | 870 | |
871 | 871 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:10 |
872 | - __( 'ticket sales start and end dates', 'event_espresso' ), |
|
872 | + __('ticket sales start and end dates', 'event_espresso'), |
|
873 | 873 | |
874 | 874 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:15 |
875 | - __( 'tickets with 90% or more sold', 'event_espresso' ), |
|
875 | + __('tickets with 90% or more sold', 'event_espresso'), |
|
876 | 876 | |
877 | 877 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:16 |
878 | - __( 'tickets with 75% or more sold', 'event_espresso' ), |
|
878 | + __('tickets with 75% or more sold', 'event_espresso'), |
|
879 | 879 | |
880 | 880 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:17 |
881 | - __( 'tickets with 50% or more sold', 'event_espresso' ), |
|
881 | + __('tickets with 50% or more sold', 'event_espresso'), |
|
882 | 882 | |
883 | 883 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:19 |
884 | - __( 'tickets with less than 50% sold', 'event_espresso' ), |
|
884 | + __('tickets with less than 50% sold', 'event_espresso'), |
|
885 | 885 | |
886 | 886 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:28 |
887 | - __( 'all tickets for all dates', 'event_espresso' ), |
|
887 | + __('all tickets for all dates', 'event_espresso'), |
|
888 | 888 | |
889 | 889 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:29 |
890 | - __( 'all on sale and sale pending', 'event_espresso' ), |
|
890 | + __('all on sale and sale pending', 'event_espresso'), |
|
891 | 891 | |
892 | 892 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:30 |
893 | - __( 'on sale tickets only', 'event_espresso' ), |
|
893 | + __('on sale tickets only', 'event_espresso'), |
|
894 | 894 | |
895 | 895 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:31 |
896 | - __( 'sale pending tickets only', 'event_espresso' ), |
|
896 | + __('sale pending tickets only', 'event_espresso'), |
|
897 | 897 | |
898 | 898 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:32 |
899 | - __( 'next on sale or sale pending only', 'event_espresso' ), |
|
899 | + __('next on sale or sale pending only', 'event_espresso'), |
|
900 | 900 | |
901 | 901 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:33 |
902 | - __( 'sold out tickets only', 'event_espresso' ), |
|
902 | + __('sold out tickets only', 'event_espresso'), |
|
903 | 903 | |
904 | 904 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:34 |
905 | - __( 'expired tickets only', 'event_espresso' ), |
|
905 | + __('expired tickets only', 'event_espresso'), |
|
906 | 906 | |
907 | 907 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:35 |
908 | - __( 'trashed tickets only', 'event_espresso' ), |
|
908 | + __('trashed tickets only', 'event_espresso'), |
|
909 | 909 | |
910 | 910 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:40 |
911 | - __( 'all tickets for above dates', 'event_espresso' ), |
|
911 | + __('all tickets for above dates', 'event_espresso'), |
|
912 | 912 | |
913 | 913 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:44 |
914 | - __( 'ticket sale date', 'event_espresso' ), |
|
914 | + __('ticket sale date', 'event_espresso'), |
|
915 | 915 | |
916 | 916 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:45 |
917 | - __( 'ticket name', 'event_espresso' ), |
|
917 | + __('ticket name', 'event_espresso'), |
|
918 | 918 | |
919 | 919 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:46 |
920 | - __( 'ticket ID', 'event_espresso' ), |
|
920 | + __('ticket ID', 'event_espresso'), |
|
921 | 921 | |
922 | 922 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:52 |
923 | - __( 'link', 'event_espresso' ), |
|
923 | + __('link', 'event_espresso'), |
|
924 | 924 | |
925 | 925 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:8 |
926 | - __( 'ticket sales start date only', 'event_espresso' ), |
|
926 | + __('ticket sales start date only', 'event_espresso'), |
|
927 | 927 | |
928 | 928 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/filterBar/controls/options.ts:9 |
929 | - __( 'ticket sales end date only', 'event_espresso' ), |
|
929 | + __('ticket sales end date only', 'event_espresso'), |
|
930 | 930 | |
931 | 931 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:18 |
932 | - __( 'Add New Ticket', 'event_espresso' ), |
|
932 | + __('Add New Ticket', 'event_espresso'), |
|
933 | 933 | |
934 | 934 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:31 |
935 | - __( 'Add a single ticket and assign the dates to it', 'event_espresso' ), |
|
935 | + __('Add a single ticket and assign the dates to it', 'event_espresso'), |
|
936 | 936 | |
937 | 937 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/newTicketOptions/AddSingleTicket.tsx:33 |
938 | - __( 'Single Ticket', 'event_espresso' ), |
|
938 | + __('Single Ticket', 'event_espresso'), |
|
939 | 939 | |
940 | 940 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/TableView.tsx:39 |
941 | - __( 'Tickets', 'event_espresso' ), |
|
941 | + __('Tickets', 'event_espresso'), |
|
942 | 942 | |
943 | 943 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:110 |
944 | - __( 'Registrations', 'event_espresso' ), |
|
944 | + __('Registrations', 'event_espresso'), |
|
945 | 945 | |
946 | 946 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:51 |
947 | - __( 'Goes on Sale', 'event_espresso' ), |
|
947 | + __('Goes on Sale', 'event_espresso'), |
|
948 | 948 | |
949 | 949 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:65 |
950 | - __( 'Sale Ends', 'event_espresso' ), |
|
950 | + __('Sale Ends', 'event_espresso'), |
|
951 | 951 | |
952 | 952 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:66 |
953 | - __( 'Ends', 'event_espresso' ), |
|
953 | + __('Ends', 'event_espresso'), |
|
954 | 954 | |
955 | 955 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:78 |
956 | - __( 'Price', 'event_espresso' ), |
|
956 | + __('Price', 'event_espresso'), |
|
957 | 957 | |
958 | 958 | // Reference: domains/eventEditor/src/ui/tickets/ticketsList/tableView/useHeaderRowGenerator.tsx:88 |
959 | - __( 'Quantity', 'event_espresso' ), |
|
959 | + __('Quantity', 'event_espresso'), |
|
960 | 960 | |
961 | 961 | // Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:29 |
962 | - __( 'Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso' ), |
|
962 | + __('Do you have a moment to share why you are deactivating Event Espresso?', 'event_espresso'), |
|
963 | 963 | |
964 | 964 | // Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:40 |
965 | - __( 'Skip', 'event_espresso' ), |
|
965 | + __('Skip', 'event_espresso'), |
|
966 | 966 | |
967 | 967 | // Reference: domains/wpPluginsPage/src/exitSurvey/Popup.tsx:42 |
968 | - __( 'Sure I\'ll help', 'event_espresso' ), |
|
968 | + __('Sure I\'ll help', 'event_espresso'), |
|
969 | 969 | |
970 | 970 | // Reference: packages/adapters/src/Pagination/Pagination.tsx:23 |
971 | - __( 'pagination', 'event_espresso' ), |
|
971 | + __('pagination', 'event_espresso'), |
|
972 | 972 | |
973 | 973 | // Reference: packages/constants/src/datetime.ts:10 |
974 | - __( 'Postponed', 'event_espresso' ), |
|
974 | + __('Postponed', 'event_espresso'), |
|
975 | 975 | |
976 | 976 | // Reference: packages/constants/src/datetime.ts:11 |
977 | - __( 'SoldOut', 'event_espresso' ), |
|
977 | + __('SoldOut', 'event_espresso'), |
|
978 | 978 | |
979 | 979 | // Reference: packages/constants/src/datetime.ts:7 |
980 | 980 | // Reference: packages/predicates/src/registration/statusOptions.ts:10 |
981 | - __( 'Cancelled', 'event_espresso' ), |
|
981 | + __('Cancelled', 'event_espresso'), |
|
982 | 982 | |
983 | 983 | // Reference: packages/constants/src/datetime.ts:9 |
984 | - __( 'Inactive', 'event_espresso' ), |
|
984 | + __('Inactive', 'event_espresso'), |
|
985 | 985 | |
986 | 986 | // Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:13 |
987 | - __( 'day in range', 'event_espresso' ), |
|
987 | + __('day in range', 'event_espresso'), |
|
988 | 988 | |
989 | 989 | // Reference: packages/dates/src/components/DateRangePicker/DateRangePickerLegend.tsx:17 |
990 | 990 | // Reference: packages/dates/src/components/DateRangePicker/index.tsx:61 |
991 | - __( 'end date', 'event_espresso' ), |
|
991 | + __('end date', 'event_espresso'), |
|
992 | 992 | |
993 | 993 | // Reference: packages/dates/src/components/DateTimePicker.tsx:13 |
994 | 994 | // Reference: packages/dates/src/components/TimePicker.tsx:13 |
995 | - __( 'time', 'event_espresso' ), |
|
995 | + __('time', 'event_espresso'), |
|
996 | 996 | |
997 | 997 | // Reference: packages/dates/src/constants.ts:5 |
998 | - __( 'End Date & Time must be set later than the Start Date & Time', 'event_espresso' ), |
|
998 | + __('End Date & Time must be set later than the Start Date & Time', 'event_espresso'), |
|
999 | 999 | |
1000 | 1000 | // Reference: packages/dates/src/constants.ts:7 |
1001 | - __( 'Start Date & Time must be set before the End Date & Time', 'event_espresso' ), |
|
1001 | + __('Start Date & Time must be set before the End Date & Time', 'event_espresso'), |
|
1002 | 1002 | |
1003 | 1003 | // Reference: packages/dates/src/utils/misc.ts:14 |
1004 | - __( 'month(s)', 'event_espresso' ), |
|
1004 | + __('month(s)', 'event_espresso'), |
|
1005 | 1005 | |
1006 | 1006 | // Reference: packages/dates/src/utils/misc.ts:15 |
1007 | - __( 'week(s)', 'event_espresso' ), |
|
1007 | + __('week(s)', 'event_espresso'), |
|
1008 | 1008 | |
1009 | 1009 | // Reference: packages/dates/src/utils/misc.ts:16 |
1010 | - __( 'day(s)', 'event_espresso' ), |
|
1010 | + __('day(s)', 'event_espresso'), |
|
1011 | 1011 | |
1012 | 1012 | // Reference: packages/dates/src/utils/misc.ts:17 |
1013 | - __( 'hour(s)', 'event_espresso' ), |
|
1013 | + __('hour(s)', 'event_espresso'), |
|
1014 | 1014 | |
1015 | 1015 | // Reference: packages/dates/src/utils/misc.ts:18 |
1016 | - __( 'minute(s)', 'event_espresso' ), |
|
1016 | + __('minute(s)', 'event_espresso'), |
|
1017 | 1017 | |
1018 | 1018 | // Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:104 |
1019 | - __( 'price types initialized', 'event_espresso' ), |
|
1019 | + __('price types initialized', 'event_espresso'), |
|
1020 | 1020 | |
1021 | 1021 | // Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:114 |
1022 | - __( 'datetimes initialized', 'event_espresso' ), |
|
1022 | + __('datetimes initialized', 'event_espresso'), |
|
1023 | 1023 | |
1024 | 1024 | // Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:124 |
1025 | - __( 'tickets initialized', 'event_espresso' ), |
|
1025 | + __('tickets initialized', 'event_espresso'), |
|
1026 | 1026 | |
1027 | 1027 | // Reference: packages/edtr-services/src/apollo/initialization/useCacheRehydration.ts:134 |
1028 | - __( 'prices initialized', 'event_espresso' ), |
|
1028 | + __('prices initialized', 'event_espresso'), |
|
1029 | 1029 | |
1030 | 1030 | // Reference: packages/edtr-services/src/apollo/mutations/useReorderEntities.ts:73 |
1031 | - __( 'reordering has been applied', 'event_espresso' ), |
|
1031 | + __('reordering has been applied', 'event_espresso'), |
|
1032 | 1032 | |
1033 | 1033 | // Reference: packages/edtr-services/src/tpc/utils/constants.ts:3 |
1034 | - __( '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 archive the old tickets.', 'event_espresso' ), |
|
1034 | + __('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 archive the old tickets.', 'event_espresso'), |
|
1035 | 1035 | |
1036 | 1036 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:32 |
1037 | - __( 'End date has been set one hour after start date', 'event_espresso' ), |
|
1037 | + __('End date has been set one hour after start date', 'event_espresso'), |
|
1038 | 1038 | |
1039 | 1039 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:44 |
1040 | - __( 'Start date has been set one hour before end date', 'event_espresso' ), |
|
1040 | + __('Start date has been set one hour before end date', 'event_espresso'), |
|
1041 | 1041 | |
1042 | 1042 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:62 |
1043 | - __( 'Required', 'event_espresso' ), |
|
1043 | + __('Required', 'event_espresso'), |
|
1044 | 1044 | |
1045 | 1045 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:67 |
1046 | - __( 'Start Date is required', 'event_espresso' ), |
|
1046 | + __('Start Date is required', 'event_espresso'), |
|
1047 | 1047 | |
1048 | 1048 | // Reference: packages/edtr-services/src/utils/dateAndTime.ts:71 |
1049 | - __( 'End Date is required', 'event_espresso' ), |
|
1049 | + __('End Date is required', 'event_espresso'), |
|
1050 | 1050 | |
1051 | 1051 | // Reference: packages/ee-components/src/EntityList/EntityList.tsx:30 |
1052 | - __( 'no results found', 'event_espresso' ), |
|
1052 | + __('no results found', 'event_espresso'), |
|
1053 | 1053 | |
1054 | 1054 | // Reference: packages/ee-components/src/EntityList/EntityList.tsx:31 |
1055 | - __( 'try changing filter settings', 'event_espresso' ), |
|
1055 | + __('try changing filter settings', 'event_espresso'), |
|
1056 | 1056 | |
1057 | 1057 | // Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:38 |
1058 | 1058 | /* translators: %d entity id */ |
1059 | - __( 'select entity with id %d', 'event_espresso' ), |
|
1059 | + __('select entity with id %d', 'event_espresso'), |
|
1060 | 1060 | |
1061 | 1061 | // Reference: packages/ee-components/src/bulkEdit/ActionCheckbox.tsx:41 |
1062 | - __( 'select all entities', 'event_espresso' ), |
|
1062 | + __('select all entities', 'event_espresso'), |
|
1063 | 1063 | |
1064 | 1064 | // Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20 |
1065 | - __( 'Note: ', 'event_espresso' ), |
|
1065 | + __('Note: ', 'event_espresso'), |
|
1066 | 1066 | |
1067 | 1067 | // Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:20 |
1068 | - __( 'any changes will be applied to ALL of the selected entities.', 'event_espresso' ), |
|
1068 | + __('any changes will be applied to ALL of the selected entities.', 'event_espresso'), |
|
1069 | 1069 | |
1070 | 1070 | // Reference: packages/ee-components/src/bulkEdit/details/BulkEditDetails.tsx:26 |
1071 | - __( 'Bulk edit details', 'event_espresso' ), |
|
1071 | + __('Bulk edit details', 'event_espresso'), |
|
1072 | 1072 | |
1073 | 1073 | // Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:17 |
1074 | - __( 'Are you sure you want to bulk update the details?', 'event_espresso' ), |
|
1074 | + __('Are you sure you want to bulk update the details?', 'event_espresso'), |
|
1075 | 1075 | |
1076 | 1076 | // Reference: packages/ee-components/src/bulkEdit/details/Submit.tsx:18 |
1077 | - __( 'Bulk update details', 'event_espresso' ), |
|
1077 | + __('Bulk update details', 'event_espresso'), |
|
1078 | 1078 | |
1079 | 1079 | // Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:26 |
1080 | - __( 'reorder dates', 'event_espresso' ), |
|
1080 | + __('reorder dates', 'event_espresso'), |
|
1081 | 1081 | |
1082 | 1082 | // Reference: packages/ee-components/src/filterBar/SortByControl/index.tsx:26 |
1083 | - __( 'reorder tickets', 'event_espresso' ), |
|
1083 | + __('reorder tickets', 'event_espresso'), |
|
1084 | 1084 | |
1085 | 1085 | // Reference: packages/form/src/renderers/RepeatableRenderer.tsx:36 |
1086 | 1086 | /* translators: %d the entry number */ |
1087 | - __( 'Entry %d', 'event_espresso' ), |
|
1087 | + __('Entry %d', 'event_espresso'), |
|
1088 | 1088 | |
1089 | 1089 | // Reference: packages/form/src/renderers/RepeatableRenderer.tsx:52 |
1090 | - __( 'Add', 'event_espresso' ), |
|
1090 | + __('Add', 'event_espresso'), |
|
1091 | 1091 | |
1092 | 1092 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:11 |
1093 | 1093 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:17 |
1094 | - __( 'sold out', 'event_espresso' ), |
|
1094 | + __('sold out', 'event_espresso'), |
|
1095 | 1095 | |
1096 | 1096 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:14 |
1097 | 1097 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:14 |
1098 | - __( 'expired', 'event_espresso' ), |
|
1098 | + __('expired', 'event_espresso'), |
|
1099 | 1099 | |
1100 | 1100 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:17 |
1101 | - __( 'upcoming', 'event_espresso' ), |
|
1101 | + __('upcoming', 'event_espresso'), |
|
1102 | 1102 | |
1103 | 1103 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:20 |
1104 | - __( 'active', 'event_espresso' ), |
|
1104 | + __('active', 'event_espresso'), |
|
1105 | 1105 | |
1106 | 1106 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:23 |
1107 | 1107 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:11 |
1108 | - __( 'trashed', 'event_espresso' ), |
|
1108 | + __('trashed', 'event_espresso'), |
|
1109 | 1109 | |
1110 | 1110 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:26 |
1111 | - __( 'cancelled', 'event_espresso' ), |
|
1111 | + __('cancelled', 'event_espresso'), |
|
1112 | 1112 | |
1113 | 1113 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:29 |
1114 | - __( 'postponed', 'event_espresso' ), |
|
1114 | + __('postponed', 'event_espresso'), |
|
1115 | 1115 | |
1116 | 1116 | // Reference: packages/helpers/src/datetimes/getStatusTextLabel.ts:33 |
1117 | - __( 'inactive', 'event_espresso' ), |
|
1117 | + __('inactive', 'event_espresso'), |
|
1118 | 1118 | |
1119 | 1119 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:20 |
1120 | - __( 'pending', 'event_espresso' ), |
|
1120 | + __('pending', 'event_espresso'), |
|
1121 | 1121 | |
1122 | 1122 | // Reference: packages/helpers/src/tickets/getStatusTextLabel.ts:23 |
1123 | - __( 'on sale', 'event_espresso' ), |
|
1123 | + __('on sale', 'event_espresso'), |
|
1124 | 1124 | |
1125 | 1125 | // Reference: packages/predicates/src/registration/statusOptions.ts:14 |
1126 | - __( 'Declined', 'event_espresso' ), |
|
1126 | + __('Declined', 'event_espresso'), |
|
1127 | 1127 | |
1128 | 1128 | // Reference: packages/predicates/src/registration/statusOptions.ts:18 |
1129 | - __( 'Incomplete', 'event_espresso' ), |
|
1129 | + __('Incomplete', 'event_espresso'), |
|
1130 | 1130 | |
1131 | 1131 | // Reference: packages/predicates/src/registration/statusOptions.ts:22 |
1132 | - __( 'Not Approved', 'event_espresso' ), |
|
1132 | + __('Not Approved', 'event_espresso'), |
|
1133 | 1133 | |
1134 | 1134 | // Reference: packages/predicates/src/registration/statusOptions.ts:26 |
1135 | - __( 'Pending Payment', 'event_espresso' ), |
|
1135 | + __('Pending Payment', 'event_espresso'), |
|
1136 | 1136 | |
1137 | 1137 | // Reference: packages/predicates/src/registration/statusOptions.ts:30 |
1138 | - __( 'Wait List', 'event_espresso' ), |
|
1138 | + __('Wait List', 'event_espresso'), |
|
1139 | 1139 | |
1140 | 1140 | // Reference: packages/predicates/src/registration/statusOptions.ts:6 |
1141 | - __( 'Approved', 'event_espresso' ), |
|
1141 | + __('Approved', 'event_espresso'), |
|
1142 | 1142 | |
1143 | 1143 | // Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:10 |
1144 | 1144 | // Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:12 |
1145 | - __( 'Select', 'event_espresso' ), |
|
1145 | + __('Select', 'event_espresso'), |
|
1146 | 1146 | |
1147 | 1147 | // Reference: packages/rich-text-editor/src/components/AdvancedTextEditor/toolbarButtons/WPMedia.tsx:8 |
1148 | 1148 | // Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:10 |
1149 | - __( 'Select media', 'event_espresso' ), |
|
1149 | + __('Select media', 'event_espresso'), |
|
1150 | 1150 | |
1151 | 1151 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/RichTextEditor.tsx:81 |
1152 | - __( 'Write something…', 'event_espresso' ), |
|
1152 | + __('Write something…', 'event_espresso'), |
|
1153 | 1153 | |
1154 | 1154 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/Toolbar.tsx:20 |
1155 | - __( 'RTE Toolbar', 'event_espresso' ), |
|
1155 | + __('RTE Toolbar', 'event_espresso'), |
|
1156 | 1156 | |
1157 | 1157 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:11 |
1158 | - __( 'Normal', 'event_espresso' ), |
|
1158 | + __('Normal', 'event_espresso'), |
|
1159 | 1159 | |
1160 | 1160 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:12 |
1161 | - __( 'H1', 'event_espresso' ), |
|
1161 | + __('H1', 'event_espresso'), |
|
1162 | 1162 | |
1163 | 1163 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:13 |
1164 | - __( 'H2', 'event_espresso' ), |
|
1164 | + __('H2', 'event_espresso'), |
|
1165 | 1165 | |
1166 | 1166 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:14 |
1167 | - __( 'H3', 'event_espresso' ), |
|
1167 | + __('H3', 'event_espresso'), |
|
1168 | 1168 | |
1169 | 1169 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:15 |
1170 | - __( 'H4', 'event_espresso' ), |
|
1170 | + __('H4', 'event_espresso'), |
|
1171 | 1171 | |
1172 | 1172 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:16 |
1173 | - __( 'H5', 'event_espresso' ), |
|
1173 | + __('H5', 'event_espresso'), |
|
1174 | 1174 | |
1175 | 1175 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:17 |
1176 | - __( 'H6', 'event_espresso' ), |
|
1176 | + __('H6', 'event_espresso'), |
|
1177 | 1177 | |
1178 | 1178 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:18 |
1179 | - __( 'Block quote', 'event_espresso' ), |
|
1179 | + __('Block quote', 'event_espresso'), |
|
1180 | 1180 | |
1181 | 1181 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/blockType/Component.tsx:19 |
1182 | - __( 'Code', 'event_espresso' ), |
|
1182 | + __('Code', 'event_espresso'), |
|
1183 | 1183 | |
1184 | 1184 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:34 |
1185 | - __( 'Set color', 'event_espresso' ), |
|
1185 | + __('Set color', 'event_espresso'), |
|
1186 | 1186 | |
1187 | 1187 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:40 |
1188 | - __( 'Text color', 'event_espresso' ), |
|
1188 | + __('Text color', 'event_espresso'), |
|
1189 | 1189 | |
1190 | 1190 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/colorPicker/Component.tsx:42 |
1191 | - __( 'Background color', 'event_espresso' ), |
|
1191 | + __('Background color', 'event_espresso'), |
|
1192 | 1192 | |
1193 | 1193 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:33 |
1194 | - __( 'Add image', 'event_espresso' ), |
|
1194 | + __('Add image', 'event_espresso'), |
|
1195 | 1195 | |
1196 | 1196 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:42 |
1197 | - __( 'Image URL', 'event_espresso' ), |
|
1197 | + __('Image URL', 'event_espresso'), |
|
1198 | 1198 | |
1199 | 1199 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:46 |
1200 | - __( 'Alt text', 'event_espresso' ), |
|
1200 | + __('Alt text', 'event_espresso'), |
|
1201 | 1201 | |
1202 | 1202 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:47 |
1203 | - __( 'Width', 'event_espresso' ), |
|
1203 | + __('Width', 'event_espresso'), |
|
1204 | 1204 | |
1205 | 1205 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/image/Component.tsx:51 |
1206 | - __( 'Height', 'event_espresso' ), |
|
1206 | + __('Height', 'event_espresso'), |
|
1207 | 1207 | |
1208 | 1208 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:48 |
1209 | - __( 'Edit link', 'event_espresso' ), |
|
1209 | + __('Edit link', 'event_espresso'), |
|
1210 | 1210 | |
1211 | 1211 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/link/Component.tsx:54 |
1212 | - __( 'URL title', 'event_espresso' ), |
|
1212 | + __('URL title', 'event_espresso'), |
|
1213 | 1213 | |
1214 | 1214 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:11 |
1215 | - __( 'Unordered list', 'event_espresso' ), |
|
1215 | + __('Unordered list', 'event_espresso'), |
|
1216 | 1216 | |
1217 | 1217 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:12 |
1218 | - __( 'Ordered list', 'event_espresso' ), |
|
1218 | + __('Ordered list', 'event_espresso'), |
|
1219 | 1219 | |
1220 | 1220 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:13 |
1221 | 1221 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:13 |
1222 | - __( 'Indent', 'event_espresso' ), |
|
1222 | + __('Indent', 'event_espresso'), |
|
1223 | 1223 | |
1224 | 1224 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/list/Component.tsx:14 |
1225 | 1225 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:14 |
1226 | - __( 'Outdent', 'event_espresso' ), |
|
1226 | + __('Outdent', 'event_espresso'), |
|
1227 | 1227 | |
1228 | 1228 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:11 |
1229 | - __( 'Unordered textalign', 'event_espresso' ), |
|
1229 | + __('Unordered textalign', 'event_espresso'), |
|
1230 | 1230 | |
1231 | 1231 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/Toolbar/controls/textAlign/Component.tsx:12 |
1232 | - __( 'Ordered textalign', 'event_espresso' ), |
|
1232 | + __('Ordered textalign', 'event_espresso'), |
|
1233 | 1233 | |
1234 | 1234 | // Reference: packages/rich-text-editor/src/components/RichTextEditor/render/Image/Toolbar.tsx:30 |
1235 | - __( 'Image toolbar', 'event_espresso' ), |
|
1235 | + __('Image toolbar', 'event_espresso'), |
|
1236 | 1236 | |
1237 | 1237 | // Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:59 |
1238 | 1238 | // Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:33 |
1239 | - __( 'Visual editor', 'event_espresso' ), |
|
1239 | + __('Visual editor', 'event_espresso'), |
|
1240 | 1240 | |
1241 | 1241 | // Reference: packages/rich-text-editor/src/components/WithEditMode/WithEditMode.tsx:60 |
1242 | 1242 | // Reference: packages/rich-text-editor/src/rte-old/components/RTEWithEditMode/RTEWithEditMode.tsx:34 |
1243 | - __( 'HTML editor', 'event_espresso' ), |
|
1243 | + __('HTML editor', 'event_espresso'), |
|
1244 | 1244 | |
1245 | 1245 | // Reference: packages/rich-text-editor/src/rte-old/components/toolbarButtons/WPMedia.tsx:68 |
1246 | - __( 'Add Media', 'event_espresso' ), |
|
1246 | + __('Add Media', 'event_espresso'), |
|
1247 | 1247 | |
1248 | 1248 | // Reference: packages/tpc/src/buttons/AddPriceModifierButton.tsx:14 |
1249 | - __( 'add new price modifier after this row', 'event_espresso' ), |
|
1249 | + __('add new price modifier after this row', 'event_espresso'), |
|
1250 | 1250 | |
1251 | 1251 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:12 |
1252 | - __( 'Delete all prices', 'event_espresso' ), |
|
1252 | + __('Delete all prices', 'event_espresso'), |
|
1253 | 1253 | |
1254 | 1254 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:25 |
1255 | - __( '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' ), |
|
1255 | + __('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'), |
|
1256 | 1256 | |
1257 | 1257 | // Reference: packages/tpc/src/buttons/DeleteAllPricesButton.tsx:29 |
1258 | - __( 'Delete all prices?', 'event_espresso' ), |
|
1258 | + __('Delete all prices?', 'event_espresso'), |
|
1259 | 1259 | |
1260 | 1260 | // Reference: packages/tpc/src/buttons/DeletePriceModifierButton.tsx:12 |
1261 | - __( 'delete price modifier', 'event_espresso' ), |
|
1261 | + __('delete price modifier', 'event_espresso'), |
|
1262 | 1262 | |
1263 | 1263 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:14 |
1264 | - __( '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' ), |
|
1264 | + __('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'), |
|
1265 | 1265 | |
1266 | 1266 | // Reference: packages/tpc/src/buttons/ReverseCalculateButton.tsx:17 |
1267 | - __( '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' ), |
|
1267 | + __('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'), |
|
1268 | 1268 | |
1269 | 1269 | // Reference: packages/tpc/src/buttons/TicketPriceCalculatorButton.tsx:25 |
1270 | - __( 'ticket price calculator', 'event_espresso' ), |
|
1270 | + __('ticket price calculator', 'event_espresso'), |
|
1271 | 1271 | |
1272 | 1272 | // Reference: packages/tpc/src/buttons/taxes/AddDefaultTaxesButton.tsx:9 |
1273 | - __( 'Add default taxes', 'event_espresso' ), |
|
1273 | + __('Add default taxes', 'event_espresso'), |
|
1274 | 1274 | |
1275 | 1275 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:10 |
1276 | - __( 'Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso' ), |
|
1276 | + __('Are you sure you want to remove all of this ticket\'s taxes?', 'event_espresso'), |
|
1277 | 1277 | |
1278 | 1278 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:14 |
1279 | - __( 'Remove all taxes?', 'event_espresso' ), |
|
1279 | + __('Remove all taxes?', 'event_espresso'), |
|
1280 | 1280 | |
1281 | 1281 | // Reference: packages/tpc/src/buttons/taxes/RemoveTaxesButton.tsx:7 |
1282 | - __( 'Remove taxes', 'event_espresso' ), |
|
1282 | + __('Remove taxes', 'event_espresso'), |
|
1283 | 1283 | |
1284 | 1284 | // Reference: packages/tpc/src/components/DefaultPricesInfo.tsx:28 |
1285 | - __( 'Modify default prices.', 'event_espresso' ), |
|
1285 | + __('Modify default prices.', 'event_espresso'), |
|
1286 | 1286 | |
1287 | 1287 | // Reference: packages/tpc/src/components/DefaultTaxesInfo.tsx:27 |
1288 | - __( 'New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso' ), |
|
1288 | + __('New default taxes are available. Click the - Add default taxes - button to add them now.', 'event_espresso'), |
|
1289 | 1289 | |
1290 | 1290 | // Reference: packages/tpc/src/components/NoPricesBanner/AddDefaultPricesButton.tsx:9 |
1291 | - __( 'Add default prices', 'event_espresso' ), |
|
1291 | + __('Add default prices', 'event_espresso'), |
|
1292 | 1292 | |
1293 | 1293 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:13 |
1294 | - __( 'This Ticket is Currently Free', 'event_espresso' ), |
|
1294 | + __('This Ticket is Currently Free', 'event_espresso'), |
|
1295 | 1295 | |
1296 | 1296 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:21 |
1297 | 1297 | /* translators: %s default prices */ |
1298 | - __( 'Click the button below to load your %s into the calculator.', 'event_espresso' ), |
|
1298 | + __('Click the button below to load your %s into the calculator.', 'event_espresso'), |
|
1299 | 1299 | |
1300 | 1300 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:22 |
1301 | - __( 'default prices', 'event_espresso' ), |
|
1301 | + __('default prices', 'event_espresso'), |
|
1302 | 1302 | |
1303 | 1303 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:29 |
1304 | - __( 'Additional ticket price modifiers can be added or removed.', 'event_espresso' ), |
|
1304 | + __('Additional ticket price modifiers can be added or removed.', 'event_espresso'), |
|
1305 | 1305 | |
1306 | 1306 | // Reference: packages/tpc/src/components/NoPricesBanner/index.tsx:32 |
1307 | - __( 'Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso' ), |
|
1307 | + __('Click the save button below to assign which dates this ticket will be available for purchase on.', 'event_espresso'), |
|
1308 | 1308 | |
1309 | 1309 | // Reference: packages/tpc/src/components/TicketPriceCalculatorModal.tsx:31 |
1310 | 1310 | /* translators: %s ticket name */ |
1311 | - __( 'Price Calculator for Ticket: %s', 'event_espresso' ), |
|
1311 | + __('Price Calculator for Ticket: %s', 'event_espresso'), |
|
1312 | 1312 | |
1313 | 1313 | // Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:41 |
1314 | - __( 'Total', 'event_espresso' ), |
|
1314 | + __('Total', 'event_espresso'), |
|
1315 | 1315 | |
1316 | 1316 | // Reference: packages/tpc/src/components/table/useFooterRowGenerator.tsx:50 |
1317 | - __( 'ticket total', 'event_espresso' ), |
|
1317 | + __('ticket total', 'event_espresso'), |
|
1318 | 1318 | |
1319 | 1319 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:29 |
1320 | - __( 'Price Type', 'event_espresso' ), |
|
1320 | + __('Price Type', 'event_espresso'), |
|
1321 | 1321 | |
1322 | 1322 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:35 |
1323 | - __( 'Label', 'event_espresso' ), |
|
1323 | + __('Label', 'event_espresso'), |
|
1324 | 1324 | |
1325 | 1325 | // Reference: packages/tpc/src/components/table/useHeaderRowGenerator.ts:47 |
1326 | - __( 'Amount', 'event_espresso' ), |
|
1326 | + __('Amount', 'event_espresso'), |
|
1327 | 1327 | |
1328 | 1328 | // Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:31 |
1329 | - __( 'amount', 'event_espresso' ), |
|
1329 | + __('amount', 'event_espresso'), |
|
1330 | 1330 | |
1331 | 1331 | // Reference: packages/tpc/src/inputs/PriceAmountInput.tsx:42 |
1332 | - __( 'amount…', 'event_espresso' ), |
|
1332 | + __('amount…', 'event_espresso'), |
|
1333 | 1333 | |
1334 | 1334 | // Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:14 |
1335 | - __( 'description…', 'event_espresso' ), |
|
1335 | + __('description…', 'event_espresso'), |
|
1336 | 1336 | |
1337 | 1337 | // Reference: packages/tpc/src/inputs/PriceDescriptionInput.tsx:9 |
1338 | - __( 'price description', 'event_espresso' ), |
|
1338 | + __('price description', 'event_espresso'), |
|
1339 | 1339 | |
1340 | 1340 | // Reference: packages/tpc/src/inputs/PriceIdInput.tsx:7 |
1341 | - __( 'price id', 'event_espresso' ), |
|
1341 | + __('price id', 'event_espresso'), |
|
1342 | 1342 | |
1343 | 1343 | // Reference: packages/tpc/src/inputs/PriceNameInput.tsx:13 |
1344 | - __( 'label…', 'event_espresso' ), |
|
1344 | + __('label…', 'event_espresso'), |
|
1345 | 1345 | |
1346 | 1346 | // Reference: packages/tpc/src/inputs/PriceNameInput.tsx:8 |
1347 | - __( 'price name', 'event_espresso' ), |
|
1347 | + __('price name', 'event_espresso'), |
|
1348 | 1348 | |
1349 | 1349 | // Reference: packages/tpc/src/inputs/PriceTypeInput.tsx:14 |
1350 | - __( 'price type', 'event_espresso' ), |
|
1350 | + __('price type', 'event_espresso'), |
|
1351 | 1351 | |
1352 | 1352 | // Reference: packages/ui-components/src/ActiveFilters/ActiveFilters.tsx:8 |
1353 | - __( 'active filters:', 'event_espresso' ), |
|
1353 | + __('active filters:', 'event_espresso'), |
|
1354 | 1354 | |
1355 | 1355 | // Reference: packages/ui-components/src/ActiveFilters/FilterTag.tsx:10 |
1356 | 1356 | /* translators: %s filter name */ |
1357 | - __( 'remove filter - %s', 'event_espresso' ), |
|
1357 | + __('remove filter - %s', 'event_espresso'), |
|
1358 | 1358 | |
1359 | 1359 | // Reference: packages/ui-components/src/CalendarDateRange/CalendarDateRange.tsx:37 |
1360 | - __( 'to', 'event_espresso' ), |
|
1360 | + __('to', 'event_espresso'), |
|
1361 | 1361 | |
1362 | 1362 | // Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:34 |
1363 | - __( 'starts', 'event_espresso' ), |
|
1363 | + __('starts', 'event_espresso'), |
|
1364 | 1364 | |
1365 | 1365 | // Reference: packages/ui-components/src/CalendarDateSwitcher/CalendarDateSwitcher.tsx:47 |
1366 | - __( 'ends', 'event_espresso' ), |
|
1366 | + __('ends', 'event_espresso'), |
|
1367 | 1367 | |
1368 | 1368 | // Reference: packages/ui-components/src/CalendarPageDate/CalendarPageDate.tsx:54 |
1369 | - __( 'TO', 'event_espresso' ), |
|
1369 | + __('TO', 'event_espresso'), |
|
1370 | 1370 | |
1371 | 1371 | // Reference: packages/ui-components/src/ColorPicker/ColorPicker.tsx:60 |
1372 | - __( 'Custom color', 'event_espresso' ), |
|
1372 | + __('Custom color', 'event_espresso'), |
|
1373 | 1373 | |
1374 | 1374 | // Reference: packages/ui-components/src/ColorPicker/Swatch.tsx:23 |
1375 | 1375 | /* translators: color name */ |
1376 | - __( 'Color: %s', 'event_espresso' ), |
|
1376 | + __('Color: %s', 'event_espresso'), |
|
1377 | 1377 | |
1378 | 1378 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:13 |
1379 | - __( 'Cyan bluish gray', 'event_espresso' ), |
|
1379 | + __('Cyan bluish gray', 'event_espresso'), |
|
1380 | 1380 | |
1381 | 1381 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:17 |
1382 | - __( 'White', 'event_espresso' ), |
|
1382 | + __('White', 'event_espresso'), |
|
1383 | 1383 | |
1384 | 1384 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:21 |
1385 | - __( 'Pale pink', 'event_espresso' ), |
|
1385 | + __('Pale pink', 'event_espresso'), |
|
1386 | 1386 | |
1387 | 1387 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:25 |
1388 | - __( 'Vivid red', 'event_espresso' ), |
|
1388 | + __('Vivid red', 'event_espresso'), |
|
1389 | 1389 | |
1390 | 1390 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:29 |
1391 | - __( 'Luminous vivid orange', 'event_espresso' ), |
|
1391 | + __('Luminous vivid orange', 'event_espresso'), |
|
1392 | 1392 | |
1393 | 1393 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:33 |
1394 | - __( 'Luminous vivid amber', 'event_espresso' ), |
|
1394 | + __('Luminous vivid amber', 'event_espresso'), |
|
1395 | 1395 | |
1396 | 1396 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:37 |
1397 | - __( 'Light green cyan', 'event_espresso' ), |
|
1397 | + __('Light green cyan', 'event_espresso'), |
|
1398 | 1398 | |
1399 | 1399 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:41 |
1400 | - __( 'Vivid green cyan', 'event_espresso' ), |
|
1400 | + __('Vivid green cyan', 'event_espresso'), |
|
1401 | 1401 | |
1402 | 1402 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:45 |
1403 | - __( 'Pale cyan blue', 'event_espresso' ), |
|
1403 | + __('Pale cyan blue', 'event_espresso'), |
|
1404 | 1404 | |
1405 | 1405 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:49 |
1406 | - __( 'Vivid cyan blue', 'event_espresso' ), |
|
1406 | + __('Vivid cyan blue', 'event_espresso'), |
|
1407 | 1407 | |
1408 | 1408 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:53 |
1409 | - __( 'Vivid purple', 'event_espresso' ), |
|
1409 | + __('Vivid purple', 'event_espresso'), |
|
1410 | 1410 | |
1411 | 1411 | // Reference: packages/ui-components/src/ColorPicker/constants.ts:9 |
1412 | - __( 'Black', 'event_espresso' ), |
|
1412 | + __('Black', 'event_espresso'), |
|
1413 | 1413 | |
1414 | 1414 | // Reference: packages/ui-components/src/Confirm/ConfirmClose.tsx:7 |
1415 | 1415 | // Reference: packages/ui-components/src/Modal/ModalWithAlert.tsx:22 |
1416 | - __( 'Are you sure you want to close this?', 'event_espresso' ), |
|
1416 | + __('Are you sure you want to close this?', 'event_espresso'), |
|
1417 | 1417 | |
1418 | 1418 | // Reference: packages/ui-components/src/Confirm/ConfirmDelete.tsx:7 |
1419 | - __( 'Are you sure you want to delete this?', 'event_espresso' ), |
|
1419 | + __('Are you sure you want to delete this?', 'event_espresso'), |
|
1420 | 1420 | |
1421 | 1421 | // Reference: packages/ui-components/src/Confirm/useConfirmWithButton.tsx:10 |
1422 | - __( 'Please confirm this action.', 'event_espresso' ), |
|
1422 | + __('Please confirm this action.', 'event_espresso'), |
|
1423 | 1423 | |
1424 | 1424 | // Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:32 |
1425 | - __( 'No', 'event_espresso' ), |
|
1425 | + __('No', 'event_espresso'), |
|
1426 | 1426 | |
1427 | 1427 | // Reference: packages/ui-components/src/Confirm/useConfirmationDialog.tsx:33 |
1428 | - __( 'Yes', 'event_espresso' ), |
|
1428 | + __('Yes', 'event_espresso'), |
|
1429 | 1429 | |
1430 | 1430 | // Reference: packages/ui-components/src/CurrencyDisplay/CurrencyDisplay.tsx:34 |
1431 | - __( 'free', 'event_espresso' ), |
|
1431 | + __('free', 'event_espresso'), |
|
1432 | 1432 | |
1433 | 1433 | // Reference: packages/ui-components/src/DateTimeRangePicker/DateTimeRangePicker.tsx:77 |
1434 | 1434 | // Reference: packages/ui-components/src/Popover/PopoverForm/PopoverForm.tsx:43 |
1435 | - __( 'save', 'event_espresso' ), |
|
1435 | + __('save', 'event_espresso'), |
|
1436 | 1436 | |
1437 | 1437 | // Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36 |
1438 | - __( 'Hide Debug Info', 'event_espresso' ), |
|
1438 | + __('Hide Debug Info', 'event_espresso'), |
|
1439 | 1439 | |
1440 | 1440 | // Reference: packages/ui-components/src/DebugInfo/DebugInfo.tsx:36 |
1441 | - __( 'Show Debug Info', 'event_espresso' ), |
|
1441 | + __('Show Debug Info', 'event_espresso'), |
|
1442 | 1442 | |
1443 | 1443 | // Reference: packages/ui-components/src/EditDateRangeButton/EditDateRangeButton.tsx:44 |
1444 | - __( 'Edit Start and End Dates and Times', 'event_espresso' ), |
|
1444 | + __('Edit Start and End Dates and Times', 'event_espresso'), |
|
1445 | 1445 | |
1446 | 1446 | // Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Copy.tsx:8 |
1447 | - __( 'copy', 'event_espresso' ), |
|
1447 | + __('copy', 'event_espresso'), |
|
1448 | 1448 | |
1449 | 1449 | // Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Edit.tsx:8 |
1450 | - __( 'edit', 'event_espresso' ), |
|
1450 | + __('edit', 'event_espresso'), |
|
1451 | 1451 | |
1452 | 1452 | // Reference: packages/ui-components/src/EntityActionsMenu/entityMenuItems/Trash.tsx:8 |
1453 | - __( 'trash', 'event_espresso' ), |
|
1453 | + __('trash', 'event_espresso'), |
|
1454 | 1454 | |
1455 | 1455 | // Reference: packages/ui-components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:37 |
1456 | - __( 'view approved registrations for this date.', 'event_espresso' ), |
|
1456 | + __('view approved registrations for this date.', 'event_espresso'), |
|
1457 | 1457 | |
1458 | 1458 | // Reference: packages/ui-components/src/EntityDetailsPanel/EntityDetailsPanelSold.tsx:38 |
1459 | - __( 'view approved registrations for this ticket.', 'event_espresso' ), |
|
1459 | + __('view approved registrations for this ticket.', 'event_espresso'), |
|
1460 | 1460 | |
1461 | 1461 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/CardViewFilterButton.tsx:21 |
1462 | - __( 'card view', 'event_espresso' ), |
|
1462 | + __('card view', 'event_espresso'), |
|
1463 | 1463 | |
1464 | 1464 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/TableViewFilterButton.tsx:20 |
1465 | - __( 'table view', 'event_espresso' ), |
|
1465 | + __('table view', 'event_espresso'), |
|
1466 | 1466 | |
1467 | 1467 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8 |
1468 | - __( 'hide bulk actions', 'event_espresso' ), |
|
1468 | + __('hide bulk actions', 'event_espresso'), |
|
1469 | 1469 | |
1470 | 1470 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleBulkActionsButton.tsx:8 |
1471 | - __( 'show bulk actions', 'event_espresso' ), |
|
1471 | + __('show bulk actions', 'event_espresso'), |
|
1472 | 1472 | |
1473 | 1473 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9 |
1474 | - __( 'hide filters', 'event_espresso' ), |
|
1474 | + __('hide filters', 'event_espresso'), |
|
1475 | 1475 | |
1476 | 1476 | // Reference: packages/ui-components/src/EntityList/filterBar/buttons/ToggleFiltersButton.tsx:9 |
1477 | - __( 'show filters', 'event_espresso' ), |
|
1477 | + __('show filters', 'event_espresso'), |
|
1478 | 1478 | |
1479 | 1479 | // Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26 |
1480 | - __( 'hide legend', 'event_espresso' ), |
|
1480 | + __('hide legend', 'event_espresso'), |
|
1481 | 1481 | |
1482 | 1482 | // Reference: packages/ui-components/src/Legend/ToggleLegendButton.tsx:26 |
1483 | - __( 'show legend', 'event_espresso' ), |
|
1483 | + __('show legend', 'event_espresso'), |
|
1484 | 1484 | |
1485 | 1485 | // Reference: packages/ui-components/src/LoadingNotice/LoadingNotice.tsx:11 |
1486 | - __( 'loading…', 'event_espresso' ), |
|
1486 | + __('loading…', 'event_espresso'), |
|
1487 | 1487 | |
1488 | 1488 | // Reference: packages/ui-components/src/Modal/Modal.tsx:58 |
1489 | - __( 'close modal', 'event_espresso' ), |
|
1489 | + __('close modal', 'event_espresso'), |
|
1490 | 1490 | |
1491 | 1491 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:10 |
1492 | - __( 'jump to previous', 'event_espresso' ), |
|
1492 | + __('jump to previous', 'event_espresso'), |
|
1493 | 1493 | |
1494 | 1494 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:11 |
1495 | - __( 'jump to next', 'event_espresso' ), |
|
1495 | + __('jump to next', 'event_espresso'), |
|
1496 | 1496 | |
1497 | 1497 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:12 |
1498 | - __( 'page', 'event_espresso' ), |
|
1498 | + __('page', 'event_espresso'), |
|
1499 | 1499 | |
1500 | 1500 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:8 |
1501 | - __( 'previous', 'event_espresso' ), |
|
1501 | + __('previous', 'event_espresso'), |
|
1502 | 1502 | |
1503 | 1503 | // Reference: packages/ui-components/src/Pagination/ItemRender.tsx:9 |
1504 | - __( 'next', 'event_espresso' ), |
|
1504 | + __('next', 'event_espresso'), |
|
1505 | 1505 | |
1506 | 1506 | // Reference: packages/ui-components/src/Pagination/PerPage.tsx:37 |
1507 | - __( 'items per page', 'event_espresso' ), |
|
1507 | + __('items per page', 'event_espresso'), |
|
1508 | 1508 | |
1509 | 1509 | // Reference: packages/ui-components/src/Pagination/constants.ts:10 |
1510 | 1510 | /* translators: %s is per page value */ |
1511 | - __( '%s / page', 'event_espresso' ), |
|
1511 | + __('%s / page', 'event_espresso'), |
|
1512 | 1512 | |
1513 | 1513 | // Reference: packages/ui-components/src/Pagination/constants.ts:13 |
1514 | - __( 'Next Page', 'event_espresso' ), |
|
1514 | + __('Next Page', 'event_espresso'), |
|
1515 | 1515 | |
1516 | 1516 | // Reference: packages/ui-components/src/Pagination/constants.ts:14 |
1517 | - __( 'Previous Page', 'event_espresso' ), |
|
1517 | + __('Previous Page', 'event_espresso'), |
|
1518 | 1518 | |
1519 | 1519 | // Reference: packages/ui-components/src/PercentSign/index.tsx:10 |
1520 | - __( '%', 'event_espresso' ), |
|
1520 | + __('%', 'event_espresso'), |
|
1521 | 1521 | |
1522 | 1522 | // Reference: packages/ui-components/src/Stepper/buttons/Next.tsx:8 |
1523 | - __( 'Next', 'event_espresso' ), |
|
1523 | + __('Next', 'event_espresso'), |
|
1524 | 1524 | |
1525 | 1525 | // Reference: packages/ui-components/src/Stepper/buttons/Previous.tsx:8 |
1526 | - __( 'Previous', 'event_espresso' ), |
|
1526 | + __('Previous', 'event_espresso'), |
|
1527 | 1527 | |
1528 | 1528 | // Reference: packages/ui-components/src/Steps/Steps.tsx:31 |
1529 | - __( 'Steps', 'event_espresso' ), |
|
1529 | + __('Steps', 'event_espresso'), |
|
1530 | 1530 | |
1531 | 1531 | // Reference: packages/ui-components/src/TabbableText/index.tsx:19 |
1532 | - __( 'Click to edit…', 'event_espresso' ), |
|
1532 | + __('Click to edit…', 'event_espresso'), |
|
1533 | 1533 | |
1534 | 1534 | // Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:14 |
1535 | - __( 'The Website\'s Time Zone', 'event_espresso' ), |
|
1535 | + __('The Website\'s Time Zone', 'event_espresso'), |
|
1536 | 1536 | |
1537 | 1537 | // Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:19 |
1538 | - __( 'UTC (Greenwich Mean Time)', 'event_espresso' ), |
|
1538 | + __('UTC (Greenwich Mean Time)', 'event_espresso'), |
|
1539 | 1539 | |
1540 | 1540 | // Reference: packages/ui-components/src/TimezoneTimeInfo/Content.tsx:9 |
1541 | - __( 'Your Local Time Zone', 'event_espresso' ), |
|
1541 | + __('Your Local Time Zone', 'event_espresso'), |
|
1542 | 1542 | |
1543 | 1543 | // Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:20 |
1544 | - __( 'This Date Converted To:', 'event_espresso' ), |
|
1544 | + __('This Date Converted To:', 'event_espresso'), |
|
1545 | 1545 | |
1546 | 1546 | // Reference: packages/ui-components/src/TimezoneTimeInfo/TimezoneTimeInfo.tsx:21 |
1547 | - __( 'click for timezone information', 'event_espresso' ), |
|
1547 | + __('click for timezone information', 'event_espresso'), |
|
1548 | 1548 | |
1549 | 1549 | // Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:51 |
1550 | - __( 'select all', 'event_espresso' ), |
|
1550 | + __('select all', 'event_espresso'), |
|
1551 | 1551 | |
1552 | 1552 | // Reference: packages/ui-components/src/bulkEdit/BulkActions.tsx:54 |
1553 | - __( 'apply', 'event_espresso' ) |
|
1553 | + __('apply', 'event_espresso') |
|
1554 | 1554 | ); |
1555 | 1555 | /* THIS IS THE END OF THE GENERATED FILE */ |