Adding new value to existing meta key
Use the following instead of add_post_meta: update_post_meta($post_id, ‘when’ $date); add_post_meta does just that, adds a new meta key every time, including duplicates in your case. update_post_meta also incorporates add_post_meta if a key doesn’t exist, but updates an existing key. For reference: http://codex.wordpress.org/Function_Reference/update_post_meta If you want to store rolling dates in an array, you would simply … Read more