Code Duplication    Length = 9-15 lines in 2 locations

includes/class-sensei-course.php 1 location

@@ 233-247 (lines=15) @@
230
					}
231
232
					// Show variations in groups
233
					if( $parent_id && $parent_id != $prev_parent_id ) {
234
235
						if( 0 != $prev_parent_id ) {
236
237
							$html .= '</optgroup>';
238
239
						}
240
						$html .= '<optgroup label="' . get_the_title( $parent_id ) . '">';
241
						$prev_parent_id = $parent_id;
242
243
					} elseif( ! $parent_id && 0 == $prev_parent_id ) {
244
245
						$html .= '</optgroup>';
246
247
					}
248
249
					$html .= '<option value="' . esc_attr( absint( $post_item->ID ) ) . '"' . selected( $post_item->ID, $select_course_woocommerce_product, false ) . '>' . esc_html( $product_name ) . '</option>' . "\n";
250

includes/class-sensei-lesson.php 1 location

@@ 576-584 (lines=9) @@
573
									}
574
575
									// Show variations in groups
576
									if( $parent_id && $parent_id != $prev_parent_id ) {
577
										if( 0 != $prev_parent_id ) {
578
											$html .= '</optgroup>';
579
										}
580
										$html .= '<optgroup label="' . get_the_title( $parent_id ) . '">';
581
										$prev_parent_id = $parent_id;
582
									} elseif( ! $parent_id && 0 == $prev_parent_id ) {
583
										$html .= '</optgroup>';
584
									}
585
586
									$html .= '<option value="' . esc_attr( absint( $products_item->ID ) ) . '">' . esc_html( $products_item->post_title ) . '</option>' . "\n";
587
								} // End For Loop