📄 原始资料 | 展开查看原始 JSON(bricks-webhook-timeout.json){ “name”: “bricks/webhook/timeout”, “kind”: “filter”, “url”: “https://academy.bricksbuilder.io/developer/hooks/filters/bricks-webhook-timeout/”, “scraped_at”: “2026-08-29”, “hook_name”: “bricks/webhook/timeout”, “description”: { “en”: “All…
📄 原始资料 | 展开查看原始 JSON(bricks-webhook-timeout.json)
{
"name": "bricks/webhook/timeout",
"kind": "filter",
"url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-webhook-timeout/",
"scraped_at": "2026-08-29",
"hook_name": "bricks/webhook/timeout",
"description": {
"en": "Allows you to modify the timeout duration (in seconds) for webhook requests triggered by the Form element.",
"zh": "允许你修改由 Form 元素触发的 Webhook 请求的超时时间(以秒为单位)。"
},
"parameters": [
{
"name": "timeout",
"type": "int",
"type_zh": null,
"description": {
"en": "The timeout duration in seconds. Default is 15 .",
"zh": "超时时长(秒)。默认为 15。"
}
}
],
"example_usage": "add_filter( 'bricks/webhook/timeout', function( $timeout ) {\n // Increase timeout to 30 seconds\n return 30;\n} );"
}
前言
允许你修改由 Form 元素触发的 Webhook 请求的超时时间(以秒为单位)。
用法
将代码加入子主题的 functions.php:
add_filter( 'bricks/webhook/timeout', function( $timeout ) {
// Increase timeout to 30 seconds
return 30;
} );
参数
$timeout (int):超时时长(秒)。默认为 15。
示例代码
筛选返回值
add_filter( 'bricks/webhook/timeout', function( $timeout ) {
// Increase timeout to 30 seconds
return 30;
} );
根据条件短路返回原值
根据条件跳过或修改返回值:
add_filter( 'bricks/webhook/timeout', function( $value, $timeout ) {
if ( is_admin() ) { return $value; }
// TODO: custom logic here
return $value;
} );
补充说明
更多细节可参考 官方文档。