Skip to content

Commit

Permalink
Merge pull request #13 from ItinerisLtd/check-post-type-before-use
Browse files Browse the repository at this point in the history
fix(breadcrumbs): check `get_post_type()` return value
  • Loading branch information
codepuncher authored Dec 22, 2022
2 parents 8fe5ba9 + 7978849 commit 5f27ff8
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/Types/CustomPostType.php
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,9 @@ public function breadcrumbLinks(array $links): array
}

$post_type = get_post_type();
if (false === $post_type) {
return $links;
}

$archive_page_id = $this->getPageIdByPostType($post_type);
if (0 === $archive_page_id) {
Expand Down

0 comments on commit 5f27ff8

Please sign in to comment.