Do action on publish?
-
I’m editing wp-includes/post.php with a code bit that I only want done once the post is published. But because of how the wp_insert_post function works, it runs that code bit every time a draft is auto-saved as well.
I need to know how I could run code ONLY upon the post being published, like in an “if($status == “published)” statement. ($post->post_status doesn’t work as it retains draft state in the variable after being published for some reason).
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
The topic ‘Do action on publish?’ is closed to new replies.