Code Duplication    Length = 9-9 lines in 4 locations

includes/admin/admin-pages.php 4 locations

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