From a9643d617ad44747a80a363f5e10cf8ebfca7cf9 Mon Sep 17 00:00:00 2001 From: Andrew Nacin Date: Fri, 29 Jun 2012 13:57:02 +0000 Subject: [PATCH] Take the original slug passed into wp_unique_post_slug() and pass it to the wp_unique_post_slug filter. props johnbillion. fixes #20480. git-svn-id: https://develop.svn.wordpress.org/trunk@21177 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-includes/post.php | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/wp-includes/post.php b/wp-includes/post.php index dee484e0b1..2a28f20203 100644 --- a/wp-includes/post.php +++ b/wp-includes/post.php @@ -2837,6 +2837,8 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p global $wpdb, $wp_rewrite; + $original_slug = $slug; + $feeds = $wp_rewrite->feeds; if ( ! is_array( $feeds ) ) $feeds = array(); @@ -2887,7 +2889,7 @@ function wp_unique_post_slug( $slug, $post_ID, $post_status, $post_type, $post_p } } - return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent ); + return apply_filters( 'wp_unique_post_slug', $slug, $post_ID, $post_status, $post_type, $post_parent, $original_slug ); } /**