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
This commit is contained in:
Andrew Nacin 2012-06-29 13:57:02 +00:00
parent f4ef59ebdc
commit a9643d617a
1 changed files with 3 additions and 1 deletions

View File

@ -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 );
}
/**