Display only terms with labels
[MAILPOET-1292]
This commit is contained in:
@ -34,9 +34,11 @@ class AutomatedLatestContent extends APIEndpoint {
|
|||||||
|
|
||||||
function getTaxonomies($data = array()) {
|
function getTaxonomies($data = array()) {
|
||||||
$post_type = (isset($data['postType'])) ? $data['postType'] : 'post';
|
$post_type = (isset($data['postType'])) ? $data['postType'] : 'post';
|
||||||
return $this->successResponse(
|
$all_taxonomies = get_object_taxonomies($post_type, 'objects');
|
||||||
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()) {
|
function getTerms($data = array()) {
|
||||||
|
Reference in New Issue
Block a user