posts_pre_query钩子是Wordpress钩子,过滤器::在查询发生之前过滤posts数组。
apply_filters_ref_array( ‘posts_pre_query’, array|null $posts, WP_Query $this )
说明(Description)
返回非空值以绕过WordPress的默认post查询。
参数(Parameters)
参数 | 类型 | 说明 |
---|---|---|
$posts | (array | null) | 将post数据数组返回到short-circuit WP的查询,或返回null以允许WP运行其正常查询。 |
$this | (WP_Query) | WP_查询实例(通过引用传递)。 |
源码(Source)
//暂无
更新版本 | 源码位置 | 使用 | 被使用 |
---|---|---|---|
4.6.0 | wp-includes/class-wp-query.php:2944 | 1 | 0 |