Show page hierarchy when editing page slugs. fixes #6068
git-svn-id: https://develop.svn.wordpress.org/trunk@7133 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
parent
fc8d871335
commit
387f9a1e87
@ -593,7 +593,19 @@ function get_sample_permalink($id, $name = null) {
|
||||
if (!is_null($name)) {
|
||||
$post->post_name = sanitize_title($name, $post->ID);
|
||||
}
|
||||
|
||||
$permalink = get_permalink($post, true);
|
||||
|
||||
// Handle page hierarchy
|
||||
if ( 'page' == $post->post_type ) {
|
||||
$uri = get_page_uri($post->ID);
|
||||
$uri = str_replace($post->post_name, '', $uri);
|
||||
$uri = untrailingslashit($uri);
|
||||
if ( !empty($uri) )
|
||||
$uri .='/';
|
||||
$permalink = str_replace('%pagename%', "${uri}%pagename%", $permalink);
|
||||
}
|
||||
|
||||
$permalink = array($permalink, $post->post_name);
|
||||
$post->post_status = $original_status;
|
||||
$post->post_date = $original_date;
|
||||
|
Loading…
Reference in New Issue
Block a user