diff --git a/src/api/endpoints/class-tainacan-rest-items-controller.php b/src/api/endpoints/class-tainacan-rest-items-controller.php index c2677ae6e..5ec7d90e7 100644 --- a/src/api/endpoints/class-tainacan-rest-items-controller.php +++ b/src/api/endpoints/class-tainacan-rest-items-controller.php @@ -123,6 +123,7 @@ class REST_Items_Controller extends REST_Controller { $item_array['metadata'][ $slug ]['value'] = $item_metadata_array['value']; $item_array['metadata'][ $slug ]['value_as_html'] = $item_metadata_array['value_as_html']; $item_array['metadata'][ $slug ]['value_as_string'] = $item_metadata_array['value_as_string']; + $item_array['metadata'][ $slug ]['semantic_uri'] = $item_metadata_array['metadatum']['semantic_uri']; $item_array['metadata'][ $slug ]['multiple'] = $metadatum->get_multiple(); $item_array['metadata'][ $slug ]['mapping'] = $metadatum->get_exposer_mapping(); @@ -215,7 +216,11 @@ class REST_Items_Controller extends REST_Controller { } + // \error_log("DEBUG-1:"); + // \error_log(\json_encode($item_arr)); $item_arr = apply_filters('tainacan-api-items-prepare-for-response', $item_arr, $item, $request); + // \error_log("DEBUG-2:"); + // \error_log(\json_encode($item_arr)); return $item_arr; } diff --git a/src/mappers/class-tainacan-mappers-handler.php b/src/mappers/class-tainacan-mappers-handler.php index e354b582e..97d45e2fa 100644 --- a/src/mappers/class-tainacan-mappers-handler.php +++ b/src/mappers/class-tainacan-mappers-handler.php @@ -327,7 +327,7 @@ class Mappers_Handler { $mapped_meta[ $mapped_slug ] = $meta; - $mapped_meta[ $mapped_slug ]['semantic_url'] = $url; + $mapped_meta[ $mapped_slug ]['semantic_uri'] = $url; $mapped_meta[ $mapped_slug ]['name'] = $label; $mapped_meta[ $mapped_slug ]['slug'] = $mapped_slug; }