Skip to content

Commit

Permalink
fix: leave early if no trails are found
Browse files Browse the repository at this point in the history
  • Loading branch information
mahdiyazdani committed Aug 22, 2024
1 parent 70e4650 commit 29155dd
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions seo-ready.php
Original file line number Diff line number Diff line change
Expand Up @@ -744,6 +744,11 @@ function seo_ready_generate_breadcrumbs_trails( $post_id = null, $attributes = a

$trails = $breadcrumbs->generate();

// Leave early if no trails are found.
if ( empty( $trails ) || count( $trails ) < 2 ) {
return array();
}

seo_ready_generate_breadcrumb_list_item( $trails );

return $trails;
Expand Down

0 comments on commit 29155dd

Please sign in to comment.