钩子文档

rest_themes_collection_params

💡 云策文档标注

概述

此文档介绍 rest_themes_collection_params 过滤器,用于在 WordPress REST API 中修改主题控制器的集合参数。它允许开发者自定义主题集合的查询参数。

关键要点

  • rest_themes_collection_params 是一个过滤器,用于过滤主题控制器的 REST API 集合参数。
  • 参数 $query_params 是一个数组,包含 JSON Schema 格式的集合参数。
  • 此过滤器在 WP_REST_Themes_Controller::get_collection_params() 方法中被调用,用于检索主题集合的搜索参数。
  • 该过滤器从 WordPress 5.0.0 版本开始引入。

📄 原文内容

Filters REST API collection parameters for the themes controller.

Parameters

$query_paramsarray
JSON Schema-formatted collection parameters.

Source

return apply_filters( 'rest_themes_collection_params', $query_params );

Changelog

Version Description
5.0.0 Introduced.