On the Action Reference page, publish_post
is listed as depreciated. Likewise on the publish_post page itself. It is said to have been depreciated since Version 2.3.
However...
On the new Post Status Transitions page there are three NEW kinds of action hooks.
{$old_status}_to_{$new_status}
(using the statuses below)transition_post_status
(a generic action hook that fires on every transition)status_object
(e.g.publish_post
)
Statuses
new
publish
pending
draft
auto-draft
future
private
inherit
trash
So, according to all this publish_post
should still be a legitimate action hook!
I want to use it! In fact, I also want to use pending_post
and future_post
.
If I don’t use these, I have to use multiple action hooks to accommodate every possible $old_status
that a post may come from. publish_post
is a useful action hook that fires every time a post status is changed to publish, irrespective on whether it was previously new
, draft
, auto_draft
, pending
, or future
.
What’s the deal?