Title: brillfx's Replies | WordPress.org

---

# brillfx

  [  ](https://wordpress.org/support/users/brillfx/)

 *   [Profile](https://wordpress.org/support/users/brillfx/)
 *   [Topics Started](https://wordpress.org/support/users/brillfx/topics/)
 *   [Replies Created](https://wordpress.org/support/users/brillfx/replies/)
 *   [Reviews Written](https://wordpress.org/support/users/brillfx/reviews/)
 *   [Topics Replied To](https://wordpress.org/support/users/brillfx/replied-to/)
 *   [Engagements](https://wordpress.org/support/users/brillfx/engagements/)
 *   [Favorites](https://wordpress.org/support/users/brillfx/favorites/)

 Search replies:

## Forum Replies Created

Viewing 1 replies (of 1 total)

 *   Forum: [Plugins](https://wordpress.org/support/forum/plugins-and-hacks/)
    In
   reply to: [json api and buddypress xprofile fields](https://wordpress.org/support/topic/json-api-and-buddypress-xprofile-fields/)
 *  Thread Starter [brillfx](https://wordpress.org/support/users/brillfx/)
 * (@brillfx)
 * [13 years ago](https://wordpress.org/support/topic/json-api-and-buddypress-xprofile-fields/#post-3685267)
 * Wow, ok i couldn’t believe it but i succeeded!!!!
 * here is what i did should anyone want to do the same:
    i duplicated the :
 *     ```
       function set_valueX($key, $wp_key = false) {
           if (!$wp_key) {
             $wp_key = $key;
           }
           $this->$key = xprofile_get_field_data($wp_key, $this->id);
         }
       ```
   
 * to
 *     ```
       function set_valueX($key, $wp_key = false) {
           if (!$wp_key) {
             $wp_key = $key;
           }
           $this->$key = xprofile_get_field_data($wp_key, $this->id);
         }
       ```
   
 * and now i can add any value i want from it :
    `$this->set_valueX('jobtitle','
   Job Title');` for instance..
 * so awesome.. for a newbie like me with no php experience what so ever.. i like
   this php/json stuff 🙂

Viewing 1 replies (of 1 total)