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.

I have a website about places and attractions in my country. Each place/attraction is a different custom post. On this page, i would like to add a button with the value "Check In" and if clicked by a registered user i would like to save a value in db with the: user id, post id and 1 if the button was pressed.

On the user page, i would like to show where he check in and how many times. I have allready the user page, the places pages, etc. I only need to add this feature.

It's doable? If yes, can someone help me?

LE: I don't expect that someone will just give me the code. Just point me in right direction - how to add for a custom post a custom entry in the db.

share|improve this question
    
This question is not very specific. Plus, what have you tried? You are expected to have researched the problem and made an attempt at solving it before posting a question. –  s_ha_dum Apr 18 '13 at 16:38
    
Yes, i've read all the google :P - i've searched and reseached but i can find anything concrete. The ideea it's simple - when a registered user clicks a button, i need to save his name and the custom post id in the db. But i've run into a block when i've tried to save anything in db. –  Mircea Moldovan Apr 18 '13 at 17:10

1 Answer 1

I've used this:

update_post_meta( $post->ID, 'your_meta_data'.$user_id, 'your_value' ); <= this will add for each user 1 field for that post, in db.

All Good :)

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.