You can simply store the meta as an array… Also to hell with add_post_meta… I never use it. update defaults to add if the meta doesn’t exist for the post.
update_post_meta($post_id, "_event_musikstil", $event_musikstil);
wordpress will store the value as a serialized array then so just retrieve it like
get_post_meta($post_id, "_event_musikstil", TRUE);
Hope this helps.
Another way, if you don’t want to store a serialized array is to use explode and implode
$metaStr = get_post_meta($post_id, 'your_key', true);
if(!empty($metaStr)){
$meta_arr = explode(',', $metaStr); // assuming you stored as , separated
}else{
$meta_arr = []; // empty array
}
foreach($newValuesToAdd as $newValueToAdd) {
$meta_arr[] = $newValueToAdd;
}
update_post_meta($post_id, 'your_key', implode(',',$meta_arr));