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 need a way that lets my users register they're weight (kg) and maybe % of bodyfat and save that information on each user in the DB.

Then i need a way to output that number again on the logged in user

What would be the easiest approach to do something like this?

share|improve this question

2 Answers 2

up vote 0 down vote accepted

I feel the best way to do is add two options Body weight and Body fat(%) in the user profile, and then you can show it with the user logged from the db. I guess this would be a simpler way.

share|improve this answer

If that's only about storing the current value, then check out update_user_meta and get user meta. But if you want to keep track of older entries, then I think creating new post type (register_post_type) with author_id of the user would be the way to go (each new weight record will be the new post)

share|improve this answer
    
thanks for the great tips, but to save each number as a post is not an option in this case –  Demilio Nov 6 '13 at 8:47
    
Why? You can of course create your own table with these records (user_id, weight, bodyfat, timestamp) and write handlers to write and read these data, but wp_posts functions are very generic and handle these for you. –  sebapalus Nov 6 '13 at 8:50

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.