Support » Plugin: Social Share Buttons - Modern Social Media Share Icons & Floating Share Buttons » PHP is throwing “undefined variable” notice

  • Hi,
    when in debug mode set to “true” php is showing notices for undefined variable $social_buttons on your plugin code.
    Here is the full notice message:

    
    Notice: Undefined variable: social_buttons in /PATH_TO_MY_WEBSITE/wp-content/plugins/social-share-buttons-popup/public/social-share-buttons.php on line 40
    
    Notice: Undefined variable: social_buttons in /PATH_TO_MY_WEBSITE/wp-content/plugins/social-share-buttons-popup/public/social-share-buttons.php on line 105
    
    Notice: Undefined variable: social_buttons in /PATH_TO_MY_WEBSITE/wp-content/plugins/social-share-buttons-popup/public/social-share-buttons.php on line 169
    
    Notice: Undefined variable: social_buttons in /PATH_TO_MY_WEBSITE/wp-content/plugins/social-share-buttons-popup/public/social-share-buttons.php on line 232
    

    One solution is to declare $social_buttons as global inside of your function bodies.

  • The topic ‘PHP is throwing “undefined variable” notice’ is closed to new replies.