I want to use save_post on an update for an existing post and also for a new post, but I want 2 different "priority" on the save_post action.
So, I can't check if it's an update into save_post function parameter, I have to check this before save_post.
How can I do this ?
Thanks
Ps: I want something like this :
add_action('save_post', function ($post_ID, WP_Post $post) { //Do something when it's an update }, 9, 2 ); add_action('save_post', function ($post_ID, WP_Post $post) { //Do something when it's a new post }, 11, 2 );
save_posthook has a 3rd parameter, namely$update, so why not use an if-else from within a single callback to check whether it's an update or a new post? Why do you need two different priorities?