Skip to content

Commit

Permalink
fix(thumbnail): Fix @thumbnail always passing thumbnail when second…
Browse files Browse the repository at this point in the history
… argument is `false`.
  • Loading branch information
Log1x authored Feb 21, 2020
1 parent a6b05e6 commit 433f3a4
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/Directives/WordPress.php
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@

if (! empty($expression->get(1))) {
if ($expression->get(1) === 'false') {
return "<?= get_the_post_thumbnail_url({$expression->get(0)}, 'thumbnail'); ?>";
return "<?= get_the_post_thumbnail_url(get_the_ID(), {$expression->get(0)}); ?>";
}

return "<?= get_the_post_thumbnail({$expression->get(0)}, is_numeric({$expression->get(1)}) ? [{$expression->get(1)}, {$expression->get(1)}] : {$expression->get(1)}); ?>"; // phpcs:ignore
Expand Down

2 comments on commit 433f3a4

@thumbnail
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

@Log1x
Copy link
Owner Author

@Log1x Log1x commented on 433f3a4 Feb 21, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👀

Haha! I always accidentally highlight people when doing commits for Blade directives. I'm surprised it took someone this long to respond to one.

S-s-sorry. 🤣

Please sign in to comment.