Make WordPress Core

Ticket #26871: 26871.diff

File 26871.diff, 792 bytes (added by nacin, 11 years ago)
  • src/wp-includes/link-template.php

     
    24542454        // Return p= link for all public post types.
    24552455        if ( ! empty( $post_id ) ) {
    24562456                $post_type = get_post_type_object( $post->post_type );
    2457                 if ( $post_type->public )
    2458                         $shortlink = home_url('?p=' . $post_id);
     2457
     2458                if ( 'page' === $post->post_type && $post->ID == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) ) {
     2459                        $shortlink = home_url( '/' );
     2460                } elseif ( $post_type->public ) {
     2461                        $shortlink = home_url( '?p=' . $post_id );
     2462                }
    24592463        }
    24602464
    24612465        return apply_filters('get_shortlink', $shortlink, $id, $context, $allow_slugs);