Unqueued Scripts when using Gallery in a Widget
-
Hey!
Great plugin – I just found a unique use case where the gallery scripts don’t get loaded, which means the lightbox doesn’t pop up.
I have a Custom Post Type (‘Service Gallery’), into which I have placed a Gutenberg gallery element. That CPT is then selected via dropdown on another CPT (‘Service’) and as a consequence the Service Gallery CPT Content is loaded into a custom-created sidebar widget from within the theme I’m creating (allows me to load the gallery in a specific place in the layout).
When a gallery is loaded in like that, your plugin seems to skip the ‘Enqueue assets’ code as it doesn’t recognise that there is a gallery on the page. (has_block() etc only check the main Post content)
I certainly know this isn’t a bug so I’m not asking for it to be ‘fixed’, but it’s an interesting use case I thought you may want to know in case it’s something you want to cater for ??
Take care!
The page I need help with: [log in to see the link]
- The topic ‘Unqueued Scripts when using Gallery in a Widget’ is closed to new replies.