Home/Hooks/attachment_url_to_postid
FILTER

attachment_url_to_postid

Filters an attachment ID found by URL.

wp-includes/media.php
Line 5564
2 Parameters
View Source

Usage

add_filter( 'attachment_url_to_postid', 'your_callback_function', 10, 2 );

Filter Callback:

function your_callback_function( $post_id, $url ) {
    // Your code here
    return $post_id;
}

Parameters

$post_id

Parameter 1

$url

Parameter 2

🔄 Filter Hook

Filter hooks allow you to modify data before it is saved to the database or displayed on the screen. Filters must return a value.