I have to run a function when a post is published. The function checks a custom meta value and works accordingly. I am using couple of hooks for this purpose:
new_to_publish draft_to_publish pending_to_publish auto-draft_to_publish
auto-draft_to_publish are not working. It looks like these two hooks run much earlier than
add_post_meta hook. As a result, my function doesn't get any meta value and doesn't work. I tried:
add_action('new_to_publish', 'my_custom_function', /*high priority value here*/)
But that doesn't work. Any help is appreciated! Thanks!