Hi,
Conditional PHP {= … } Not Evaluating in data-pswp-width/height Attributes
I’m trying to set data-pswp-width and data-pswp-height attributes dynamically on a lightbox video trigger link (an Icon element) based on a Metabox field (update_video_format which outputs shorts or regular).
I’m using this PHP expression in the attribute value: {= {mb_workupdates_update_video_format} === ‘shorts’ ? 720 : 1280}
However, this expression doesn’t evaluate on the frontend. The HTML renders the literal string {= shorts === ‘shorts’ ? 720 : 1280} instead of 720 or 1280. The Bricks editor also flashes when this attribute is present.
Using just the dynamic tag {mb_workupdates_update_video_format} in another attribute does work correctly.
Is evaluating conditional PHP like this within data-pswp-* attributes supported? Is there a different syntax required, or is this a limitation/bug?
Thanks for all the help in advance!