Make WordPress Core


Ignore:
Timestamp:
03/28/2014 02:58:53 AM (13 years ago)
Author:
nacin
Message:

Shortlinks: Use the home URL for a page on front.

This will result in 'Get Shortlink' hiding by default, as it will match the permalink (also the home URL).

fixes #26871.

File:
1 edited

Legend:

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

    r27754 r27802  
    27892789        if ( ! empty( $post_id ) ) {
    27902790                $post_type = get_post_type_object( $post->post_type );
    2791                 if ( $post_type->public )
    2792                         $shortlink = home_url('?p=' . $post_id);
     2791
     2792                if ( 'page' === $post->post_type && $post->ID == get_option( 'page_on_front' ) && 'page' == get_option( 'show_on_front' ) ) {
     2793                        $shortlink = home_url( '/' );
     2794                } elseif ( $post_type->public ) {
     2795                        $shortlink = home_url( '?p=' . $post_id );
     2796                }
    27932797        }
    27942798
Note: See TracChangeset for help on using the changeset viewer.