From 29615a6c703c785e4bfbba043d18a3e1e61a665c Mon Sep 17 00:00:00 2001 From: Tonya Mork Date: Tue, 9 Nov 2021 01:29:58 +0000 Subject: [PATCH] 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 --- src/wp-includes/post.php | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 07ce72b42d..8716e29961 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -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 ); } /**