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

git-svn-id: http://svn.automattic.com/wordpress/trunk@7320 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
westi 2008-03-15 21:27:10 +00:00
parent b871aff737
commit 91011917f7
1 changed files with 2 additions and 1 deletions

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 .='/';