WordPress.org

Make WordPress Core

Ticket #13212: 13212.2.diff

File 13212.2.diff, 572 bytes (added by ryan, 8 years ago)
  • wp-includes/link-template.php

     
    21722172
    21732173        global $wp_query;
    21742174        $post_id = 0;
    2175         if ( 'query' == $context && is_single() )
     2175        if ( 'query' == $context && is_single() ) {
    21762176                $post_id = $wp_query->get_queried_object_id();
    2177         elseif ( 'post' == $context )
    2178                 $post_id = $id;
     2177        } elseif ( 'post' == $context ) {
     2178                $post = get_post($id);
     2179                $post_id = $post->ID;
     2180        }
    21792181
    21802182        $shortlink = '';
    21812183