Plugin Conflict: The Events Calendar’s widgets have their inline JSON break
-
– What’s happening –
It appears that the event countdown widget included with The Events Calendar Pro (https://theeventscalendar.com/products/wordpress-events-calendar/) breaks when a3 Lazy Load is activated on my site.I’m using the shortcode implementation of the countdown widget ([tribe_event_countdown]) within the content area of a page that’s then using the Block/Gutenberg editor with the new (v2) views/widgets included with The Events Calendar.
– What appears to be the issue –
From what I can tell, the inline JSON data that’s then used by the widget is being modified by a3 Lazy Load while it then doesn’t properly escape the quotation marks used in the code it’s inserting.Specifically, there’s a
<script data-js="tribe-events-view-data" type="application/json">
element containing JSON code that then has “post_content”:”*post content*” within it. The post content for the event being pulled happens to have images, but then it has stuff likeclass="lazy lazy-hidden"
added to that inline JSON content when it should beclass=\"lazy lazy-hidden\"
to not break the JSON.– Possible fix –
I think it would make sense that a3 Lazy Load avoids any content within an element withtype="application/json"
(since that might be loaded onto the page after a3 Lazy Load is triggered) or otherwise have it make sure the code being added has its quotation marks escaped to not break the JSON being altered (then making sure a3 Lazy Load is triggered after inline JSON content might be shown yet.)For now, I’m either going to leave a3 Lazy Load disabled until fixed or finding a way to get a3 Lazy Load to avoid those images via its settings (though this should ideally not be necessary per the two possible fixes mentioned above.)
- The topic ‘Plugin Conflict: The Events Calendar’s widgets have their inline JSON break’ is closed to new replies.