17.11. Url zur Post-ID auflösen

Zum Schluß möchte ich noch auf eine interessante Funktion aufmerksam machen, die manch so einer sicherlich einmal brauchen wird. Die Rückwärts-Auflösung einer URL zu einer Post-ID.

<?php
function url_to_postid( $url ) {
	...
}
?>

Es gilt:

  • $url (string)
    Die URL

Zurückgegeben wird ein int-Wert der die Post-ID darstellt.

Beispiele:

You’re not allowed to see this content. Please log in first.