钩子文档

posts_groupby_request

💡 云策文档标注

概述

posts_groupby_request 是一个 WordPress 过滤器,用于修改查询中的 GROUP BY 子句,主要供缓存插件使用。

关键要点

  • 过滤器名称:posts_groupby_request
  • 用途:过滤查询的 GROUP BY 子句,常用于缓存插件优化
  • 参数:$groupby(GROUP BY 子句字符串)和 $query(WP_Query 实例,通过引用传递)
  • 引入版本:WordPress 2.5.0
  • 相关函数:在 WP_Query::get_posts() 中调用

📄 原文内容

Filters the GROUP BY clause of the query.

Description

For use by caching plugins.

Parameters

$groupbystring
The GROUP BY clause of the query.
$queryWP_Query
The WP_Query instance (passed by reference).

Source

$groupby = apply_filters_ref_array( 'posts_groupby_request', array( $groupby, &$this ) );

Changelog

Version Description
2.5.0 Introduced.