Code Duplication    Length = 18-18 lines in 2 locations

includes/class-sensei-modules.php 2 locations

@@ 1085-1102 (lines=18) @@
1082
     * @param  WP_Post $lesson
1083
     * @return array              Updated column data
1084
     */
1085
    public function analysis_overview_column_data($columns, $lesson )
1086
    {
1087
1088
        if ( isset( $_GET['view'] ) && 'lessons' == $_GET['view'] ) {
1089
            $lesson_module = '';
1090
            $lesson_module_list = wp_get_post_terms($lesson->ID, $this->taxonomy);
1091
            if (is_array($lesson_module_list) && count($lesson_module_list) > 0) {
1092
                foreach ($lesson_module_list as $single_module) {
1093
                    $lesson_module = '<a href="' . esc_url(admin_url('edit-tags.php?action=edit&taxonomy=' . urlencode($this->taxonomy) . '&tag_ID=' . urlencode($single_module->term_id))) . '">' . $single_module->name . '</a>';
1094
                    break;
1095
                }
1096
            }
1097
1098
            $columns['lesson_module'] = $lesson_module;
1099
        }
1100
1101
        return $columns;
1102
    }
1103
1104
    /**
1105
     * Add 'Module' columns to Analysis Course table
@@ 1129-1146 (lines=18) @@
1126
     * @param  WP_Post $lesson
1127
     * @return array              Updated columns data
1128
     */
1129
    public function analysis_course_column_data($columns, $lesson )
1130
    {
1131
1132
        if ( isset( $_GET['course_id'] ) ) {
1133
            $lesson_module = '';
1134
            $lesson_module_list = wp_get_post_terms($lesson->ID, $this->taxonomy);
1135
            if (is_array($lesson_module_list) && count($lesson_module_list) > 0) {
1136
                foreach ($lesson_module_list as $single_module) {
1137
                    $lesson_module = '<a href="' . esc_url(admin_url('edit-tags.php?action=edit&taxonomy=' . urlencode($this->taxonomy) . '&tag_ID=' . urlencode($single_module->term_id))) . '">' . $single_module->name . '</a>';
1138
                    break;
1139
                }
1140
            }
1141
1142
            $columns['lesson_module'] = $lesson_module;
1143
        }
1144
1145
        return $columns;
1146
    }
1147
1148
    /**
1149
     * Get module for lesson