wordpress - 如何在 woocommerce 中检查订单备注的类型
问题描述
如何查看订单备注的类型woocommerce
?
我想检查笔记是 private_note 还是 customer_note。
这是我的代码:
//add_action('wp_insert_comment','hook_insert_func',100,2);
add_filter( 'comments_clauses','hook_insert_func',100,2);
function hook_insert_func($id, $comment){
if($comment->comment_type!='order_note')
return;
if($comment->comment_type == 'order_note'){
$mobile = PWooSMS()->buyerMobile($comment->comment_post_ID);
$data = array();
$data['type'] = 1;
$data['mobile'] = "$mobile";
$data['message'] = $comment->comment_content;
$response = PWooSMS()->SendSMS( $data );
}
}
解决方案
推荐阅读
- laravel - Laravel 7:setUp() 中的单元测试集默认请求标头
- visual-studio - 如何为 Razor 文件中的符号 (@) 关闭 Visual Studio 背景突出显示?
- google-sheets - 在没有服务帐户的情况下向 Gsuite API 进行身份验证
- html - 使用 Twing 转义 HTML 标签
- html - 如何在 Materialise CSS 中调整导航链接的高度和面积?
- change-data-capture - 如何在 Scylla 中获取特定分区键的流 ID
- android - 图像到二进制值 - 像素值
- spring - Spring Boot / JPA / H2 - 找不到表
- javascript - 将 ESlint 与 expressjs 一起使用
- javascript - 在 MVC 中向 bootstrapTable 添加删除按钮