jump to navigation

NOTE: The spam filter is being unusually aggressive. If you comment does not immediately appear, it has simply been placed in moderation and I will approve it as quickly as possible. Thank you for your patience.

"Murphy was an optimist!"

Changing the behavior of WordPress’ Publish button June 16, 2012 11:07 am

Posted by Doug McCaughan in : Programming, Software, Technology, WordPress
, trackback

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.

obert- and pixolin in Freenode’s #wordpress gave me good pointers to the WordPress forum and the WordPress hook directory.

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.

Got it!

Relevant references:

Comments after advertisement

Comments»

no comments yet - be the first?


trackback