On this page
apply_filters( 'attachment_url_to_postid', int|null $post_id, string $url )
Filters an attachment ID found by URL.
Parameters
$post_idint|null-
The post_id (if any) found by the function.
$urlstring-
The URL being looked up.
Source
File: wp-includes/media.php. View all references
return (int) apply_filters( 'attachment_url_to_postid', $post_id, $url );
Related
Used By
| Used By | Description |
|---|---|
| attachment_url_to_postid() wp-includes/media.php | Tries to convert an attachment URL into a post ID. |
Changelog
| Version | Description |
|---|---|
| 4.2.0 | Introduced. |
© 2003–2022 WordPress Foundation
Licensed under the GNU GPLv2+ License.
https://developer.wordpress.org/reference/hooks/attachment_url_to_postid