Title: Undefined Variable Warnings
Last modified: August 21, 2016

---

# Undefined Variable Warnings

 *  [episiarch](https://wordpress.org/support/users/digitalgypsy/)
 * (@digitalgypsy)
 * [13 years ago](https://wordpress.org/support/topic/undefined-variable-warnings/)
 * I’m running LBP version 2.6 on WP 3.5.1 and it was spitting out some annoying
   warnings about undefined variables:
 *     ```
       Notice: Undefined variable: theOptions in /path/to/wp/wp-content/plugins/lightbox-plus/lightboxplus.php on line 260
   
       Notice: Undefined variable: theOptions in /path/to/wp/wp-content/plugins/lightbox-plus/lightboxplus.php on line 261
   
       Notice: Undefined variable: lightboxPlusOptions in /path/to/wp/wp-content/plugins/lightbox-plus/lightboxplus.php on line 203
       ```
   
 * To fix this, I added the following on line 203:
 *     ```
       $lightboxPlusOptions = ( isset( $lightboxPlusOptions ) ) ? $lightboxPlusOptions : '';
       ```
   
 * and this on line 255:
 *     ```
       $theOptions = ( isset( $theOptions ) ) ? $theOptions : '';
       ```
   
 * Basically, if the variable is set, set the value to itself, otherwise, set the
   value to null so PHP will shut up about it. I’m sure there’s a more elegant way
   to handle this, but this got the problem solved and doesn’t affect the rest of
   the code… There is a chance that if I’m feeling ambitious later, I’ll go back
   and take a look later to find a less hackish fix. 🙂
 * Thanks for all your hard work!
 * [http://wordpress.org/extend/plugins/lightbox-plus/](http://wordpress.org/extend/plugins/lightbox-plus/)

The topic ‘Undefined Variable Warnings’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/lightbox-plus_fafafa.svg)
 * [Lightbox Plus Colorbox](https://wordpress.org/plugins/lightbox-plus/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/lightbox-plus/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/lightbox-plus/)
 * [Active Topics](https://wordpress.org/support/plugin/lightbox-plus/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/lightbox-plus/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/lightbox-plus/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [episiarch](https://wordpress.org/support/users/digitalgypsy/)
 * Last activity: [13 years ago](https://wordpress.org/support/topic/undefined-variable-warnings/)
 * Status: not resolved