Plugin Directory

Changeset 3478485


Ignore:
Timestamp:
03/09/2026 07:25:28 PM (3 weeks ago)
Author:
dfactory
Message:

Update to 2.7.5

Location:
responsive-lightbox/trunk
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • responsive-lightbox/trunk/includes/class-frontend.php

    r3465060 r3478485  
    7373    public function get_data( $attr ) {
    7474        return property_exists( $this, $attr ) ? $this->{$attr} : null;
     75    }
     76
     77    /**
     78     * Determine whether gallery assets should be preloaded for the current request.
     79     *
     80     * @return bool
     81     */
     82    private function should_preload_gallery_assets() {
     83        global $post;
     84
     85        if ( ! is_object( $post ) )
     86            return false;
     87
     88        if ( get_post_type( $post ) === 'rl_gallery' && is_singular( 'rl_gallery' ) )
     89            return true;
     90
     91        return has_shortcode( $post->post_content, 'gallery' ) || has_shortcode( $post->post_content, 'rl_gallery' );
    7592    }
    7693
     
    17641781     */
    17651782    public function widget_output( $content, $widget_id_base, $widget_id ) {
    1766         return wp_kses( $this->add_lightbox( $content ), $this->get_comment_lightbox_allowed_html() );
     1783        if ( ( is_admin() && ! wp_doing_ajax() ) || Responsive_Lightbox()->options['settings']['widgets'] !== true )
     1784            return $content;
     1785
     1786        // Widgets can contain valid form controls and inline scripts (e.g. core Archives dropdown handlers).
     1787        // Reuse the pre-2.7.4 behavior and only apply lightbox rewriting.
     1788        return $this->add_lightbox( $content );
    17671789    }
    17681790
     
    26382660        if ( ! empty( $this->style_data['basicmasonry'] ) )
    26392661            wp_add_inline_style( 'responsive-lightbox-basicmasonry-gallery', $this->style_data['basicmasonry'] );
     2662
     2663        if ( $this->should_preload_gallery_assets() ) {
     2664            $styles = apply_filters(
     2665                'rl_gallery_preload_styles',
     2666                [
     2667                    'responsive-lightbox-gallery',
     2668                    'responsive-lightbox-basicgrid-gallery',
     2669                    'responsive-lightbox-basicslider-gallery',
     2670                    'responsive-lightbox-basicmasonry-gallery'
     2671                ]
     2672            );
     2673
     2674            foreach ( $styles as $style ) {
     2675                if ( is_string( $style ) && $style !== '' )
     2676                    wp_enqueue_style( $style );
     2677            }
     2678
     2679            $scripts = apply_filters( 'rl_gallery_preload_scripts', [] );
     2680
     2681            foreach ( $scripts as $script ) {
     2682                if ( is_string( $script ) && $script !== '' )
     2683                    wp_enqueue_script( $script );
     2684            }
     2685        }
    26402686    }
    26412687
  • responsive-lightbox/trunk/readme.txt

    r3468845 r3478485  
    55Requires at least: 6.0
    66Tested up to: 6.9.1
    7 Stable tag: 2.7.4
     7Stable tag: 2.7.5
    88Requires PHP: 7.0
    99License: MIT License
     
    141141== Changelog ==
    142142
     143= 2.7.5 =
     144* Fix: Restore widget rendering when comments lightbox filtering runs, including Archives dropdown markup
     145* Tweak: Preload built-in gallery assets earlier for gallery pages and shortcode requests
     146
    143147= 2.7.4 =
    144148* Fix: Make gallery title sorting independent of lightbox title setting
     
    618622== Upgrade Notice ==
    619623
    620 = 2.7.4 =
    621 Important fixes for gallery title sorting and folder option handling to prevent errors
     624= 2.7.5 =
     625Improves built-in gallery asset loading reliability and restores widget rendering when comments lightbox filtering runs.
  • responsive-lightbox/trunk/responsive-lightbox.php

    r3468845 r3478485  
    33Plugin Name: Responsive Lightbox & Gallery
    44Description: Responsive Lightbox & Gallery allows users to create galleries and view larger versions of images, galleries and videos in a lightbox (overlay) effect optimized for mobile devices.
    5 Version: 2.7.4
     5Version: 2.7.5
    66Author: dFactory
    77Author URI: http://www.dfactory.co/
     
    4646 *
    4747 * @class Responsive_Lightbox
    48  * @version 2.7.4
     48 * @version 2.7.5
    4949 */
    5050class Responsive_Lightbox {
     
    285285            'origin_top'        => true
    286286        ],
    287         'version' => '2.7.4',
     287        'version' => '2.7.5',
    288288        'activation_date' => ''
    289289    ];
     
    21452145        }
    21462146
    2147         // gallery style
    2148         wp_register_style( 'responsive-lightbox-gallery', plugins_url( 'css/gallery.css', __FILE__ ), [], $this->defaults['version'] );
    21492147    }
    21502148
Note: See TracChangeset for help on using the changeset viewer.