Code Duplication    Length = 9-9 lines in 4 locations

includes/admin/admin-pages.php 4 locations

@@ 271-279 (lines=9) @@
268
        }
269
270
        // Check if "orderby" is set to "vat_rule"
271
        if ( isset( $vars['orderby'] ) && 'vat_rule' == $vars['orderby'] ) {
272
            $vars = array_merge(
273
                $vars,
274
                array(
275
                    'meta_key' => '_wpinv_vat_rule',
276
                    'orderby'  => 'meta_value'
277
                )
278
            );
279
        }
280
281
        // Check if "orderby" is set to "vat_class"
282
        if ( isset( $vars['orderby'] ) && 'vat_class' == $vars['orderby'] ) {
@@ 282-290 (lines=9) @@
279
        }
280
281
        // Check if "orderby" is set to "vat_class"
282
        if ( isset( $vars['orderby'] ) && 'vat_class' == $vars['orderby'] ) {
283
            $vars = array_merge(
284
                $vars,
285
                array(
286
                    'meta_key' => '_wpinv_vat_class',
287
                    'orderby'  => 'meta_value'
288
                )
289
            );
290
        }
291
        
292
        // Check if "orderby" is set to "type"
293
        if ( isset( $vars['orderby'] ) && 'type' == $vars['orderby'] ) {
@@ 293-301 (lines=9) @@
290
        }
291
        
292
        // Check if "orderby" is set to "type"
293
        if ( isset( $vars['orderby'] ) && 'type' == $vars['orderby'] ) {
294
            $vars = array_merge(
295
                $vars,
296
                array(
297
                    'meta_key' => '_wpinv_type',
298
                    'orderby'  => 'meta_value'
299
                )
300
            );
301
        }
302
        
303
        // Check if "orderby" is set to "recurring"
304
        if ( isset( $vars['orderby'] ) && 'recurring' == $vars['orderby'] ) {
@@ 304-312 (lines=9) @@
301
        }
302
        
303
        // Check if "orderby" is set to "recurring"
304
        if ( isset( $vars['orderby'] ) && 'recurring' == $vars['orderby'] ) {
305
            $vars = array_merge(
306
                $vars,
307
                array(
308
                    'meta_key' => '_wpinv_is_recurring',
309
                    'orderby'  => 'meta_value'
310
                )
311
            );
312
        }
313
314
        $meta_query = !empty( $vars['meta_query'] ) ? $vars['meta_query'] : array();
315
        // Filter vat rule type