parse_comment_query
云策文档标注
概述
parse_comment_query 是一个 WordPress 动作钩子,在评论查询变量解析后触发,允许开发者干预 WP_Comment_Query 实例。
关键要点
- 触发时机:在 WP_Comment_Query 解析查询变量后执行
- 参数:传递 WP_Comment_Query 实例的引用,便于修改查询行为
- 用途:常用于自定义评论查询逻辑或添加额外处理
- 相关函数:与 WP_Comment_Query::parse_query() 方法关联
- 版本:自 WordPress 4.2.0 引入
代码示例
do_action_ref_array( 'parse_comment_query', array( &$this ) );
原文内容
Fires after the comment query vars have been parsed.
Parameters
$queryWP_Comment_Query-
The WP_Comment_Query instance (passed by reference).
Source
do_action_ref_array( 'parse_comment_query', array( &$this ) );
Changelog
| Version | Description |
|---|---|
| 4.2.0 | Introduced. |