Closed janboddez closed 2 years ago
Like, we can't use save_post to save the checkbox value before publish_post is run, because it runs after. (save_post is run pretty much at the very end.)
We could use transition_post_status to save the checkbox value, and publish_post, which runs almost immediately after, to toot (or not). But what's the benefit, other than not attaching the second callback when we save as draft? What's the actual gain?
We currently use
transition_post_status
because it runs for every post type, then return early if the post type is not supported. Going for a more specific hook (we couldforeach()
over the supported post types array) may reduce this overhead.Will require some of the (very few) tests to be rewritten.