pre_attachment_url_to_postid

pre_attachment_url_to_postid

Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7.2

apply_filters('pre_attachment_url_to_postid') is found 1 times:

  • /wp-includes/media.php line 5474
    5470
    5471
    5472
    5473
    5474
    5475
    5476
    5477
    5478
    5479
    5480
    * @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;