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.

Basically i have front end form which store the notes and tags of post. And every user who logged in can store there own notes and tags. But i want when he view the notes and tags he can only see here own notes and tags not all the notes and tags of every one.

For example there are 100 post there. Every user have an option to save notes and tags of each post and no one other can be able to see there notes and tags. so when user logged in he can able to view there notes and tags which he added.

share|improve this question

1 Answer 1

up vote 1 down vote accepted

There are various ways to achieve this you can either generate metakey value for update_post_meta in such a way that it will contain user id.

//Example :
global $user_ID,$post_ID;
// Store the values
update_post_meta($post_ID, 'meta_key'.$user_ID, '$meta_value');
// Get the values
$meta_values = get_post_meta($post_ID, 'meta_key'.$user_ID);

or you can save it in user meta as following

//Example :
global $user_ID,$post_ID;
// Store the values
update_user_meta( $user_ID, 'meta_key'.$post_ID, 'meta_value' );
// Get the values
$meta_values = get_usermeta( $user_ID, 'meta_key'.$post_ID );
share|improve this answer
    
Thanks bro its working great –  Adi Mar 7 '13 at 9:03
    
You can accept my answer if its working for you. –  Vinod Dalvi Mar 7 '13 at 9:15

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.