Using PD with WP Users
-
I have added a custom field with the title of User Login, show it as hidden and added the default data as current_user->user_login. I have set the field to appear in the Sign Up form. I have set the sign up form as available only to logged in users.
I am using the XYZ Php Code snippets plug in referred to by another user above and pasted the php code as shown in the above instructions of:
[insert_php]
$current_user = wp_get_current_user();
echo do_shortcode(‘[[pdb_list filter=”user_login=’ . $current_user->user_login . ‘”]]’);
[/insert_php]
I have pasted that code without the [insert_php] opening and closing tags.
The snippet is active.I have used the signup page to create 2 new users and added differing details to each. I have checked the PD and see that each user now has their WP username inserted in their record in the User Login field.
All looks good so far.
I have created a page, that is also only accessible when a user is logged in where I would like users to view their own entry. I have pasted in the filter of [pdb_list filter=”user_login=’ . $current_user->user_login . ‘”] on that page.
When a logged in user visits that page they have a list of ALL the records presented to them and not just their own.
I have been trying to figure this out for 2 days now, and I have come to the conclusion that the records are being created correctly, but I must be using the filter incorrectly.
Any help would be much appreciated. The plug in is just great for the community event I am helping to manage, but I need entrants to be able to access their own details and print them off.
Thank you very much
The page I need help with: [log in to see the link]
- The topic ‘Using PD with WP Users’ is closed to new replies.