Title: Undefined Variables in my PHP embed code
Last modified: February 23, 2019

---

# Undefined Variables in my PHP embed code

 *  [databell96](https://wordpress.org/support/users/databell96/)
 * (@databell96)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/undefined-variables-in-my-php-embed-code/)
 * I didn’t notice this until WP DEBUG was set to true, but I noticed two undefined
   variables when I embedded my bookmark / favorite in my single template (using
   The Events Calendar, but it shouldn’t really matter). I embedded this code:
 * `<?php the_favorites_button($post_id, $site_id); ?>`
 * And got back these two errors:
 * > Notice: Undefined variable: post_id in /home/hellod8/public_html/wp-content/
   > themes/dadventure/tribe-events/single-event.php on line 39
   > Notice: Undefined variable: site_id in /home/hellod8/public_html/wp-content/
   > themes/dadventure/tribe-events/single-event.php on line 39
 * The bookmark does show up, which is great but I would like to address this because
   who really wants an error?
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Fundefined-variables-in-my-php-embed-code%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 1 replies (of 1 total)

 *  [ljburton](https://wordpress.org/support/users/ljburton/)
 * (@ljburton)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/undefined-variables-in-my-php-embed-code/#post-11708827)
 * same issue

Viewing 1 replies (of 1 total)

The topic ‘Undefined Variables in my PHP embed code’ is closed to new replies.

 * ![](https://ps.w.org/favorites/assets/icon-128x128.png?rev=1677726)
 * [Favorites](https://wordpress.org/plugins/favorites/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/favorites/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/favorites/)
 * [Active Topics](https://wordpress.org/support/plugin/favorites/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/favorites/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/favorites/reviews/)

## Tags

 * [Single template](https://wordpress.org/support/topic-tag/single-template/)

 * 1 reply
 * 2 participants
 * Last reply from: [ljburton](https://wordpress.org/support/users/ljburton/)
 * Last activity: [6 years, 10 months ago](https://wordpress.org/support/topic/undefined-variables-in-my-php-embed-code/#post-11708827)
 * Status: not resolved