deleted_post

deleted_post

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: action
See hook in action

See hook in core

Displaying hooks found in version: wordpress-6.7.2

do_action('deleted_post') is found 2 times:

  • /wp-includes/post.php line 3812
    3808
    3809
    3810
    3811
    3812
    3813
    3814
    3815
    3816
    3817
    3818
    *
     * @param int     $post_id Post ID.
     * @param WP_Post $post    Post object.
     */
    do_action( 'deleted_post', $post_id, $post );
     
    clean_post_cache( $post );
     
    if ( is_post_type_hierarchical( $post->post_type ) && $children ) {
        foreach ( $children as $child ) {
            clean_post_cache( $child );
  • /wp-includes/post.php line 6631
    6627
    6628
    6629
    6630
    6631
    6632
    6633
    6634
    6635
    6636
    6637
    if ( ! $result ) {
        return false;
    }
    /** This action is documented in wp-includes/post.php */
    do_action( 'deleted_post', $post_id, $post );
     
    wp_delete_attachment_files( $post_id, $meta, $backup_sizes, $file );
     
    clean_post_cache( $post );
     
    return $post;

See this hook used in plugins: