I'm working on a plugin that will allow people to favorite authors on WP site.
When you click on Favorite this author button, it will send author ID to below function and save that value in DB.
Below is the code I save value to
$user_id = fav_authors_get_user_id(); $fav_author_id = 2; update_user_meta( $user_id, FAV_AUTHORS_META_KEY, $fav_author_id );
If I have author ID
2, it will save that on DB. However, when I send different author ID,
update_user_meta will override existing value instead of adding the new value.
How do I make it keep the existing value and add new value on the top of it?