WPDev.one
Core Function
View Source on Trac ↗

attachment_url_to_postid()

attachment_url_to_postid( mixed $url )

Tries to convert an attachment URL into a post ID.

Parameters 1 required

Name / Type Description
$url
string

The URL to resolve.

Required

Return Value

(int)
The found post ID, or 0 on failure.

Function Information

Since Version
4.0.0
Source File
wp-includes/media.php
Advertisement