diff --git a/source/php/App.php b/source/php/App.php index 80fd83c..f3a0da9 100644 --- a/source/php/App.php +++ b/source/php/App.php @@ -28,8 +28,8 @@ public function postTypes($field) $postTypes = get_post_types(); $arr = []; foreach ($postTypes as $postType) { - $contentType = \Municipio\Helper\ContentType::getContentType($postType); - if (is_object($contentType) && $contentType->getKey() == 'place') { + $schemaType = get_field('schema', $postType . '_options'); + if ($schemaType === 'Place') { $postTypeObject = get_post_type_object($postType); $arr[$postTypeObject->name] = $postTypeObject->label; } diff --git a/source/php/Module/OpenStreetMap.php b/source/php/Module/OpenStreetMap.php index 06203af..5745a68 100644 --- a/source/php/Module/OpenStreetMap.php +++ b/source/php/Module/OpenStreetMap.php @@ -62,7 +62,7 @@ public function data(): array } $places = $this->getPlacePosts($termsToShow, $taxonomyToShow, $postTypeToShow); } else { - $places = $this->buildPlacePosts($secondaryQuery->posts); + $places = $secondaryQuery->posts; } $data['isFullWidth'] = $fields['mod_osm_full_width'] ?? false; $data['places'] = $places; @@ -122,7 +122,6 @@ private function getPlacePosts($termsToShow, $taxonomyToShow, $postTypeToShow) private function buildPlacePosts($posts) { foreach ($posts as &$post) { - $post = \Municipio\Helper\ContentType::complementPlacePost($post); $post = \Municipio\Helper\Post::preparePostObject($post); } diff --git a/source/php/Module/views/partials/collection.blade.php b/source/php/Module/views/partials/collection.blade.php index dede261..052d62d 100644 --- a/source/php/Module/views/partials/collection.blade.php +++ b/source/php/Module/views/partials/collection.blade.php @@ -3,7 +3,7 @@ 'containerAware' => true, 'bordered' => true, 'attributeList' => [ - 'data-js-map-location' => !empty($place->schemaData['place']['pin']) ? json_encode($place->schemaData['place']['pin']) : "", + 'data-js-map-location' => !empty($place->openStreetMapData['pin']) ? json_encode($place->openStreetMapData['pin']) : "", ] ]) @if (!empty($place->callToActionItems['floating']))