day_link
云策文档标注
概述
day_link 是一个 WordPress 过滤器钩子,用于修改日期归档页面的永久链接。它允许开发者自定义链接格式,基于年、月、日参数。
关键要点
- day_link 是一个过滤器钩子,用于过滤日期归档的永久链接。
- 参数包括 $daylink(原始链接字符串)、$year、$month 和 $day,分别对应归档的年、月、日。
- 通过 apply_filters 调用,开发者可以添加自定义函数来修改链接。
- 相关函数 get_day_link() 用于获取日期归档链接,day_link 钩子可在此过程中进行过滤。
- 自 WordPress 1.5.0 版本引入。
原文内容
Filters the day archive permalink.
Parameters
$daylinkstring-
Permalink for the day archive.
$yearint-
Year for the archive.
$monthint-
Month for the archive.
$dayint-
The day for the archive.
Source
return apply_filters( 'day_link', $daylink, $year, $month, $day );
Changelog
| Version | Description |
|---|---|
| 1.5.0 | Introduced. |