Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

What I'm trying to do is allow registered users to create a list of gift items they would like for Christmas. So I've created a custom post type called 'gift' and a custom taxonomy of 'list' but I can't figure out how to relate the 'list' to the user. I would like to allow users to create multiple lists, but I can see a problem where 2 users may create the same list name and therefore causing headaches on which list belongs to who.

Have I set this up the right way? What would you do differently?

share|improve this question

1 Answer 1

You have the user id# that uniquely identifies the user. So prepend the user id value to the list name the user chooses, to save the list value. For example, if user #1234 creates a list called xmas, then do

$args = wp_insert_term ('1234_xmas', 'list');

Next add a custom field to the user. And store 'xmas' into that field. See: http://justintadlock.com/archives/2009/09/10/adding-and-using-custom-user-profile-fields

Hope this helps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.