-
-
Notifications
You must be signed in to change notification settings - Fork 35
Closed
Labels
bugSomething isn't workingSomething isn't working
Description
I've run into parsing issues with the @image directive.
Case 1:
When using the directive as follows:
@image($image_id, 'medium', $alt)
The alt attribute is assigned the literal string "$alt" instead of the variable.
The resulting code ends up being...
<?php echo wp_get_attachment_image(
$image_id,
'medium',
false,
['alt' => '$alt']
); ?>
Case 2:
When using the directive as follows:
@image($image_id, 'medium', ['alt' => $alt, class='alignright'] )
This one results in a Fatal Error
Fatal error: Uncaught Symfony\Component\Debug\Exception\FatalThrowableError: syntax error, unexpected '','' (T_CONSTANT_ENCAPSED_STRING), expecting ']'
The resulting code is...
<?php echo wp_get_attachment_image(
$image_id,
'medium',
false,
['alt' => $alt','class' => 'alignright']
); ?>
Metadata
Metadata
Assignees
Labels
bugSomething isn't workingSomething isn't working