Title: PHP Warning for get_class()
Last modified: August 21, 2016

---

# PHP Warning for get_class()

 *  Resolved [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * (@doublesharp)
 * [12 years ago](https://wordpress.org/support/topic/php-warning-for-get_class/)
 * Hi! Using the latest version of Socia Connect I am getting a PHP Warning on line
   297 of `social-connect.php` presumably when `$id_or_email` is `false` or `null`.
   I fixed it locally with the following…
 * **Original**
 *     ```
       $user_id = (!is_integer($id_or_email) && !is_string($id_or_email) && get_class($id_or_email)) ? $id_or_email->user_id : $id_or_email;
       ```
   
 * **Updated**
 *     ```
       $class = is_object( $id_or_email )? get_class( $id_or_email ) : false;
       $user_id = ( ! is_integer( $id_or_email ) && ! is_string( $id_or_email ) && $class )? $id_or_email->user_id : $id_or_email;
       ```
   
 * Thanks!
 * [https://wordpress.org/plugins/social-connect/](https://wordpress.org/plugins/social-connect/)

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

 *  Plugin Author [Rodrigo Primo](https://wordpress.org/support/users/rodrigosprimo/)
 * (@rodrigosprimo)
 * [12 years ago](https://wordpress.org/support/topic/php-warning-for-get_class/#post-4943876)
 * Thanks for your input.
 * Could you please open a pull request on GitHub?
 * [https://github.com/rodrigoprimo/social-connect/issues](https://github.com/rodrigoprimo/social-connect/issues)
 *  Thread Starter [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * (@doublesharp)
 * [12 years ago](https://wordpress.org/support/topic/php-warning-for-get_class/#post-4944020)
 * All done, pull request is here: [https://github.com/rodrigoprimo/social-connect/pull/55](https://github.com/rodrigoprimo/social-connect/pull/55)
 * Thanks!

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

The topic ‘PHP Warning for get_class()’ is closed to new replies.

 * ![](https://s.w.org/plugins/geopattern-icon/social-connect.svg)
 * [Social Connect](https://wordpress.org/plugins/social-connect/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/social-connect/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/social-connect/)
 * [Active Topics](https://wordpress.org/support/plugin/social-connect/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/social-connect/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/social-connect/reviews/)

 * 2 replies
 * 2 participants
 * Last reply from: [doublesharp](https://wordpress.org/support/users/doublesharp/)
 * Last activity: [12 years ago](https://wordpress.org/support/topic/php-warning-for-get_class/#post-4944020)
 * Status: resolved