A long unrealized goal of mine has been to change the behavior of WordPress’ publish button when adding a new post. Today, I’ll spend a little time examining the underlying code.
I narrowed it down to two functions: wp_insert_post() and wp_publish_post(). Turns out that the correct function is wp_insert_post(). The only thing that wp_publish_post() does is to transition the status. Looks like I should be able to alter wp_insert_post() in my functions.php file and achieve my goal.