Title: Undefined property: stdClass::$id
Last modified: December 14, 2017

---

# Undefined property: stdClass::$id

 *  Resolved [max](https://wordpress.org/support/users/maximledoux/)
 * (@maximledoux)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/undefined-property-stdclassid-2/)
 * `PHP Notice: Undefined property: stdClass::$id in /wp-content/plugins/user-switching/
   user-switching.php on line 620`
 * I think:
    `$user = get_userdata( $bp->displayed_user->id );`
 * should be:
    `$user = get_userdata( bp_displayed_user_id() );`
 * I’ve made this change on my end and the notice goes away and functionality remains.
   Of course, it won’t survive the next plugin update unless plugin author makes
   change…

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

 *  Plugin Author [John Blackbourn](https://wordpress.org/support/users/johnbillion/)
 * (@johnbillion)
 * WordPress Core Developer
 * [8 years, 6 months ago](https://wordpress.org/support/topic/undefined-property-stdclassid-2/#post-9780761)
 * Thanks for the report. Are you using the latest version of User Switching? (1.3.0).
   This bug has already been fixed in that version.
 *  Thread Starter [max](https://wordpress.org/support/users/maximledoux/)
 * (@maximledoux)
 * [8 years, 6 months ago](https://wordpress.org/support/topic/undefined-property-stdclassid-2/#post-9781018)
 * Well, now I feel like a dummy. I was on 1.2! Thanks!

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

The topic ‘Undefined property: stdClass::$id’ is closed to new replies.

 * ![](https://ps.w.org/user-switching/assets/icon.svg?rev=3193956)
 * [User Switching](https://wordpress.org/plugins/user-switching/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/user-switching/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/user-switching/)
 * [Active Topics](https://wordpress.org/support/plugin/user-switching/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/user-switching/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/user-switching/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [max](https://wordpress.org/support/users/maximledoux/)
 * Last activity: [8 years, 6 months ago](https://wordpress.org/support/topic/undefined-property-stdclassid-2/#post-9781018)
 * Status: resolved