Display only terms with labels

[MAILPOET-1292]
This commit is contained in:
Pavel Dohnal
2018-02-19 11:59:41 +00:00
parent 0d69b05ac0
commit 476af99130

View File

@ -34,9 +34,11 @@ class AutomatedLatestContent extends APIEndpoint {
function getTaxonomies($data = array()) {
$post_type = (isset($data['postType'])) ? $data['postType'] : 'post';
return $this->successResponse(
get_object_taxonomies($post_type, 'objects')
);
$all_taxonomies = get_object_taxonomies($post_type, 'objects');
$taxonomies_with_label = array_filter($all_taxonomies, function($taxonomy) {
return $taxonomy->label;
});
return $this->successResponse($taxonomies_with_label);
}
function getTerms($data = array()) {