Make WordPress Core


Ignore:
Timestamp:
11/06/2014 08:21:03 AM (9 years ago)
Author:
nacin
Message:

Create correct permalinks for child posts of hierarchical post types when default permalinks are used.

Merges [29765] to the 4.0 branch.

props loushou.
fixes #29615.

Location:
branches/4.0
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • branches/4.0

  • branches/4.0/src/wp-includes/link-template.php

    r29375 r30260  
    258258    $post_type = get_post_type_object($post->post_type);
    259259
     260    if ( $post_type->hierarchical ) {
     261        $slug = get_page_uri( $id );
     262    }
     263
    260264    if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) {
    261265        if ( ! $leavename ) {
    262             if ( $post_type->hierarchical )
    263                 $slug = get_page_uri($id);
    264266            $post_link = str_replace("%$post->post_type%", $slug, $post_link);
    265267        }
Note: See TracChangeset for help on using the changeset viewer.