diff --git a/includes/model/ListingTaxonomy.php b/includes/model/ListingTaxonomy.php index 5e6ba59167..b3f4d0b721 100644 --- a/includes/model/ListingTaxonomy.php +++ b/includes/model/ListingTaxonomy.php @@ -184,10 +184,12 @@ public function list_count_html( $term, $total ) { return $html; } - public function subterms_html( $term ) { + public function subterms_html( $term, $depth = null ) { - if ( $this->depth <= 0 ) { - return; + $depth = is_null( $depth ) ? $this->depth : $depth; + + if ( $depth <= 0 ) { + return ''; } $args = [ @@ -204,7 +206,7 @@ public function subterms_html( $term ) { if ( count( $terms ) > 0 ) { - --$this->depth; + --$depth; $html .= '