rest_prepare_block_type

过滤钩子
apply_filters( 'rest_prepare_block_type', $response, $block_type, $request )
参数
  • (WP_REST_Response) $response The response object.
    Required:
  • (WP_Block_Type) $block_type The original block type object.
    Required:
  • (WP_REST_Request) $request Request used to generate the response.
    Required:
定义位置
相关勾子
rest_prepare_block_patternrest_prepare_post_typerest_prepare_widget_typerest_prepare_themeregister_block_type_args
相关方法
register_block_typeunregister_block_typeregister_block_styleunregister_block_styleget_allowed_block_typesregister_block_style_handle
引入
5.5.0
弃用
-

rest_prepare_block_type: 这是WordPress中的一个动作钩子,当REST API正在准备响应的块类型时被触发。它允许开发者在返回之前修改块类型的数据。

过滤从REST API返回的区块类型。

允许在返回前修改区块类型的数据。

return apply_filters( 'rest_prepare_block_type', $response, $block_type, $request );

常见问题

FAQs
查看更多 >
闪电伯伯

(工作日 10:00 - 18:30 为您服务)

2025-11-14 00:25:27

您好,无论是售前、售后、意见建议……均可通过联系工单与我们取得联系。

您也可选择聊天工具与我们即时沟通或点击查看:

您的工单我们已经收到,我们将会尽快跟您联系!
取消
选择聊天工具: