Small bug: PHP notice when not in loop/post
-
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!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
The topic ‘Small bug: PHP notice when not in loop/post’ is closed to new replies.