wc_get_coupon_code_by_id()
Get coupon code by ID.
No Hooks.
Return
String
.
Usage
wc_get_coupon_code_by_id( $id );
- $id(int) (required)
- Coupon ID.
Changelog
Since 3.0.0 | Introduced. |
wc_get_coupon_code_by_id() wc get coupon code by id code WC 9.8.2
function wc_get_coupon_code_by_id( $id ) { $data_store = WC_Data_Store::load( 'coupon' ); return empty( $id ) ? '' : (string) $data_store->get_code_by_id( $id ); }