📄 原始资料 | 展开查看原始 JSON(bricks-woocommerce-cart_proceed_label.json){ “name”: “bricks/woocommerce/cart_proceed_label”, “kind”: “filter”, “url”: “https://academy.bricksbuilder.io/developer/hooks/filters/bricks-woocommerce-cart_proceed_label/”, “scraped_at”: “2026-08-29”, “hook_name”: “bricks/…
📄 原始资料 | 展开查看原始 JSON(bricks-woocommerce-cart_proceed_label.json)
{
"name": "bricks/woocommerce/cart_proceed_label",
"kind": "filter",
"url": "https://academy.bricksbuilder.io/developer/hooks/filters/bricks-woocommerce-cart_proceed_label/",
"scraped_at": "2026-08-29",
"hook_name": "bricks/woocommerce/cart_proceed_label",
"description": {
"en": "Allows you to modify the text of the “Proceed to checkout” button in the WooCommerce Cart element.",
"zh": "允许你修改 WooCommerce 购物车元素中“去结账”按钮的文本。"
},
"parameters": [
{
"name": "label",
"type": "string",
"type_zh": null,
"description": {
"en": "The button text. Default is “Proceed to checkout”.",
"zh": "按钮文本。默认为“Proceed to checkout”。"
}
}
],
"example_usage": "add_filter( 'bricks/woocommerce/cart_proceed_label', function( $label ) {\n return 'Go to Checkout';\n} );"
}
前言
允许你修改 WooCommerce 购物车元素中“去结账”按钮的文本。
用法
将代码加入子主题的 functions.php:
add_filter( 'bricks/woocommerce/cart_proceed_label', function( $label ) {
return 'Go to Checkout';
} );
参数
$label (string):按钮文本。默认为“Proceed to checkout”。
示例代码
筛选返回值
add_filter( 'bricks/woocommerce/cart_proceed_label', function( $label ) {
return 'Go to Checkout';
} );
根据条件短路返回原值
根据条件跳过或修改返回值:
add_filter( 'bricks/woocommerce/cart_proceed_label', function( $value, $label ) {
if ( is_admin() ) { return $value; }
// TODO: custom logic here
return $value;
} );
补充说明
更多细节可参考 官方文档。