Code Duplication    Length = 3-3 lines in 2 locations

modules/search/class.jetpack-search.php 1 location

@@ 358-360 (lines=3) @@
355
356
			$taxonomy = $tax_query['taxonomy'];
357
358
			if ( ! isset( $args[ $taxonomy ] ) || ! is_array( $args[ $taxonomy ] ) ) {
359
				$args[ $taxonomy ] = array();
360
			}
361
362
			$args[ $taxonomy ] = array_merge( $args[ $taxonomy ], $tax_query['terms'] );
363
		}

json-endpoints/class.wpcom-json-api-update-post-v1-2-endpoint.php 1 location

@@ 232-234 (lines=3) @@
229
		/* add terms by ID */
230
		foreach ( $input['terms_by_id'] as $taxonomy => $terms ) {
231
			// combine with any previous selections
232
			if ( ! isset( $tax_input[ $taxonomy ] ) || ! is_array( $tax_input[ $taxonomy ] ) ) {
233
				$tax_input[ $taxonomy ] = array();
234
			}
235
236
			$is_hierarchical = is_taxonomy_hierarchical( $taxonomy );
237