WordPress.org

Forums

Share Buttons by AddToAny
[resolved] Custom Graphic/Button Generates 'Undefined Variable' Errors in Debug Mode (5 posts)

  1. ThemeMee
    Member
    Posted 3 years ago #

    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 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.

  2. micropat
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks for reporting! These debug notices will be shushed in the next release. :)

  3. ThemeMee
    Member
    Posted 3 years ago #

    Perfect, thanks for your quick response. First time using the AddToAny plugin, but really diggin' it so far.

  4. ThemeMee
    Member
    Posted 3 years ago #

    And, just like that, it's all good! [resolved] ;-)

  5. micropat
    Member
    Plugin Author

    Posted 3 years ago #

    Thanks, ThemeMee!

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • Share Buttons by AddToAny
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic