diff --git a/includes/class-breadcrumbs-builder.php b/includes/class-breadcrumbs-builder.php index d6f2017..4d07d85 100644 --- a/includes/class-breadcrumbs-builder.php +++ b/includes/class-breadcrumbs-builder.php @@ -276,34 +276,30 @@ private function get_lowest_taxonomy_terms( $terms ) { return false; } - $filter = function($terms) use (&$filter) { - - $return_terms = array(); - $term_ids = array(); + return $this->filter_terms($terms); + } - foreach ($terms as $t){ - $term_ids[] = $t->term_id; - } + private function filter_terms($terms) { + $return_terms = array(); + $term_ids = array(); - foreach ( $terms as $t ) { - if( $t->parent == false || !in_array($t->parent,$term_ids) ) { - //remove this term - } - else{ - $return_terms[] = $t; - } - } + foreach ($terms as $t) { + $term_ids[] = $t->term_id; + } - if( count($return_terms) ){ - return $filter($return_terms); - } - else { - return $terms; + foreach ( $terms as $t ) { + if ( $t->parent == false || !in_array($t->parent,$term_ids) ) { + // remove this term + } else { + $return_terms[] = $t; } + } - }; - - return $filter($terms); + if ( count($return_terms) ) { + return $this->filter_terms($return_terms); + } else { + return $terms; + } } /** diff --git a/manifest.php b/manifest.php index 262b874..a79a791 100644 --- a/manifest.php +++ b/manifest.php @@ -10,7 +10,7 @@ .' This will make navigating the website much easier.', 'fw' ); -$manifest['version'] = '1.0.13'; +$manifest['version'] = '1.0.14'; $manifest['display'] = true; $manifest['standalone'] = true;