Make WordPress Core

Changeset 52067


Ignore:
Timestamp:
11/09/2021 01:29:58 AM (3 years ago)
Author:
hellofromTonya
Message:

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.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/post.php

    r52062 r52067  
    52855285     *
    52865286     * @since 2.3.0
    5287      *
    5288      * @param int     $post_id Post ID.
    5289      * @param WP_Post $post    Post object.
     5287     * @since 5.9.0 Added `$old_status` parameter.
     5288     *
     5289     * @param int     $post_id    Post ID.
     5290     * @param WP_Post $post       Post object.
     5291     * @param string  $old_status Old post status.
    52905292     */
    5291     do_action( "{$new_status}_{$post->post_type}", $post->ID, $post );
     5293    do_action( "{$new_status}_{$post->post_type}", $post->ID, $post, $old_status );
    52925294}
    52935295
Note: See TracChangeset for help on using the changeset viewer.