Title: Using the FEUP_User class in PHP
Last modified: August 21, 2016

---

# Using the FEUP_User class in PHP

 *  Plugin Author [Rustaurius](https://wordpress.org/support/users/rustaurius/)
 * (@rustaurius)
 * [11 years, 10 months ago](https://wordpress.org/support/topic/using-the-feup_user-class-in-php/)
 * Hi all,
 * We’ve gotten a couple of questions about using the PHP class inside of theme 
   files. You can use the class to pull any user field. Username and User_ID are
   stored as properties, so you can get them like this:
 *     ```
       $User  = new FEUP_User;
       echo $User->Username;
       echo $User->User_ID;
       ```
   
 * To get any other field, you can use the “Get_Field_Value” method, like so:
 *     ```
       $User  = new FEUP_User;
       echo $User->Get_Field_Value("field name");
       ```
   
 * [https://wordpress.org/plugins/front-end-only-users/](https://wordpress.org/plugins/front-end-only-users/)

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

 *  [Adeel Michael](https://wordpress.org/support/users/admin_adeel/)
 * (@admin_adeel)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/using-the-feup_user-class-in-php/#post-5059923)
 * It gives error cannot access private property
 *  Plugin Author [Rustaurius](https://wordpress.org/support/users/rustaurius/)
 * (@rustaurius)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/using-the-feup_user-class-in-php/#post-5059924)
 * Sorry about that, try:
 *     ```
       $User  = new FEUP_User;
       echo $User->Get_Username;
       echo $User->Get_User_ID;
       ```
   
 * Does that work for you?
 *  [Doru Tirlea](https://wordpress.org/support/users/stkwarrior/)
 * (@stkwarrior)
 * [11 years, 4 months ago](https://wordpress.org/support/topic/using-the-feup_user-class-in-php/#post-5059926)
 * Hello guys.
 * Unfortunately this will be my last post as Rustaurius, you didn’t answered affirmative
   on my help proposal on this plugin 🙂 I hope you will manage further as you have
   still many problems on the plugin and also new features to implement as user 
   request them (I already implemented a lot of requests on my side but, it’s not
   public) :).
 * On this issue, it’s not possible to work on either of the 2 ways you proposed,
   for the simple fact that you made functions not objects, so the proper calling
   are the one bellow and it will work.
 * echo $User -> Get_Username();
    echo $User -> Get_User_ID();
 * So Adeel Michael you can try like this if is still in need for you and should
   work.
 * Rustaurius, the Get_Username won’t work anyways because it’s written wrong
 *     ```
       function Get_Username() {
           return $this->Get_Username;
       }
       ```
   
 * you need to return $this -> Username;
 * Good luck with the further fixes and features on the plugin 😉

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

The topic ‘Using the FEUP_User class in PHP’ is closed to new replies.

 * ![](https://ps.w.org/front-end-only-users/assets/icon-128x128.png?rev=1805921)
 * [Front End Users](https://wordpress.org/plugins/front-end-only-users/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/front-end-only-users/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/front-end-only-users/)
 * [Active Topics](https://wordpress.org/support/plugin/front-end-only-users/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/front-end-only-users/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/front-end-only-users/reviews/)

## Tags

 * [php](https://wordpress.org/support/topic-tag/php/)

 * 3 replies
 * 3 participants
 * Last reply from: [Doru Tirlea](https://wordpress.org/support/users/stkwarrior/)
 * Last activity: [11 years, 4 months ago](https://wordpress.org/support/topic/using-the-feup_user-class-in-php/#post-5059926)
 * Status: not a support question