WordPress.org

Make WordPress Core

Changeset 19231


Ignore:
Timestamp:
11/09/11 19:20:33 (2 years ago)
Author:
nacin
Message:

Check post type and bail earlier in wp_get_attachment_url(). props mitchoyoshitaka, fixes #17579.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/wp-includes/post.php

    r19193 r19231  
    38913891        return false; 
    38923892 
     3893    if ( 'attachment' != $post->post_type ); 
     3894        return false; 
     3895 
    38933896    $url = ''; 
    38943897    if ( $file = get_post_meta( $post->ID, '_wp_attached_file', true) ) { //Get attached file 
     
    39083911    $url = apply_filters( 'wp_get_attachment_url', $url, $post->ID ); 
    39093912 
    3910     if ( 'attachment' != $post->post_type || empty( $url ) ) 
     3913    if ( empty( $url ) ) 
    39113914        return false; 
    39123915 
Note: See TracChangeset for help on using the changeset viewer.