Code Duplication    Length = 6-7 lines in 2 locations

src/wp-includes/class-walker-category.php 1 location

@@ 181-187 (lines=7) @@
178
					} elseif ( $category->term_id == $_current_term->parent ) {
179
						$css_classes[] = 'current-cat-parent';
180
					}
181
					while ( $_current_term->parent ) {
182
						if ( $category->term_id == $_current_term->parent ) {
183
							$css_classes[] =  'current-cat-ancestor';
184
							break;
185
						}
186
						$_current_term = get_term( $_current_term->parent, $category->taxonomy );
187
					}
188
				}
189
			}
190

src/wp-admin/includes/ajax-actions.php 1 location

@@ 506-511 (lines=6) @@
503
		$parent = get_term( $parent, $taxonomy->name );
504
		$term_id = $parent->term_id;
505
506
		while ( $parent->parent ) { // get the top parent
507
			$parent = get_term( $parent->parent, $taxonomy->name );
508
			if ( is_wp_error( $parent ) )
509
				break;
510
			$term_id = $parent->term_id;
511
		}
512
513
		ob_start();
514