I would like to have a user meta-data field that is an associative array. Specifically, I would like to store what the user voted for any posts voted for. In other words I would like to have:
for get_user_meta($id,'vote_arr',true) to provide: Array( post_id => 1, 0, -1) where 1 0 or -1 tells me if the user voted up down or neither for that specific post.
However I am having problems retrieving just the $value of the key-value pair using get_user_meta:
I have tried all kinds of combinations:
$vote=get_user_meta(get_current_user_id(),'vote_arr['.$_POST[postId].']',true);
$vote=get_user_meta(get_current_user_id(),'vote_arr['$_POST[postId]']',true);
$vote=get_user_meta(get_current_user_id(),'vote_arr[$_POST[postId]]',true);
none of them provide just the 1,0,-1 value.
Thanks in advance.
'vote_arr['.$_POST['postId'].']'
– Rob