WordPress.org

Forums

WP jQuery Lightbox
Small bug: PHP notice when not in loop/post (3 posts)

  1. normadize
    Member
    Posted 2 years ago #

    Hi,

    In wp-jquery-lightbox.php in function jqlb_autoexpand_rel_wlightbox(), at line 134, you are testing for $post->ID. However, if $post is not set (e.g. not in loop, or many other reasons) then this causes a PHP notice as it tries to access a non-existing object property.

    A better test is isset(), replacing:

    $id = ($post->ID) ? $post->ID : -1;

    with

    $id = isset($post->ID) ? $post->ID : -1;

    Cheers!

    http://wordpress.org/extend/plugins/wp-jquery-lightbox/

  2. ulfben
    Member
    Plugin Author

    Posted 2 years ago #

    Thanks for taking the time to report!

  3. normadize
    Member
    Posted 2 years ago #

    My pleasure. I try to behave the way I'd like the users of my software to :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • WP jQuery Lightbox
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic

Tags

No tags yet.