Skip to content

Commit 9520169

Browse files
committed
/issues/72 fix for gutenberg block;
1 parent 8483f80 commit 9520169

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

fancybox.php

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -373,7 +373,12 @@ function mfbfw_init() {
373373
<?php } else if( $mfbfw['galleryType'] == 'single_gutenberg_block'){
374374
?>
375375

376-
var gallery_block = jQuery('ul.wp-block-gallery');
376+
var gallery_block;
377+
if(jQuery('ul.wp-block-gallery').length){
378+
var gallery_block = jQuery('ul.wp-block-gallery');
379+
} else if(jQuery('ul.blocks-gallery-grid')) {
380+
var gallery_block = jQuery('ul.blocks-gallery-grid');
381+
}
377382
gallery_block.each(function() {
378383
jQuery(this).find(thumbnails).addClass("fancyboxforwp").attr("data-fancybox","gallery"+gallery_block.index(this)).attr("rel","fancybox"+gallery_block.index(this)).getTitle();
379384

0 commit comments

Comments
 (0)