attachment_url_to_postid

FUNCTION wp-includes\media.php (ligne 5491) github
Tries to convert an attachment URL into a post ID.

Paramètres

Entrée :
$url
Sortie :
@param string $url The URL to resolve.
@return int The found post ID, or 0 on failure.

Utilisation

// Utilisation de la fonction attachment_url_to_postid
$result = attachment_url_to_postid($url);

if ($result) {
    // Votre logique ici
}

Actualités

Chargement des actualités...