Transitions should be called even if the status hasn't changed
|Reported by:||nbachiyski||Owned by:|
|Component:||General||Keywords:||has-patch tested commit|
I wanted to be able to differentiate newly published posts and published posts, which are re-saved. The current transitions hooks offer either:
- publish_post hook, which is called for all saves of published posts
- oldstatus_to_publish hook, which is called only if the status has changed.
Thus, there is no way to hook to the case, in which the status hasn't changed.
The logical solution for me is to make all the hooks in wp_transition_post_status() to be called even if the status hasn't changed. It shouldn't cause any compatibility problems, so here is a patch.