attachment_url_to_postid()
Tries to convert an attachment URL into a post ID.
Hooks from the function
Return
Int
. The found post ID, or 0 on failure.
Usage
attachment_url_to_postid( $url );
- $url(string) (required)
- The URL to resolve.
Notes
- Global. wpdb. $wpdb WordPress database abstraction object.
Changelog
Since 4.0.0 | Introduced. |