Code Duplication    Length = 5-6 lines in 3 locations

includes/class-sensei-course.php 1 location

@@ 555-559 (lines=5) @@
552
				echo $id;
553
			break;
554
555
			case 'course-prerequisite':
556
				$course_prerequisite_id = get_post_meta( $id, '_course_prerequisite', true);
557
				if ( 0 < absint( $course_prerequisite_id ) ) { echo '<a href="' . esc_url( get_edit_post_link( absint( $course_prerequisite_id ) ) ) . '" title="' . esc_attr( sprintf( __( 'Edit %s', 'woothemes-sensei' ), get_the_title( absint( $course_prerequisite_id ) ) ) ) . '">' . get_the_title( absint( $course_prerequisite_id ) ) . '</a>'; }
558
559
			break;
560
561
			case 'course-woocommerce-product':
562
				if ( Sensei_WC::is_woocommerce_active() ) {

includes/class-sensei-lesson.php 2 locations

@@ 1809-1814 (lines=6) @@
1806
			case 'id':
1807
				echo $id;
1808
			break;
1809
			case 'lesson-course':
1810
				$lesson_course_id = get_post_meta( $id, '_lesson_course', true);
1811
				if ( 0 < absint( $lesson_course_id ) ) {
1812
					echo '<a href="' . esc_url( get_edit_post_link( absint( $lesson_course_id ) ) ) . '" title="' . esc_attr( sprintf( __( 'Edit %s', 'woothemes-sensei' ), get_the_title( absint( $lesson_course_id ) ) ) ) . '">' . get_the_title( absint( $lesson_course_id ) ) . '</a>';
1813
				} // End If Statement
1814
			break;
1815
			case 'lesson-prerequisite':
1816
				$lesson_prerequisite_id = get_post_meta( $id, '_lesson_prerequisite', true);
1817
				if ( 0 < absint( $lesson_prerequisite_id ) ) {
@@ 1815-1820 (lines=6) @@
1812
					echo '<a href="' . esc_url( get_edit_post_link( absint( $lesson_course_id ) ) ) . '" title="' . esc_attr( sprintf( __( 'Edit %s', 'woothemes-sensei' ), get_the_title( absint( $lesson_course_id ) ) ) ) . '">' . get_the_title( absint( $lesson_course_id ) ) . '</a>';
1813
				} // End If Statement
1814
			break;
1815
			case 'lesson-prerequisite':
1816
				$lesson_prerequisite_id = get_post_meta( $id, '_lesson_prerequisite', true);
1817
				if ( 0 < absint( $lesson_prerequisite_id ) ) {
1818
					echo '<a href="' . esc_url( get_edit_post_link( absint( $lesson_prerequisite_id ) ) ) . '" title="' . esc_attr( sprintf( __( 'Edit %s', 'woothemes-sensei' ), get_the_title( absint( $lesson_prerequisite_id ) ) ) ) . '">' . get_the_title( absint( $lesson_prerequisite_id ) ) . '</a>';
1819
				} // End If Statement
1820
			break;
1821
			default:
1822
			break;
1823
		} // End Switch Statement