钩子介绍
订单额外属性过滤钩子qcbox/pr/price_attrs_filter
主要用于在前端下单页面添加额外的支付属性,让付费系统可以完成更多功能。
钩子参数
qcbox/pr/price_attrs_filter
包含三个参数
- $data
- title:订单数据
- type:array
{
"duration": {
"title": "购买时长",
"opts": [
{
"checked": false,
"v2price": "",
"name": "标准",
"type": 1,
"v1price": "8.88",
"label": "购买后30天内免费更新汉化",
"price": "18.88",
"oprice": "28.88"
},
{
"checked": true,
"v2price": 0,
"name": "永久",
"type": 0,
"v1price": 17.76,
"label": "购买后永久更新汉化",
"price": 37.76,
"oprice": 57.76
}
]
}
}
- $post
- title:文章对象
- type:WP_Post
- $type
- title:订单类型
- type:string
prdata_1
钩子源码
源码位置:qctoolbox\module\paid-resources\inc\paid.php:359
$attrs = apply_filters( 'qcbox/pr/price_attrs_filter', $attrs, $post ,$qcprctype);