WordPress.org

Make WordPress Core


Ignore:
Timestamp:
12/01/2020 08:45:43 PM (3 months ago)
Author:
johnbillion
Message:

REST API: Pass the previous state of the post as a parameter to the wp_after_insert_post hook.

This enables, for example, the previous post status to be used by this hook without the need to first capture it on an earlier hook.

This also fixes the value of the $fire_after_hooks parameter in get_default_post_to_edit() so the wp_after_insert_post action correctly fires just once on the new post screen.

Props Collizo4sky, peterwilsoncc, hellofromTonya, TimothyBlynJacobs, SergeyBiryukov

Fixes #45114

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/class-wp-customize-manager.php

    r49193 r49731  
    31063106        do_action( 'wp_insert_post', $post->ID, $post, true );
    31073107
    3108         wp_after_insert_post( $post, true );
     3108        wp_after_insert_post( get_post( $post_id ), true, $post );
    31093109
    31103110        wp_trash_post_comments( $post_id );
Note: See TracChangeset for help on using the changeset viewer.