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.1

apply_filters('pre_attachment_url_to_postid') is found 1 times:

  • /wp-includes/media.php line 5474
    	 * @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;