Title: Error when using user=&quot;username&quot;
Last modified: August 30, 2016

---

# Error when using user="username"

 *  [codenerd](https://wordpress.org/support/users/modded/)
 * (@modded)
 * [10 years, 7 months ago](https://wordpress.org/support/topic/error-when-using-userusername/)
 * Hello,
 * Could you please assist me with this issue? When I use the following shortcode:
   [
   xprofile field=179 user=”DJohnson”]
 * I get this error:
    Catchable fatal error: Object of class WP_User could not be
   converted to string in /…/wp-content/plugins/buddypress/bp-xprofile/classes/class-
   bp-xprofile-profiledata.php on line 369
 * This is the code for that section for line 369
 *     ```
       // Assemble uncached IDs
       		$uncached_ids = array();
       		foreach ( $user_ids as $user_id ) {
       			$cache_key = "{$user_id}:{$field_id}";
       			if ( false === wp_cache_get( $cache_key, 'bp_xprofile_data' ) ) {
       				$uncached_ids[] = $user_id;
       			}
       		}
       ```
   
 * Thanks in advance!
 * [https://wordpress.org/plugins/bp-xprofile-shortcode/](https://wordpress.org/plugins/bp-xprofile-shortcode/)

The topic ‘Error when using user="username"’ is closed to new replies.

 * ![](https://ps.w.org/bp-xprofile-shortcode/assets/icon-256x256.png?rev=970162)
 * [BP XProfile Shortcode](https://wordpress.org/plugins/bp-xprofile-shortcode/)
 * [Support Threads](https://wordpress.org/support/plugin/bp-xprofile-shortcode/)
 * [Active Topics](https://wordpress.org/support/plugin/bp-xprofile-shortcode/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/bp-xprofile-shortcode/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/bp-xprofile-shortcode/reviews/)

 * 0 replies
 * 1 participant
 * Last reply from: [codenerd](https://wordpress.org/support/users/modded/)
 * Last activity: [10 years, 7 months ago](https://wordpress.org/support/topic/error-when-using-userusername/)
 * Status: not resolved