Title: Debug: PHP Notice Undefined variable
Last modified: August 21, 2016

---

# Debug: PHP Notice Undefined variable

 *  Resolved [RiccardoP](https://wordpress.org/support/users/riccardop/)
 * (@riccardop)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/debug-php-notice-undefined-variable/)
 * I have this PHP Notice when active wp_debug.
 *     ```
       Notice: Undefined variable: onclick_attr in wp-content/plugins/posts-by-tag/posts-by-tag.php on line 942
   
       Notice: Use of undefined constant disable_cache - assumed 'disable_cache' in wp-content/plugins/posts-by-tag/posts-by-tag.php on line 473
       ```
   
 * I’m not a programmer but i’ve solved the first error with this:
 *     ```
       if ( $onclick != '' ) {
        $onclick_attr = ' onclick = "' . $onclick . '" ';
        }
       ```
   
 * on line 911 and second error with a $ before disable_cache on line 474:
 *     ```
       if (!$disable_cache) { // store in cache
       ```
   
 * I hope you can fix it on next release!
 * [http://wordpress.org/extend/plugins/posts-by-tag/](http://wordpress.org/extend/plugins/posts-by-tag/)

Viewing 3 replies - 1 through 3 (of 3 total)

 *  Plugin Author [Sudar Muthu](https://wordpress.org/support/users/sudar/)
 * (@sudar)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/debug-php-notice-undefined-variable/#post-3836929)
 * Thanks for letting me know about this. I will release a minor release with a 
   fix for this.
 *  Thread Starter [RiccardoP](https://wordpress.org/support/users/riccardop/)
 * (@riccardop)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/debug-php-notice-undefined-variable/#post-3836930)
 * Ok, thank you.
 *  Plugin Author [Sudar Muthu](https://wordpress.org/support/users/sudar/)
 * (@sudar)
 * [12 years, 11 months ago](https://wordpress.org/support/topic/debug-php-notice-undefined-variable/#post-3836948)
 * I just released v3.0.1 of the Plugin with the fix.

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Debug: PHP Notice Undefined variable’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/posts-by-tag.svg)
 * [Posts By Tag](https://wordpress.org/plugins/posts-by-tag/)
 * [Support Threads](https://wordpress.org/support/plugin/posts-by-tag/)
 * [Active Topics](https://wordpress.org/support/plugin/posts-by-tag/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/posts-by-tag/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/posts-by-tag/reviews/)

## Tags

 * [PHP Notice](https://wordpress.org/support/topic-tag/php-notice/)
 * [undefined variable](https://wordpress.org/support/topic-tag/undefined-variable/)

 * 3 replies
 * 2 participants
 * Last reply from: [Sudar Muthu](https://wordpress.org/support/users/sudar/)
 * Last activity: [12 years, 11 months ago](https://wordpress.org/support/topic/debug-php-notice-undefined-variable/#post-3836948)
 * Status: resolved