Code Duplication    Length = 9-9 lines in 2 locations

includes/wpinv-discount-functions.php 2 locations

@@ 394-402 (lines=9) @@
391
    return $name;
392
}
393
394
function wpinv_get_discount_excluded_items( $code_id = null ) {
395
    $excluded_items = get_post_meta( $code_id, '_wpi_discount_excluded_items', true );
396
397
    if ( empty( $excluded_items ) || ! is_array( $excluded_items ) ) {
398
        $excluded_items = array();
399
    }
400
401
    return (array) apply_filters( 'wpinv_get_discount_excluded_items', $excluded_items, $code_id );
402
}
403
404
function wpinv_get_discount_item_reqs( $code_id = null ) {
405
    $item_reqs = get_post_meta( $code_id, '_wpi_discount_items', true );
@@ 404-412 (lines=9) @@
401
    return (array) apply_filters( 'wpinv_get_discount_excluded_items', $excluded_items, $code_id );
402
}
403
404
function wpinv_get_discount_item_reqs( $code_id = null ) {
405
    $item_reqs = get_post_meta( $code_id, '_wpi_discount_items', true );
406
407
    if ( empty( $item_reqs ) || ! is_array( $item_reqs ) ) {
408
        $item_reqs = array();
409
    }
410
411
    return (array) apply_filters( 'wpinv_get_discount_item_reqs', $item_reqs, $code_id );
412
}
413
414
function wpinv_get_discount_item_condition( $code_id = 0 ) {
415
    return get_post_meta( $code_id, '_wpi_discount_item_condition', true );