Code Duplication    Length = 9-9 lines in 4 locations

includes/admin/admin-pages.php 4 locations

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