Changeset 56043 for trunk/src/wp-includes/post.php
- Timestamp:
- 06/26/2023 08:55:04 PM (18 months ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/post.php
r56030 r56043 3577 3577 } 3578 3578 3579 $previous_status = $post->post_status; 3580 3579 3581 /** 3580 3582 * Filters whether a post trashing should take place. 3581 3583 * 3582 3584 * @since 4.9.0 3583 * 3584 * @param bool|null $trash Whether to go forward with trashing. 3585 * @param WP_Post $post Post object. 3585 * @since 6.3.0 Added the `$previous_status` parameter. 3586 * 3587 * @param bool|null $trash Whether to go forward with trashing. 3588 * @param WP_Post $post Post object. 3589 * @param string $previous_status The status of the post about to be trashed. 3586 3590 */ 3587 $check = apply_filters( 'pre_trash_post', null, $post );3591 $check = apply_filters( 'pre_trash_post', null, $post, $previous_status ); 3588 3592 3589 3593 if ( null !== $check ) { … … 3595 3599 * 3596 3600 * @since 3.3.0 3597 * 3598 * @param int $post_id Post ID. 3601 * @since 6.3.0 Added the `$previous_status` parameter. 3602 * 3603 * @param int $post_id Post ID. 3604 * @param string $previous_status The status of the post about to be trashed. 3599 3605 */ 3600 do_action( 'wp_trash_post', $post_id );3601 3602 add_post_meta( $post_id, '_wp_trash_meta_status', $p ost->post_status );3606 do_action( 'wp_trash_post', $post_id, $previous_status ); 3607 3608 add_post_meta( $post_id, '_wp_trash_meta_status', $previous_status ); 3603 3609 add_post_meta( $post_id, '_wp_trash_meta_time', time() ); 3604 3610 … … 3620 3626 * 3621 3627 * @since 2.9.0 3622 * 3623 * @param int $post_id Post ID. 3628 * @since 6.3.0 Added the `$previous_status` parameter. 3629 * 3630 * @param int $post_id Post ID. 3631 * @param string $previous_status The status of the post at the point where it was trashed. 3624 3632 */ 3625 do_action( 'trashed_post', $post_id );3633 do_action( 'trashed_post', $post_id, $previous_status ); 3626 3634 3627 3635 return $post; … … 3657 3665 * 3658 3666 * @since 4.9.0 3659 * @since 5.6.0 The `$previous_status` parameter was added.3667 * @since 5.6.0 Added the `$previous_status` parameter. 3660 3668 * 3661 3669 * @param bool|null $untrash Whether to go forward with untrashing. … … 3672 3680 * 3673 3681 * @since 2.9.0 3674 * @since 5.6.0 The `$previous_status` parameter was added.3682 * @since 5.6.0 Added the `$previous_status` parameter. 3675 3683 * 3676 3684 * @param int $post_id Post ID. … … 3718 3726 * 3719 3727 * @since 2.9.0 3720 * @since 5.6.0 The `$previous_status` parameter was added.3728 * @since 5.6.0 Added the `$previous_status` parameter. 3721 3729 * 3722 3730 * @param int $post_id Post ID.
Note: See TracChangeset
for help on using the changeset viewer.