Title: Custom Graphic/Button Generates &#039;Undefined Variable&#039; Errors in Debug Mode
Last modified: August 19, 2016

---

# Custom Graphic/Button Generates 'Undefined Variable' Errors in Debug Mode

 *  Resolved [ThemeMee](https://wordpress.org/support/users/thememee/)
 * (@thememee)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-graphicbutton-generates-undefined-variable-errors-in-debug-mode/)
 * **Thanks for this plugin! To me, one outstanding issue…**
 * In testing locally, I always have debug on just to see if anything’s misbehaving.
   😉 When I add a custom graphic for the button and manually add the code to my
   template, I get these errors:
 *     ```
       Notice: Undefined variable: button_fname in devsite\wp-content\plugins\add-to-any\add-to-any.php on line 246
   
       Notice: Undefined variable: button_fname in devsite\wp-content\plugins\add-to-any\add-to-any.php on line 246
   
       Notice: Undefined variable: button_text in devsite\wp-content\plugins\add-to-any\add-to-any.php on line 253
       ```
   
 * Searching for a solution, I found that [this suggestion](http://wordpress.org/support/topic/plugin-add-to-any-subscribe-button-i-get-an-error?replies=2)
   fixes the problem, though it would be nice to see the plugin updated so as not
   to break the fix!
 * In add-to-any.php, these are my modified lines that eliminate the error generation:
 * 246
    `if ( (isset($button_fname)) && ($button_fname == 'favicon.png' || $button_fname
   == 'share_16_16.png' ) ) {`
 * 253
    `if( (isset($button_text)) && (!$button_fname || $button_fname == 'favicon.
   png' || $button_fname == 'share_16_16.png') ) {`
 * Thanks again for your work on this plugin.

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

 *  Plugin Author [micropat](https://wordpress.org/support/users/micropat/)
 * (@micropat)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-graphicbutton-generates-undefined-variable-errors-in-debug-mode/#post-2068339)
 * Thanks for reporting! These debug notices will be shushed in the next release.
   🙂
 *  Thread Starter [ThemeMee](https://wordpress.org/support/users/thememee/)
 * (@thememee)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-graphicbutton-generates-undefined-variable-errors-in-debug-mode/#post-2068367)
 * Perfect, thanks for your quick response. First time using the AddToAny plugin,
   but really diggin’ it so far.
 *  Thread Starter [ThemeMee](https://wordpress.org/support/users/thememee/)
 * (@thememee)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-graphicbutton-generates-undefined-variable-errors-in-debug-mode/#post-2068505)
 * And, just like that, it’s all good! [resolved] 😉
 *  Plugin Author [micropat](https://wordpress.org/support/users/micropat/)
 * (@micropat)
 * [15 years, 1 month ago](https://wordpress.org/support/topic/custom-graphicbutton-generates-undefined-variable-errors-in-debug-mode/#post-2068515)
 * Thanks, ThemeMee!

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

The topic ‘Custom Graphic/Button Generates 'Undefined Variable' Errors in Debug 
Mode’ is closed to new replies.

 * ![](https://ps.w.org/add-to-any/assets/icon.svg?rev=972738)
 * [AddToAny Share Buttons](https://wordpress.org/plugins/add-to-any/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/add-to-any/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/add-to-any/)
 * [Active Topics](https://wordpress.org/support/plugin/add-to-any/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/add-to-any/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/add-to-any/reviews/)

## Tags

 * [graphic](https://wordpress.org/support/topic-tag/graphic/)
 * [image](https://wordpress.org/support/topic-tag/image/)
 * [undefined](https://wordpress.org/support/topic-tag/undefined/)
 * [variable](https://wordpress.org/support/topic-tag/variable/)

 * 4 replies
 * 2 participants
 * Last reply from: [micropat](https://wordpress.org/support/users/micropat/)
 * Last activity: [15 years, 1 month ago](https://wordpress.org/support/topic/custom-graphicbutton-generates-undefined-variable-errors-in-debug-mode/#post-2068515)
 * Status: resolved