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.
Built from https://develop.svn.wordpress.org/trunk@52067


git-svn-id: http://core.svn.wordpress.org/trunk@51659 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
hellofromTonya 2021-11-09 01:30:58 +00:00
parent 8853582220
commit 5c47273f06
2 changed files with 6 additions and 4 deletions

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 );
}
/**

View File

@ -16,7 +16,7 @@
*
* @global string $wp_version
*/
$wp_version = '5.9-alpha-52066';
$wp_version = '5.9-alpha-52067';
/**
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.