WordPress.org

Make WordPress Core

Ticket #29615: link-template.php.diff

File link-template.php.diff, 735 bytes (added by loushou, 6 years ago)

actual patch file for change

  • link-template.php

     
    257257
    258258        $post_type = get_post_type_object($post->post_type);
    259259
     260        if ( $post_type->hierarchical )
     261                $slug = get_page_uri($id);
     262
    260263        if ( !empty($post_link) && ( !$draft_or_pending || $sample ) ) {
    261                 if ( ! $leavename ) {
    262                         if ( $post_type->hierarchical )
    263                                 $slug = get_page_uri($id);
     264                if ( ! $leavename )
    264265                        $post_link = str_replace("%$post->post_type%", $slug, $post_link);
    265                 }
    266266                $post_link = home_url( user_trailingslashit($post_link) );
    267267        } else {
    268268                if ( $post_type->query_var && ( isset($post->post_status) && !$draft_or_pending ) )