url_to_postid

FUNCTION wp-includes\rewrite.php (ligne 477) github
Examines a URL and try to determine the post ID it represents. Checks are supposedly from the hosted site blog.

Paramètres

Entrée :
$url
Sortie :
@param string $url Permalink to check.
@return int Post ID, or 0 on failure.

Utilisation

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

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

Actualités

Chargement des actualités...