includes/api/class-wc-rest-orders-controller.php 1 location
|
@@ 365-371 (lines=7) @@
|
| 362 |
|
} |
| 363 |
|
} |
| 364 |
|
break; |
| 365 |
|
case 'meta_data' : |
| 366 |
|
if ( is_array( $value ) ) { |
| 367 |
|
foreach ( $value as $meta ) { |
| 368 |
|
$order->update_meta_data( $meta['key'], $meta['value'], $meta['id'] ); |
| 369 |
|
} |
| 370 |
|
} |
| 371 |
|
break; |
| 372 |
|
default : |
| 373 |
|
if ( is_callable( array( $order, "set_{$key}" ) ) ) { |
| 374 |
|
$order->{"set_{$key}"}( $value ); |
includes/api/class-wc-rest-coupons-controller.php 1 location
|
@@ 234-240 (lines=7) @@
|
| 231 |
|
|
| 232 |
|
$coupon->set_code( $coupon_code ); |
| 233 |
|
break; |
| 234 |
|
case 'meta_data' : |
| 235 |
|
if ( is_array( $value ) ) { |
| 236 |
|
foreach ( $value as $meta ) { |
| 237 |
|
$coupon->update_meta_data( $meta['key'], $meta['value'], $meta['id'] ); |
| 238 |
|
} |
| 239 |
|
} |
| 240 |
|
break; |
| 241 |
|
case 'description' : |
| 242 |
|
$coupon->set_description( wp_filter_post_kses( $value ) ); |
| 243 |
|
break; |