diff --git a/wp-includes/media.php b/wp-includes/media.php index 6a1bddbefc..506c86c5ee 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -3295,7 +3295,7 @@ function wp_maybe_generate_attachment_metadata( $attachment ) { * @global wpdb $wpdb WordPress database abstraction object. * * @param string $url The URL to resolve. - * @return int The found post ID. + * @return int The found post ID, or 0 on failure. */ function attachment_url_to_postid( $url ) { global $wpdb; @@ -3312,9 +3312,8 @@ function attachment_url_to_postid( $url ) { $path ); $post_id = $wpdb->get_var( $sql ); - if ( ! empty( $post_id ) ) { - return (int) $post_id; - } + + return (int) $post_id; } /** diff --git a/wp-includes/version.php b/wp-includes/version.php index bad6db3b47..150d779507 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-alpha-31238'; +$wp_version = '4.2-alpha-31239'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.