Code Duplication    Length = 4-4 lines in 3 locations

templates/emails/wpinv-email-invoice-items.php 1 location

@@ 56-59 (lines=4) @@
53
                                echo '<span class="wpinv_email_cart_item_title">' . $item_title . '</span>';
54
                                
55
                                $summary = '';
56
                                if ( !empty( $wpi_item ) && $wpi_item->is_package() && !empty( $item['meta']['post_id'] ) ) {
57
                                    $post_link = '<a href="' . get_permalink( $item['meta']['post_id'] ) .'" target="_blank">' . (!empty($item['meta']['invoice_title']) ? $item['meta']['invoice_title'] : get_the_title( $item['meta']['post_id']) ) . '</a>';
58
                                    $summary = wp_sprintf( __( '%s: %s', 'invoicing' ), $wpi_item->get_custom_singular_name(), $post_link );
59
                                }
60
                                
61
                                $summary = apply_filters( 'wpinv_email_invoice_line_item_summary', $summary, $item, $wpi_item, $invoice );
62
                                if ( !empty( $summary ) ) {

includes/wpinv-template-functions.php 2 locations

@@ 1056-1059 (lines=4) @@
1053
                    }
1054
                    $item_name  = !empty($cart_item['name']) ? $cart_item['name'] : $item_name;
1055
                    
1056
                    if (!empty($item) && $item->is_package() && !empty($cart_item['meta']['post_id'])) {
1057
                        $post_link = '<a href="' . get_edit_post_link( $cart_item['meta']['post_id'] ) .'" target="_blank">' . (!empty($cart_item['meta']['invoice_title']) ? $cart_item['meta']['invoice_title'] : get_the_title( $cart_item['meta']['post_id']) ) . '</a>';
1058
                        $summary = wp_sprintf( __( '%s: %s', 'invoicing' ), $item->get_custom_singular_name(), $post_link );
1059
                    }
1060
                    $summary = apply_filters( 'wpinv_print_invoice_line_item_summary', $summary, $cart_item, $item, $invoice );
1061
                    
1062
                    $item_tax       = '';
@@ 1308-1311 (lines=4) @@
1305
        $can_remove     = true;
1306
        
1307
        $summary = '';
1308
        if ($wpi_item->is_package() && !empty($cart_item['meta']['post_id'])) {
1309
            $post_link = '<a href="' . get_edit_post_link( $cart_item['meta']['post_id'] ) .'" target="_blank">' . (!empty($cart_item['meta']['invoice_title']) ? $cart_item['meta']['invoice_title'] : get_the_title( $cart_item['meta']['post_id']) ) . '</a>';
1310
            $summary = wp_sprintf( __( '%s: %s', 'invoicing' ), $wpi_item->get_custom_singular_name(), $post_link );
1311
        }
1312
        $summary = apply_filters( 'wpinv_admin_invoice_line_item_summary', $summary, $cart_item, $wpi_item, $invoice );
1313
        
1314
        $item_tax       = '';