"Murphy was an optimist!"
Changing the behavior of WordPress’ Publish button June 16, 2012 11:07 amPosted by Doug McCaughan in : Programming, Software, Technology, WordPress
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.
- codex wp_insert_post_data
- wp_insert_post hook for a wordpress plugin
- wp_insert_post with POST data
- Codex wp_insert_post
- codex developer documentation
- Codex pluggable functions
- How to add days weeks months to any date