pre_attachment_url_to_postid

pre_attachment_url_to_postid

Appears in:
Hook Type: filter

See hook in core

Displaying hooks found in version: wordpress-6.7

apply_filters('pre_attachment_url_to_postid') is found 1 times:

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