post_date_column_status
云策文档标注
概述
post_date_column_status 是一个 WordPress 过滤器钩子,用于修改文章列表页面中日期列的状态文本。它允许开发者自定义状态显示,基于文章对象和显示模式。
关键要点
- 过滤器钩子:post_date_column_status,用于过滤文章状态文本。
- 参数:接受 $status(状态文本)、$post(WP_Post 对象)、$column_name(列名)、$mode(显示模式,如 'excerpt' 或 'list')。
- 应用场景:主要在 WP_Posts_List_Table::column_date() 方法中调用,控制文章日期列的输出。
- 版本历史:从 WordPress 4.8.0 版本引入。
代码示例
$status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );
原文内容
Filters the status text of the post.
Parameters
$statusstring-
The status text.
$postWP_Post-
Post object.
$column_namestring-
The column name.
$modestring-
The list display mode (
'excerpt'or'list').
Source
$status = apply_filters( 'post_date_column_status', $status, $post, 'date', $mode );
Changelog
| Version | Description |
|---|---|
| 4.8.0 | Introduced. |