Make WordPress Core


Ignore:
Timestamp:
01/18/2015 08:32:50 PM (10 years ago)
Author:
SergeyBiryukov
Message:

attachment_url_to_postid() should always return an integer.

props nathan_dawson, ashfame.
fixes #31044.

File:
1 edited

Legend:

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

    r31168 r31239  
    32963296 *
    32973297 * @param string $url The URL to resolve.
    3298  * @return int The found post ID.
     3298 * @return int The found post ID, or 0 on failure.
    32993299 */
    33003300function attachment_url_to_postid( $url ) {
     
    33133313    );
    33143314    $post_id = $wpdb->get_var( $sql );
    3315     if ( ! empty( $post_id ) ) {
    3316         return (int) $post_id;
    3317     }
     3315
     3316    return (int) $post_id;
    33183317}
    33193318
Note: See TracChangeset for help on using the changeset viewer.