在保存时,WooCommerce Webhooks 默认会发送 X-WC-Webhook-Signature 头部。如果你想要禁用此功能,可以通过添加代码到你的主题的 functions.php 文件中来实现。
下面是一个示例代码,它会移除 WooCommerce Webhooks 发送 X-WC-Webhook-Signature 头部的功能:
// 移除 WooCommerce Webhooks 发送 X-WC-Webhook-Signature 头部
function remove_woocommerce_webhook_signature_header() {
remove_action( 'woocommerce_api_create_webhook', array( 'WC_Webhook', 'deliver_ping' ), 10 );
}
add_action( 'init', 'remove_woocommerce_webhook_signature_header' );
将上述代码添加到你的主题的 functions.php 文件中后,保存时 WooCommerce Webhooks 将不会发送 X-WC-Webhook-Signature 头部了。
请注意,修改主题的 functions.php 文件前最好先备份文件,以防止出现意外情况。