save_post

save_post is an action that is fired after a post or page is edited, published, or created with wp_insert_post(). It is synonymous with the wp_insert_post hook. This hook passes the ID of the post/page being edited/created and the content of the post as an object.

Context:

File: wp-includes/post.php
if ( $update)
	do_action('edit_post', $post_ID, $post);

do_action('save_post', $post_ID, $post);
do_action('wp_insert_post', $post_ID, $post);

This hook can pass multiple parameters. In order to get additional parameters (up to 2 for this hook) passed to your function, you will have to hook in like this: add_filter('save_post', 'your_function', 10, 2); where 10 is your function's priority, and 2 is the number of parameters you want your function to accept. Note that your function should only return the first parameter.

This hook is an action which means that it primarily acts as an event trigger, instead of a content filter. This is a semantic difference, but it will help you to remember what this hook does if you use it like this: add_action('save_post', 'your_function');