Introduce `attachment_url_to_postid` filter to let plugins manage the uploads location better.
Props mattwiebe. Fixes #31717. Built from https://develop.svn.wordpress.org/trunk@31867 git-svn-id: http://core.svn.wordpress.org/trunk@31846 1a063a9b-81f0-0310-95a4-ce76da25c4cd
This commit is contained in:
parent
d4d3892abb
commit
d94050aafa
|
@ -3409,6 +3409,16 @@ function attachment_url_to_postid( $url ) {
|
||||||
);
|
);
|
||||||
$post_id = $wpdb->get_var( $sql );
|
$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;
|
return (int) $post_id;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
*
|
*
|
||||||
* @global string $wp_version
|
* @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.
|
* Holds the WordPress DB revision, increments when changes are made to the WordPress DB schema.
|
||||||
|
|
Loading…
Reference in New Issue