Only replace the last segment of the uri when generating the sample permalink. Fixes #6068.

git-svn-id: https://develop.svn.wordpress.org/trunk@7320 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Peter Westwood 2008-03-15 21:27:10 +00:00
parent ea02c0e417
commit a951a2019b

View File

@ -609,7 +609,8 @@ function get_sample_permalink($id, $title=null, $name = null) {
// Handle page hierarchy
if ( 'page' == $post->post_type ) {
$uri = get_page_uri($post->ID);
$uri = str_replace($post->post_name, '', $uri);
$uri = untrailingslashit($uri);
$uri = strrev( stristr( strrev( $uri ), '/' ) );
$uri = untrailingslashit($uri);
if ( !empty($uri) )
$uri .='/';