url_to_postid WordPress Filter Hook

The url_to_postid hook allows you to convert a URL to a post ID. This can be useful if you need to get the ID of a post from its URL.

apply_filters( 'url_to_postid', string $url ) #

Filters the URL to derive the post ID from.


Parameters

$url

(string)The URL to derive the post ID from.


Top ↑

Source

File: wp-includes/rewrite.php

View on Trac



Top ↑

Changelog

Changelog
VersionDescription
2.2.0Introduced.

The content displayed on this page has been created in part by processing WordPress source code files which are made available under the GPLv2 (or a later version) license by theĀ Free Software Foundation. In addition to this, the content includes user-written examples and information. All material is subject to review and curation by the WPPaste.com community.