Code Duplication    Length = 9-9 lines in 2 locations

includes/wpinv-discount-functions.php 2 locations

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