Make WordPress Core


Ignore:
Timestamp:
09/24/2014 09:29:15 PM (10 years ago)
Author:
SergeyBiryukov
Message:

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

props loushou.
fixes #29615 for trunk.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/wp-includes/link-template.php

    r29375 r29765  
    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.