Skip to content

Commit 775d503

Browse files
authored
Merge pull request #407 from cloudinary/fix/pgw-archive
Fix PGW archive
2 parents 98ee601 + 54fb9f6 commit 775d503

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

php/media/class-gallery.php

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -409,6 +409,9 @@ public function prepare_block_render( $content, $block ) {
409409
return $content;
410410
}
411411

412+
// Ensure library is enqueued. Deals with archive pages that render the content.
413+
$this->enqueue_gallery_library();
414+
412415
$attributes = Utils::expand_dot_notation( $block['attrs'], '_' );
413416
$attributes = array_merge( self::$default_config, $attributes );
414417

@@ -490,6 +493,11 @@ protected function maybe_enqueue_scripts() {
490493
}
491494
}
492495

496+
// Bail enqueuing the script several times.
497+
if ( wp_script_is( self::GALLERY_LIBRARY_HANDLE ) ) {
498+
$can = false;
499+
}
500+
493501
/**
494502
* Filter the enqueue of gallery script.
495503
*

0 commit comments

Comments
 (0)