Code Duplication    Length = 8-8 lines in 3 locations

includes/admin/class-wc-admin-attributes.php 1 location

@@ 342-349 (lines=8) @@
339
															$terms = get_terms( $taxonomy, 'hide_empty=0&menu_order=false' );
340
														}
341
342
														switch ( $tax->attribute_orderby ) {
343
															case 'name_num':
344
																usort( $terms, '_wc_get_product_terms_name_num_usort_callback' );
345
																break;
346
															case 'parent':
347
																usort( $terms, '_wc_get_product_terms_parent_usort_callback' );
348
																break;
349
														}
350
351
														$terms_string = implode( ', ', wp_list_pluck( $terms, 'name' ) );
352
														if ( $terms_string ) {

includes/wc-term-functions.php 1 location

@@ 92-99 (lines=8) @@
89
90
		$terms = _wc_get_cached_product_terms( $product_id, $taxonomy, $args );
91
92
		switch ( $orderby ) {
93
			case 'name_num':
94
				usort( $terms, '_wc_get_product_terms_name_num_usort_callback' );
95
				break;
96
			case 'parent':
97
				usort( $terms, '_wc_get_product_terms_parent_usort_callback' );
98
				break;
99
		}
100
101
		switch ( $fields ) {
102
			case 'names':

includes/widgets/class-wc-widget-layered-nav.php 1 location

@@ 195-202 (lines=8) @@
192
			return;
193
		}
194
195
		switch ( $orderby ) {
196
			case 'name_num':
197
				usort( $terms, '_wc_get_product_terms_name_num_usort_callback' );
198
				break;
199
			case 'parent':
200
				usort( $terms, '_wc_get_product_terms_parent_usort_callback' );
201
				break;
202
		}
203
204
		ob_start();
205