markjaquith / feedback

Ask @markjaquith anything!
42 stars 4 forks source link

On clicking publish in a post, what does Wordpress do? #29

Closed murrayac closed 10 years ago

murrayac commented 10 years ago

So I've published thousands of posts, with images, terms, taxonomies and so on, and all this takes is creating a new post then clicking publish. I was wondering what Wordpress does behind the scenes.. is it very complex? For example- what actions, hooks and order WP writes to tables.

bueltge commented 10 years ago

I analyze this with the plugin Debug Objects, this list the hooks, there was fired. This is not an 100% secure image of process, but helpful.

murrayac commented 10 years ago

Thanks Bueltge, I'll take a look and watch the power behind the beauty.

markjaquith commented 10 years ago

Quite a lot happens! You should start with edit_post() in wp-admin/includes/post.php... and follow that through. The lowest level functions we have are wp_update_post() and wp_insert_post(), so if you're looking for how it works without the "normal publish flow" adornments, start there.