Skip to content

Commit

Permalink
Version 1.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
moldcraft committed Oct 24, 2016
1 parent 345b681 commit b4769a8
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 24 deletions.
42 changes: 19 additions & 23 deletions includes/class-breadcrumbs-builder.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
}

/**
Expand Down
2 changes: 1 addition & 1 deletion manifest.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down

0 comments on commit b4769a8

Please sign in to comment.