diff --git a/wp-includes/media.php b/wp-includes/media.php index 282e68a0c5..9c04e9c7ac 100644 --- a/wp-includes/media.php +++ b/wp-includes/media.php @@ -3409,6 +3409,16 @@ function attachment_url_to_postid( $url ) { ); $post_id = $wpdb->get_var( $sql ); + /** + * Filter an attachment id found by URL. + * + * @since 4.2.0 + * + * @param int|null $post_id The post_id (if any) found by the function. + * @param string $url The URL being looked up. + */ + $post_id = apply_filters( 'attachment_url_to_postid', $post_id, $url ); + return (int) $post_id; } diff --git a/wp-includes/version.php b/wp-includes/version.php index 96f0d3433d..d7d6b05ea5 100644 --- a/wp-includes/version.php +++ b/wp-includes/version.php @@ -4,7 +4,7 @@ * * @global string $wp_version */ -$wp_version = '4.2-beta2-31866'; +$wp_version = '4.2-beta2-31867'; /** * Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.