Make WordPress Core

Changeset 14490


Ignore:
Timestamp:
05/06/2010 09:20:17 PM (15 years ago)
Author:
westi
Message:

Make wp_get_shortlink() loop friendly. Fixes #13212 props ryan.

File:
1 edited

Legend:

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

    r14429 r14490  
    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 = '';
Note: See TracChangeset for help on using the changeset viewer.