钩子文档

rest_pattern_directory_collection_params

💡 云策文档标注

概述

此文档介绍 WordPress REST API 中的 rest_pattern_directory_collection_params 过滤器,用于修改块模式目录控制器的集合参数。该过滤器允许开发者自定义块模式搜索的查询参数。

关键要点

  • rest_pattern_directory_collection_params 是一个过滤器,用于过滤块模式目录控制器的集合参数。
  • 参数 $query_params 是一个数组,遵循 JSON Schema 格式,定义了集合的查询参数。
  • 过滤器在 WP_REST_Pattern_Directory_Controller::get_collection_params() 方法中被调用,用于检索块模式集合的搜索参数。
  • 此过滤器自 WordPress 5.8.0 版本引入。

📄 原文内容

Filter collection parameters for the block pattern directory controller.

Parameters

$query_paramsarray
JSON Schema-formatted collection parameters.

Source

return apply_filters( 'rest_pattern_directory_collection_params', $query_params );

Changelog

Version Description
5.8.0 Introduced.