Title: Displaying User Fields
Last modified: February 11, 2018

---

# Displaying User Fields

 *  Resolved [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/)
 * I’m trying to use the shortcode [pdb_single] to allow a user to display their
   information.
 * If the users Record Info is id = 152 and Private_id = H7J9J
 * I can use [pdb_single record_id=152] and that will display a users information.
   But I would like this to work for all users.
 * I’ve tried [pdb_single record_id=id] and probably every combination but I cannot
   get it to display a users information.
 * I know that I can use something like [https://website.com/members/?pid=H7J9J](https://website.com/members/?pid=H7J9J)
   which works fine but is not practical.
 * What do I need to put inside my shortcode in order to get is to display a users
   information.

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

 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/#post-9962714)
 * Normally, this is done automatically by the plugin when you set up your list.
   Take a look at the “Setup Guide” in the Participants Database admin menu, it 
   explains how to set up the “Single Record Link” in the list.
 * If you want to show a link to an editable record, take a look at this article:
 * [Adding an Edit Record Link to the Frontend List](https://xnau.com/adding-an-edit-record-link-to-the-frontend-list/)
 *  Thread Starter [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/#post-9963123)
 * I have previously created a list of members with a ‘Single Record Link’ that 
   takes the user to a specific record for viewing and it works fine.
 * However what I want to do know is for the user to just view their own single 
   record. I can view the record with [pdb_single record_id=152] but I want to replace
   the record_id with a parameter so that all users can see their own individual
   records.
 * I imported all my data into Participants Database and not sure if that might 
   be causing a proble.
 * Thanks
 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/#post-9963625)
 * What you need to do is use the logged-in user’s info (such as their user ID) 
   to find their record ID in Participants Database. Once you have the their record
   ID, you can show them their record using some php:
 * <?php echo do_shortcode(‘[pdb_single record_id=’ . $pdb_record_id . ‘]’); ?>
 * Take a look at this article for more on how this can be done:
 * [Using Participants Database with WordPress Users](https://xnau.com/using-participants-database-with-wordpress-users/)
    -  This reply was modified 8 years, 3 months ago by [xnau webdesign](https://wordpress.org/support/users/xnau/).
 *  Thread Starter [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/#post-9980110)
 * I have almost solved this problem. I have copied the WP username to the PD username
   so that I have a link.
 * I can then user the WP command wp_get_current_user() which works fine and I can
   print out the current users username.
 * If I want to search and list the current users record (JIMMY) I can user the 
   filter=”username=JIMMY”.
 * That works fine however when I use the filter=”username=” . $user_name it just
   doesn’t work – it lists ALL the records. What am I doing wrong with the filter
   command.
 * [insert_php]
    $current_user = wp_get_current_user(); $user_name=$current_user-
   >user_login; echo do_shortcode(‘[pdb_list filter=”username=”.$user_name fields
   =”username,first_name,last_name”]’); [/insert_php]
 * Many Thanks for your Help…
 *  Plugin Author [xnau webdesign](https://wordpress.org/support/users/xnau/)
 * (@xnau)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/#post-9980292)
 * Check your quotes in the do_shortcode func….looks like you got a couple mixed
   up.
 *  Thread Starter [supernova42](https://wordpress.org/support/users/supernova42/)
 * (@supernova42)
 * [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/#post-9981115)
 * Right I’ve got it. The wp_get_current_user() was the function I needed and of
   course you one needs to get the inverted comma’s in the right place
 * [insert_php]
    $current_user=wp_get_current_user(); $users_name=$current_user-
   >user_login; echo do_shortcode(‘[pdb_list filter=”username=’.$users_name.'” fields
   =”title,first_name,last_name,address_1,city”]’); [/insert_php]
 * Many thanks

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

The topic ‘Displaying User Fields’ is closed to new replies.

 * ![](https://ps.w.org/participants-database/assets/icon-256x256.jpg?rev=1389807)
 * [Participants Database](https://wordpress.org/plugins/participants-database/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/participants-database/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/participants-database/)
 * [Active Topics](https://wordpress.org/support/plugin/participants-database/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/participants-database/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/participants-database/reviews/)

 * 6 replies
 * 2 participants
 * Last reply from: [supernova42](https://wordpress.org/support/users/supernova42/)
 * Last activity: [8 years, 3 months ago](https://wordpress.org/support/topic/displaying-user-fields/#post-9981115)
 * Status: resolved