diff --git a/wp-includes/link-template.php b/wp-includes/link-template.php
index 58366208b1..18cd209f28 100644
a
|
b
|
function wp_get_shortlink( $id = 0, $context = 'post', $allow_slugs = true ) { |
3908 | 3908 | if ( ! empty( $post_id ) ) { |
3909 | 3909 | $post_type = get_post_type_object( $post->post_type ); |
3910 | 3910 | |
3911 | | if ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) { |
3912 | | $shortlink = home_url( '/' ); |
3913 | | } elseif ( $post_type->public ) { |
3914 | | $shortlink = home_url( '?p=' . $post_id ); |
| 3911 | if ( ! empty( $post_type ) ) { |
| 3912 | if ( 'page' === $post->post_type && get_option( 'page_on_front' ) == $post->ID && 'page' === get_option( 'show_on_front' ) ) { |
| 3913 | $shortlink = home_url( '/' ); |
| 3914 | } elseif ( $post_type->public ) { |
| 3915 | $shortlink = home_url( '?p=' . $post_id ); |
| 3916 | } |
3915 | 3917 | } |
3916 | 3918 | } |
3917 | 3919 | |