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
|
<?php
|
||||||
if ( ! defined( 'ABSPATH' ) ) {
|
|
||||||
exit;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* WooCommerce Coupons Functions
|
* WooCommerce Coupons Functions
|
||||||
*
|
*
|
||||||
* Functions for coupon specific things.
|
* Functions for coupon specific things.
|
||||||
*
|
*
|
||||||
* @author WooThemes
|
* @package WooCommerce/Functions
|
||||||
* @category Core
|
* @version 3.0.0
|
||||||
* @package WooCommerce/Functions
|
|
||||||
* @version 3.0.0
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
defined( 'ABSPATH' ) || exit;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get coupon types.
|
* Get coupon types.
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*/
|
*/
|
||||||
function wc_get_coupon_types() {
|
function wc_get_coupon_types() {
|
||||||
return (array) apply_filters( 'woocommerce_coupon_discount_types', array(
|
return (array) apply_filters(
|
||||||
'percent' => __( 'Percentage discount', 'woocommerce' ),
|
'woocommerce_coupon_discount_types', array(
|
||||||
'fixed_cart' => __( 'Fixed cart discount', 'woocommerce' ),
|
'percent' => __( 'Percentage discount', 'woocommerce' ),
|
||||||
'fixed_product' => __( 'Fixed product discount', 'woocommerce' ),
|
'fixed_cart' => __( 'Fixed cart discount', 'woocommerce' ),
|
||||||
) );
|
'fixed_product' => __( 'Fixed product discount', 'woocommerce' ),
|
||||||
|
)
|
||||||
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a coupon type's name.
|
* Get a coupon type's name.
|
||||||
*
|
*
|
||||||
* @param string $type (default: '')
|
* @param string $type Coupon type.
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
function wc_get_coupon_type( $type = '' ) {
|
function wc_get_coupon_type( $type = '' ) {
|
||||||
|
@ -86,8 +84,8 @@ function wc_get_coupon_code_by_id( $id ) {
|
||||||
* Get coupon code by ID.
|
* Get coupon code by ID.
|
||||||
*
|
*
|
||||||
* @since 3.0.0
|
* @since 3.0.0
|
||||||
* @param string $code
|
* @param string $code Coupon code.
|
||||||
* @param int $exclude Used to exclude an ID from the check if you're checking existence.
|
* @param int $exclude Used to exclude an ID from the check if you're checking existence.
|
||||||
* @return int
|
* @return int
|
||||||
*/
|
*/
|
||||||
function wc_get_coupon_id_by_code( $code, $exclude = 0 ) {
|
function wc_get_coupon_id_by_code( $code, $exclude = 0 ) {
|
||||||
|
|
Loading…
Reference in New Issue