use `hide_empty` from the API parameters #318
This commit is contained in:
parent
0ce1bc3e8e
commit
94529922fe
|
@ -165,7 +165,7 @@ class REST_Controller extends \WP_REST_Controller {
|
||||||
$terms = get_terms([
|
$terms = get_terms([
|
||||||
'taxonomy' => $tax_query['taxonomy'],
|
'taxonomy' => $tax_query['taxonomy'],
|
||||||
'fields' => 'ids',
|
'fields' => 'ids',
|
||||||
'hide_empty' => false,
|
'hide_empty' => isset($args['hide_empty']) ? $args['hide_empty'] : true,
|
||||||
'search' => $tax_query['terms']
|
'search' => $tax_query['terms']
|
||||||
]);
|
]);
|
||||||
|
|
||||||
|
@ -180,7 +180,7 @@ class REST_Controller extends \WP_REST_Controller {
|
||||||
$terms = get_terms([
|
$terms = get_terms([
|
||||||
'taxonomy' => $tax_query['taxonomy'],
|
'taxonomy' => $tax_query['taxonomy'],
|
||||||
'fields' => 'ids',
|
'fields' => 'ids',
|
||||||
'hide_empty' => false,
|
'hide_empty' => isset($args['hide_empty']) ? $args['hide_empty'] : true,
|
||||||
'search' => $tax_query['terms']
|
'search' => $tax_query['terms']
|
||||||
]);
|
]);
|
||||||
if ($terms) {
|
if ($terms) {
|
||||||
|
|
Loading…
Reference in New Issue