attachment_url_to_postid() should always return an integer.
props nathan_dawson, ashfame. fixes #31044. Built from https://develop.svn.wordpress.org/trunk@31239 git-svn-id: http://core.svn.wordpress.org/trunk@31220 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
bee439858b
commit
247cdad571
|
@ -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;
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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.
|
||||
|
|
Loading…
Reference in New Issue