Posts, Post Types: Add $old_status parameter to {$new_status}_{$post->post_type} action.

Follow-up to [5797], [28106], [31461].

Props aaroncampbell, audrasjb, desrosj, johnbillion, sebastianpisula, swissspidy.
Fixes #36180.

git-svn-id: https://develop.svn.wordpress.org/trunk@52067 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Tonya Mork
2021-11-09 01:29:58 +00:00
parent 6f023bc765
commit 29615a6c70

View File

@@ -5284,11 +5284,13 @@ function wp_transition_post_status( $new_status, $old_status, $post ) {
* transitioned to a status, use the {@see 'transition_post_status'} hook instead.
*
* @since 2.3.0
* @since 5.9.0 Added `$old_status` parameter.
*
* @param int $post_id Post ID.
* @param WP_Post $post Post object.
* @param int $post_id Post ID.
* @param WP_Post $post Post object.
* @param string $old_status Old post status.
*/
do_action( "{$new_status}_{$post->post_type}", $post->ID, $post );
do_action( "{$new_status}_{$post->post_type}", $post->ID, $post, $old_status );
}
/**