sage-directives
sage-directives copied to clipboard
Fatal error: @image($id, 'size') causing syntax error from trailing parameter comma.
When I use the @image directive like such...
@image($image, $image_size)
It generates the following code...
<?php echo wp_get_attachment_image(
$image,
$image_size,
false,
); ?>
This causes a fatal error on my server due to the trailing comma:
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected ')'
Yeah, that requires PHP 7.2 if I recall. My mistake.
Care to do a PR?
I don't have much experience with creating directives, but I'll take a look.
I ended up just upping my PHP version to fix the issue.