Make WordPress Core

Opened 11 years ago

Closed 11 years ago

Last modified 11 years ago

#22170 closed defect (bug) (invalid)

before_delete_posts does not support custom post types

Reported by: zanematthew's profile ZaneMatthew Owned by:
Milestone: Priority: normal
Severity: normal Version: 3.4.2
Component: Posts, Post Types Keywords: reporter-feedback
Focuses: Cc:

Description

Just curious if someone can verify that the action 'before_delete_posts' does not appear to be supported by custom post types.

From what I'm seeing it doesn't support it.

http://core.trac.wordpress.org/browser/tags/3.4.2/wp-includes/post.php#L2022

Change History (3)

#1 @SergeyBiryukov
11 years ago

Can you provide some code to reproduce the issue?

#2 @nacin
11 years ago

  • Milestone Awaiting Review deleted
  • Resolution set to invalid
  • Status changed from new to closed
register_post_type( 'test' );
$id = wp_insert_post( array( 'post_type' => 'test' ) );
var_dump( $id );
var_dump( did_action( 'before_delete_post' ) ); // 0
wp_delete_post( $id );
var_dump( did_action( 'before_delete_post' ) ); // 1

#3 @johnbillion
11 years ago

In other words, the action name is before_delete_post not before_delete_posts.

Note: See TracTickets for help on using tickets.