woocommerce_api_create_coupon_data

woocommerce_api_create_coupon_data

Appears in: , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , , ,
Hook Type: filter

See hook in core

Displaying hooks found in version: woocommerce.8.9.3

apply_filters('woocommerce_api_create_coupon_data') is found 2 times:

  • /includes/legacy/api/v2/class-wc-api-coupons.php line 222
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    if ( ! current_user_can( 'publish_shop_coupons' ) ) {
        throw new WC_API_Exception( 'woocommerce_api_user_cannot_create_coupon', __( 'You do not have permission to create coupons', 'woocommerce' ), 401 );
    }
     
    $data = apply_filters( 'woocommerce_api_create_coupon_data', $data, $this );
     
    // Check if coupon code is specified
    if ( ! isset( $data['code'] ) ) {
        throw new WC_API_Exception( 'woocommerce_api_missing_coupon_code', sprintf( __( 'Missing parameter %s', 'woocommerce' ), 'code' ), 400 );
    }
  • /includes/legacy/api/v3/class-wc-api-coupons.php line 220
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    if ( ! current_user_can( 'publish_shop_coupons' ) ) {
        throw new WC_API_Exception( 'woocommerce_api_user_cannot_create_coupon', __( 'You do not have permission to create coupons', 'woocommerce' ), 401 );
    }
     
    $data = apply_filters( 'woocommerce_api_create_coupon_data', $data, $this );
     
    // Check if coupon code is specified
    if ( ! isset( $data['code'] ) ) {
        throw new WC_API_Exception( 'woocommerce_api_missing_coupon_code', sprintf( __( 'Missing parameter %s', 'woocommerce' ), 'code' ), 400 );
    }