diff --git a/src/api/class-tainacan-rest-controller.php b/src/api/class-tainacan-rest-controller.php index cc5222e29..9ad8fe024 100644 --- a/src/api/class-tainacan-rest-controller.php +++ b/src/api/class-tainacan-rest-controller.php @@ -165,7 +165,7 @@ class REST_Controller extends \WP_REST_Controller { $terms = get_terms([ 'taxonomy' => $tax_query['taxonomy'], 'fields' => 'ids', - 'hide_empty' => false, + 'hide_empty' => isset($args['hide_empty']) ? $args['hide_empty'] : true, 'search' => $tax_query['terms'] ]); @@ -180,7 +180,7 @@ class REST_Controller extends \WP_REST_Controller { $terms = get_terms([ 'taxonomy' => $tax_query['taxonomy'], 'fields' => 'ids', - 'hide_empty' => false, + 'hide_empty' => isset($args['hide_empty']) ? $args['hide_empty'] : true, 'search' => $tax_query['terms'] ]); if ($terms) {