Removes unused properties from the object

This commit is contained in:
Vlad
2017-09-04 21:07:15 -04:00
parent 657658ea2b
commit 6aa0be8d01

View File

@@ -19,8 +19,14 @@ class AutomatedLatestContent extends APIEndpoint {
}
function getPostTypes() {
$post_types = array_map(function($post_type) {
return array(
'name' => $post_type->name,
'label' => $post_type->label
);
}, get_post_types(array(), 'objects'));
return $this->successResponse(
get_post_types(array(), 'objects')
$post_types
);
}
@@ -82,4 +88,4 @@ class AutomatedLatestContent extends APIEndpoint {
return $this->successResponse($rendered_posts);
}
}
}