woocommerce_api_create_coupon
The WooCommerce woocommerce api create coupon hook.
Description
Parameters (2)
- 0. $id (unknown)
- The id.
- 1. $data (unknown)
- The data.
Usage
- To run the hook, copy the example below.
- // run the action
- do_action( 'woocommerce_api_create_coupon', $id, $data );
- The following example is for adding a hook callback.
- // define the woocommerce_api_create_coupon callback
- function action_woocommerce_api_create_coupon( $id, $data ) {
- // make action magic happen here...
- };
- // add the action
- add_action( 'woocommerce_api_create_coupon', 'action_woocommerce_api_create_coupon', 10, 2 );
- To remove a hook callback, use the example below.
- // remove the action
- remove_action( 'woocommerce_api_create_coupon', 'action_woocommerce_api_create_coupon', 10, 2 );
Defined (2)
The action is defined in the following location(s).
- /includes/api/legacy/v3/class-wc-api-coupons.php
- do_action( 'woocommerce_api_create_coupon', $id, $data );
- /includes/api/legacy/v2/class-wc-api-coupons.php
- do_action( 'woocommerce_api_create_coupon', $id, $data );