diff --git a/src/wp-includes/post.php b/src/wp-includes/post.php index 47c5648ca6..2f547a4cf9 100644 --- a/src/wp-includes/post.php +++ b/src/wp-includes/post.php @@ -2996,12 +2996,14 @@ function wp_delete_post( $postid = 0, $force_delete = false ) { * Fires before a post is deleted, at the start of wp_delete_post(). * * @since 3.2.0 + * @since 5.5.0 Added the `$post` parameter. * * @see wp_delete_post() * - * @param int $postid Post ID. + * @param int $postid Post ID. + * @param WP_Post $post Post object. */ - do_action( 'before_delete_post', $postid ); + do_action( 'before_delete_post', $postid, $post ); delete_post_meta( $postid, '_wp_trash_meta_status' ); delete_post_meta( $postid, '_wp_trash_meta_time' ); @@ -3048,10 +3050,12 @@ function wp_delete_post( $postid = 0, $force_delete = false ) { * Fires immediately before a post is deleted from the database. * * @since 1.2.0 + * @since 5.5.0 Added the `$post` parameter. * - * @param int $postid Post ID. + * @param int $postid Post ID. + * @param WP_Post $post Post object. */ - do_action( 'delete_post', $postid ); + do_action( 'delete_post', $postid, $post ); $result = $wpdb->delete( $wpdb->posts, array( 'ID' => $postid ) ); if ( ! $result ) { return false; @@ -3061,10 +3065,12 @@ function wp_delete_post( $postid = 0, $force_delete = false ) { * Fires immediately after a post is deleted from the database. * * @since 2.2.0 + * @since 5.5.0 Added the `$post` parameter. * - * @param int $postid Post ID. + * @param int $postid Post ID. + * @param WP_Post $post Post object. */ - do_action( 'deleted_post', $postid ); + do_action( 'deleted_post', $postid, $post ); clean_post_cache( $post ); @@ -3080,12 +3086,14 @@ function wp_delete_post( $postid = 0, $force_delete = false ) { * Fires after a post is deleted, at the conclusion of wp_delete_post(). * * @since 3.2.0 + * @since 5.5.0 Added the `$post` parameter. * * @see wp_delete_post() * - * @param int $postid Post ID. + * @param int $postid Post ID. + * @param WP_Post $post Post object. */ - do_action( 'after_delete_post', $postid ); + do_action( 'after_delete_post', $postid, $post ); return $post; }