WordPress.org

Ready to get started?Download WordPress

Forums

Lightbox Plus Colorbox
[Plugin: Lightbox Plus] Patch: prevent colorbox error when colorbox.js not loaded (2 posts)

  1. h0tw1r3
    Member
    Posted 2 years ago #

    This patch prevents the lightbox-plus javascript from being included if the colorbox.js was or will not be included (enqueue). Happened to be as we have another plugin which removes scripts in certain situations.

    --- a/lightbox-plus/classes/actions.class.php
    +++ b/lightbox-plus/classes/actions.class.php
    @@ -65,6 +65,9 @@
     			*/
     			function lightboxPlusColorbox( ) {
     				global $g_lightbox_plus_url;
    +				if ( ! wp_script_is( 'colorbox', 'queue' ) ) {
    +					return;
    +				}
     				if ( !empty( $this->lightboxOptions ) ) {
     					$lightboxPlusOptions     = $this->getAdminOptions( $this->lightboxOptionsName );
     					$lightboxPlusJavaScript  = "";

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

  2. h0tw1r3
    Member
    Posted 2 years ago #

    Oops! wp_script_is should test 'jquery-colorbox' not 'colorbox'.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic