Make WordPress Core


Ignore:
Timestamp:
12/01/2020 08:55:03 PM (6 years 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.

This merges [45114] into the 5.6 branch

See #45114

Location:
branches/5.6
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/5.6

  • branches/5.6/src/wp-includes/class-wp-customize-manager.php

    r49193 r49732  
    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.