Display only terms with labels
[MAILPOET-1292]
This commit is contained in:
@ -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()) {
|
||||
|
Reference in New Issue
Block a user