diff --git a/wp-includes/post-functions.php b/wp-includes/post-functions.php index 7c0786239a..1d6ae6fc39 100644 --- a/wp-includes/post-functions.php +++ b/wp-includes/post-functions.php @@ -2317,6 +2317,20 @@ function wp_delete_post( $postid = 0, $force_delete = false ) { if ( $post->post_type == 'attachment' ) return wp_delete_attachment( $postid, $force_delete ); + /** + * Filter whether a post deletion should take place. + * + * @since 4.4.0 + * + * @param bool $delete Whether to go forward with deletion. + * @param WP_Post $post Post object. + * @param bool $force_delete Whether to bypass the trash. + */ + $check = apply_filters( 'pre_delete_post', null, $post, $force_delete ); + if ( null !== $check ) { + return $check; + } + /** * Fires before a post is deleted, at the start of wp_delete_post(). * diff --git a/wp-includes/version.php b/wp-includes/version.php index efb5ae670b..5cf73da0f5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.4-alpha-34081'; +$wp_version = '4.4-alpha-34082'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.