How to hook update_post_meta and delete_post_meta?
I’m still struggling to get my head around this whole hooking into things, so I’m really stuck on trying to do the following task:
If update_post_meta
is fired then check to see if the meta_key
is equal to something (I want to trigger some code if a particular meta_key is used). If the meta key I’m looking for then run some code that will need to know the $post->ID
of the meta key being updated.
I need to hook into the delete_post_meta
too that kind of does the reverse as above.
Can anyone provide me with some example code for hooking into update_post_meta
and delete_post_meta
?
Leave an answer