WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is this possible? I want to use Gravity Forms or another hook to somehow write to the END of a user_meta field - not overwrite it.

For example...

Before:

$purchase_history = get_the_author_meta('purchase_history', $user->ID);
echo $purchase_history; ('Concert in the Park 01/12/2004')

After:

echo $purchase_history; ('Concert in the Park 01/12/2004', 'Pancake Breakfast 05/15/2005')

Any ideas? Thanks.

share|improve this question
up vote 2 down vote accepted

Use get_user_meta():

$original = get_user_meta( 
    $user->ID, 
    'purchase_history', 
    TRUE 
);

echo $original . ' Pancake Breakfast 05/15/2005';

To update the value use update_user_meta():

update_user_meta( 
    $user->ID,  
    'purchase_history',   
    $original . 'Pancake Breakfast 05/15/2005' 
);
share|improve this answer
    
thanks. i realized this concept after i asked, but now just need to research how to get gravity forms to let me hook into it. have any ideas on that? – GhostToast Jan 9 '13 at 22:43
2  

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.