Merge pull request #19305 from woocommerce/update/coupon-functions-phpcs
Fixed includes/wc-coupon-functions.php PHPCS violations
This commit is contained in:
commit
43655f349e
|
@ -1,36 +1,34 @@
|
|||
<?php
|
||||
if ( ! defined( 'ABSPATH' ) ) {
|
||||
exit;
|
||||
}
|
||||
|
||||
/**
|
||||
* WooCommerce Coupons Functions
|
||||
*
|
||||
* Functions for coupon specific things.
|
||||
*
|
||||
* @author WooThemes
|
||||
* @category Core
|
||||
* @package WooCommerce/Functions
|
||||
* @version 3.0.0
|
||||
* @package WooCommerce/Functions
|
||||
* @version 3.0.0
|
||||
*/
|
||||
|
||||
defined( 'ABSPATH' ) || exit;
|
||||
|
||||
/**
|
||||
* Get coupon types.
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
function wc_get_coupon_types() {
|
||||
return (array) apply_filters( 'woocommerce_coupon_discount_types', array(
|
||||
'percent' => __( 'Percentage discount', 'woocommerce' ),
|
||||
'fixed_cart' => __( 'Fixed cart discount', 'woocommerce' ),
|
||||
'fixed_product' => __( 'Fixed product discount', 'woocommerce' ),
|
||||
) );
|
||||
return (array) apply_filters(
|
||||
'woocommerce_coupon_discount_types', array(
|
||||
'percent' => __( 'Percentage discount', 'woocommerce' ),
|
||||
'fixed_cart' => __( 'Fixed cart discount', 'woocommerce' ),
|
||||
'fixed_product' => __( 'Fixed product discount', 'woocommerce' ),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a coupon type's name.
|
||||
*
|
||||
* @param string $type (default: '')
|
||||
* @param string $type Coupon type.
|
||||
* @return string
|
||||
*/
|
||||
function wc_get_coupon_type( $type = '' ) {
|
||||
|
@ -86,8 +84,8 @@ function wc_get_coupon_code_by_id( $id ) {
|
|||
* Get coupon code by ID.
|
||||
*
|
||||
* @since 3.0.0
|
||||
* @param string $code
|
||||
* @param int $exclude Used to exclude an ID from the check if you're checking existence.
|
||||
* @param string $code Coupon code.
|
||||
* @param int $exclude Used to exclude an ID from the check if you're checking existence.
|
||||
* @return int
|
||||
*/
|
||||
function wc_get_coupon_id_by_code( $code, $exclude = 0 ) {
|
||||
|
|
Loading…
Reference in New Issue