I want to delete an element (post id) from a serialized array associated with a specific meta_key. The following screenshot tells the whole story.
What you're seeing are, post ids saved in a serialized array. Upon deletion of any post the id of the post should be removed from meta_value where meta_key is "whatever". I want to wrap unset for elements (both key and value) inside a function as shown below. Sounds complex to me.
add_action('before_delete_post', 'upon_deleting_post');
function upon_deleting_post($post_id){
....
};