url_to_postid
云策文档标注
概述
url_to_postid 是一个 WordPress 过滤器,用于从 URL 中提取 post ID。它允许开发者自定义 URL 到 post ID 的映射逻辑。
关键要点
- 过滤器名称:url_to_postid
- 参数:$url(字符串类型,表示要从中提取 post ID 的 URL)
- 用途:在 url_to_postid() 函数中被调用,用于检查和确定 URL 对应的 post ID
- 引入版本:WordPress 2.2.0
代码示例
$url = apply_filters( 'url_to_postid', $url );
原文内容
Filters the URL to derive the post ID from.
Parameters
$urlstring-
The URL to derive the post ID from.
Source
$url = apply_filters( 'url_to_postid', $url );
Changelog
| Version | Description |
|---|---|
| 2.2.0 | Introduced. |