You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Detecting the need of queuing scripts and styles is not possible since this requires access to the final post output which is not available before the scripts and styles got queued already.
However before queuing scripts and styles the raw post content could be checked if there is a Wordpress gallery shortcode or a Gutenberg gallery block used. This could be used to offer an option like "enable only if post or page contains a Wordpress or Gutenberg gallery".
The text was updated successfully, but these errors were encountered:
arnowelzel
changed the title
Add option to queue script/styles only of needed
Add option to enable only of needed
Mar 5, 2021
Also see https://wordpress.org/support/topic/include-lightbox-js-only-when-gallery-is-used-on-that-page
Detecting the need of queuing scripts and styles is not possible since this requires access to the final post output which is not available before the scripts and styles got queued already.
However before queuing scripts and styles the raw post content could be checked if there is a Wordpress gallery shortcode or a Gutenberg gallery block used. This could be used to offer an option like "enable only if post or page contains a Wordpress or Gutenberg gallery".
The text was updated successfully, but these errors were encountered: