From 9ce2b7c4e3f8838446468dc82ef2e37143abde0c Mon Sep 17 00:00:00 2001 From: Mateus Machado Luna Date: Fri, 7 Feb 2020 15:06:05 -0300 Subject: [PATCH] Final adjustments to Third Party Metadata as well! --- .../class-tainacan-rest-metadata-types-controller.php | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/classes/api/endpoints/class-tainacan-rest-metadata-types-controller.php b/src/classes/api/endpoints/class-tainacan-rest-metadata-types-controller.php index 0dbe688ae..9bf842730 100644 --- a/src/classes/api/endpoints/class-tainacan-rest-metadata-types-controller.php +++ b/src/classes/api/endpoints/class-tainacan-rest-metadata-types-controller.php @@ -71,7 +71,7 @@ class REST_Metadata_Types_Controller extends REST_Controller { */ public function prepare_item_for_response( $item, $request ) { $name = "\Tainacan\Metadata_Types\\$item"; - $metadata_type = new $name(); + $metadata_type = new $item(); $metadatum_arr = $metadata_type->_toArray(); @@ -86,7 +86,7 @@ class REST_Metadata_Types_Controller extends REST_Controller { public function get_items( $request ) { $Tainacan_Metadata = \Tainacan\Repositories\Metadata::get_instance(); - $metadata_types = $Tainacan_Metadata->fetch_metadata_types('NAME'); + $metadata_types = $Tainacan_Metadata->fetch_metadata_types( ); $prepared = []; foreach ($metadata_types as $metadata_type){