diff --git a/source/php/App.php b/source/php/App.php index 5cfbdf46..3a8b6cdb 100755 --- a/source/php/App.php +++ b/source/php/App.php @@ -52,6 +52,23 @@ public function __construct() add_action('widgets_init', function () { register_widget('EventManagerIntegration\Widget\DisplayEvents'); }); + + // Add view paths + add_action('template_redirect', function () { + if (get_post_type() === 'event') { + add_filter('Municipio/viewPaths', array($this, 'addViewPaths'), 2, 1); + } + }, 10); + } + + /** + * Add searchable blade template paths + * @param array $array Template paths + * @return array Modified template paths + */ + public function addViewPaths($array) + { + return array_merge( [EVENTMANAGERINTEGRATION_VIEW_PATH], $array ); } /** diff --git a/source/php/PostTypes/Events.php b/source/php/PostTypes/Events.php index ac5dd037..1c2106c0 100755 --- a/source/php/PostTypes/Events.php +++ b/source/php/PostTypes/Events.php @@ -209,7 +209,7 @@ public function singleViewData($data) ]; $data['eventLang'] = (object) array( - 'accessibilityLabels' => array_filter($accessibilityLabels, fn($key) => in_array($key, $locationInfo['accessibility']), ARRAY_FILTER_USE_KEY), + 'accessibilityLabels' => array_filter($accessibilityLabels, fn($key) => in_array($key, $locationInfo['accessibility'] ?? []), ARRAY_FILTER_USE_KEY), 'link' => __('Event link', 'event-integration'), 'ticket' => __('Ticket', 'event-integration'), 'goToEventWebsite' => __('Go to event website', 'event-integration'),