Code Duplication    Length = 9-15 lines in 4 locations

includes/class-sensei-course.php 4 locations

@@ 667-676 (lines=10) @@
664
665
		switch ($type) {
666
667
			case 'usercourses':
668
				$post_args = array(	'post_type' 		=> 'course',
669
									'orderby'         	=> $orderby,
670
    								'order'           	=> $order,
671
    								'post_status'      	=> 'publish',
672
    								'include'			=> $includes,
673
    								'exclude'			=> $excludes,
674
    								'suppress_filters' 	=> 0
675
									);
676
				break;
677
			case 'freecourses':
678
679
                $post_args = array(
@@ 677-690 (lines=14) @@
674
    								'suppress_filters' 	=> 0
675
									);
676
				break;
677
			case 'freecourses':
678
679
                $post_args = array(
680
                    'post_type' 		=> 'course',
681
                    'orderby'         	=> $orderby,
682
                    'order'           	=> $order,
683
                    'post_status'      	=> 'publish',
684
                    'exclude'			=> $excludes,
685
                    'suppress_filters' 	=> 0
686
                );
687
                // Sub Query to get all WooCommerce Products that have Zero price
688
                $post_args['meta_query'] = Sensei_WC::get_free_courses_meta_query_args();
689
690
                break;
691
692
			case 'paidcourses':
693
@@ 692-706 (lines=15) @@
689
690
                break;
691
692
			case 'paidcourses':
693
694
                $post_args = array(
695
                    'post_type' 		=> 'course',
696
                    'orderby'         	=> $orderby,
697
                    'order'           	=> $order,
698
                    'post_status'      	=> 'publish',
699
                    'exclude'			=> $excludes,
700
                    'suppress_filters' 	=> 0
701
                );
702
703
                // Sub Query to get all WooCommerce Products that have price greater than zero
704
                $post_args['meta_query'] = Sensei_WC::get_paid_courses_meta_query_args();
705
706
				break;
707
708
			case 'featuredcourses':
709
                $post_args = array(	'post_type' 		=> 'course',
@@ 720-728 (lines=9) @@
717
    								'suppress_filters' 	=> 0
718
									);
719
				break;
720
			default:
721
				$post_args = array(	'post_type' 		=> 'course',
722
                                    'orderby'         	=> $orderby,
723
                                    'order'           	=> $order,
724
    								'post_status'      	=> 'publish',
725
    								'exclude'			=> $excludes,
726
    								'suppress_filters' 	=> 0
727
									);
728
				break;
729
730
		}
731