How can I pass $post object to ‘save_post’ add_action?

Do:

add_action('save_post', 'my_save_function', 10, 2);

And the $post object will be passed as second argument to your function:

function my_save_function($post_ID, $post) {

Leave a Comment