pre_attachment_url_to_postid
pre_attachment_url_to_postid
Hook Type: filter
Displaying hooks found in version: wordpress-6.7.2apply_filters('pre_attachment_url_to_postid') is found 1 times:
- /wp-includes/media.php line 547454705471547254735474547554765477547854795480
* @param int|null
$post_id
The result of the post ID lookup. Null to indicate
* no lookup has been attempted. Default null.
* @param string
$url
The URL being looked up.
*/
$post_id
= apply_filters(
'pre_attachment_url_to_postid'
, null,
$url
);
if
( null !==
$post_id
) {
return
(int)
$post_id
;
}
$dir
= wp_get_upload_dir();
$path
=
$url
;