WordPress.org

Ready to get started?Download WordPress

Forums

Lightbox Plus Colorbox
Lightbox appears for galleries even if Gallery checkbox disabled (3 posts)

  1. conualfy
    Member
    Posted 8 months ago #

    Even if the checkbox "Use For WordPress Galleries:" is disabled (see here: goo.gl/Kfc4sl), I still get a Lightbox opened for gallery images. This is extremely anoying when one has JetPack Carousel activated for photo galleries, as after closing the carousel, there is a lightbox.

    See how it is disabled: http://goo.gl/Kfc4sl

    http://wordpress.org/plugins/lightbox-plus/

  2. conualfy
    Member
    Posted 8 months ago #

    Not only it opens for galleries, but it also reacts to keyboard interactions with Jetpack. Can you please fix this or assist me for a fix? Thanks a lot!

  3. conualfy
    Member
    Posted 8 months ago #

    Just in case others people need a solution, for now, I have found a functional solution by editing 2 plugin files. At least in my installation, now it does not run Lightbox Plus for Jetpack's Tiled Gallery images.

    1. In lightboxplus.php I disabled the else after line 237 as it is useless in our case

    //else {
    //remove_shortcode( 'gallery' );
    //add_shortcode( 'gallery', array( &$this, 'lightboxPlusGallery' ), 6);
    //add_filter( 'the_content', array( &$this, 'filterLightboxPlusReplace' ), 11 );
    //}

    2. In classes/actions.class.php I added a new check in the part that checks all image links; we check if the current link has a grandparent having the class tiled-gallery-item. If it has this class, it is an image of Jetpack's tiled-gallery. It is somewhere around line 150.
    After

    foreach($html->find('a[href*=jpg$] img, a[href*=gif$] img, a[href*=png$] img, a[href*=jpeg$] img, a[href*=bmp$] img') as $e) {
                                /**
                                * Generate HTML5 yes/no
                                */

    Add our condition:

    $e1 = $e->parent();
    if (strpos($e1->parent()->class, 'tiled-gallery-item') !== false) {
    									break;
    								}

Reply

You must log in to post.

About this Plugin

About this Topic