Skip to content

Commit

Permalink
Merge pull request #2 from mike-sheppard/master
Browse files Browse the repository at this point in the history
fix(crumb): Fix "Only variables should be passed by reference" error
  • Loading branch information
Log1x authored Jan 26, 2021
2 parents 9546f8e + 7d28cfc commit 2c949ff
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions src/Crumb.php
Original file line number Diff line number Diff line change
Expand Up @@ -167,11 +167,10 @@ public function build()
}

if (is_singular('post')) {
$category = array_shift(
get_the_category(get_the_ID())
);
$categories = get_the_category(get_the_ID());

if (! empty($category)) {
if (! empty($categories)) {
$category = array_shift($categories);
$this->add(
$category->name,
get_category_link($category),
Expand Down

0 comments on commit 2c949ff

Please sign in to comment.