钩子文档

dashboard_recent_posts_query_args

💡 云策文档标注

概述

dashboard_recent_posts_query_args 是一个 WordPress 过滤器,用于修改仪表板中 Recent Posts 小部件查询参数。它允许开发者自定义 WP_Query 参数以调整文章列表的显示。

关键要点

  • 这是一个过滤器 Hook,名称为 dashboard_recent_posts_query_args。
  • 参数 $query_args 是一个数组,传递给 WP_Query 以生成文章列表。
  • 在 wp_dashboard_recent_posts() 函数中使用,位于 wp-admin/includes/dashboard.php 文件中。
  • 从 WordPress 4.2.0 版本开始引入。

📄 原文内容

Filters the query arguments used for the Recent Posts widget.

Parameters

$query_argsarray
The arguments passed to WP_Query to produce the list of posts.

Source

$query_args = apply_filters( 'dashboard_recent_posts_query_args', $query_args );

Changelog

Version Description
4.2.0 Introduced.