url_to_postid
Filters the URL to derive the post ID from.
Usage
add_filter( 'url_to_postid', 'wp_kama_url_to_postid_filter' );
/**
* Function for `url_to_postid` filter-hook.
*
* @param string $url The URL to derive the post ID from.
*
* @return string
*/
function wp_kama_url_to_postid_filter( $url ){
// filter...
return $url;
}
- $url(string)
- The URL to derive the post ID from.
Changelog
| Since 2.2.0 | Introduced. |
Where the hook is called
url_to_postid
wp-includes/rewrite.php 502
$url = apply_filters( 'url_to_postid', $url );