sage-directives icon indicating copy to clipboard operation
sage-directives copied to clipboard

Cannot use the attr parameter with the @thumbnail directive

Open gmutschler opened this issue 3 years ago • 1 comments

Hello Brandon,

I'm trying to use the @thumbnail directive and to add a CSS class to my image using the 3rd argument from the get_the_post_thumbnail() function.

Not sure if it's intentional since you also use the last parameter to echo the image URL (as per your documentation), but it seems that you forget to send this 3rd parameter to the WP function here:

https://github.com/Log1x/sage-directives/blob/d4461df6d5d8d5741900f09ca0dcb74e364cf9f1/src/Directives/WordPress.php#L172-L178


PS.: Thanks for everything you're doing with Roots and your own sage and acf extensions.

gmutschler avatar May 07 '22 13:05 gmutschler

I also needed this.

I think you were right @gmutschler, it appears to be a mistake. The third parameter is checked for boolean and if it wasn't then it was ignored. Instead it should be passed through on line 177.

EHLOVader avatar May 11 '22 19:05 EHLOVader