Skip to main content
improved code formatting
Source Link
s_ha_dum
  • 65.5k
  • 13
  • 84
  • 174

Do:

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

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

function my_save_function($post_ID, $post) {

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) {

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) {
Source Link
sorich87
  • 8k
  • 36
  • 28

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) {