Title: Undefined variable: site_id
Last modified: October 22, 2017

---

# Undefined variable: site_id

 *  [dspaete](https://wordpress.org/support/users/dspaete/)
 * (@dspaete)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/undefined-variable-site_id/)
 * Hi hi,
 * Undefined variable: site_id in ./wp-content/plugins/favorites/app/Listeners/FavoriteList.
   php on line 54
 * This cannot work properly as there is no $site_id defined before accessing it:
 *     ```
       	private function getList()
       	{
       		global $blog_id;
       		$site_id = ( is_multisite() && is_null($site_id) ) ? $blog_id : $site_id;
       ```
   
 * Maybe $site_id should be passed as a parameter or made global.

The topic ‘Undefined variable: site_id’ 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/)

 * 0 replies
 * 1 participant
 * Last reply from: [dspaete](https://wordpress.org/support/users/dspaete/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/undefined-variable-site_id/)
 * Status: not a support question