Code Duplication    Length = 4-4 lines in 2 locations

json-endpoints/class.wpcom-json-api-list-posts-v1-1-endpoint.php 1 location

@@ 207-210 (lines=4) @@
204
			}
205
		}
206
207
		if ( isset( $args['exclude'] ) ) {
208
			$excluded_ids = (array) $args['exclude'];
209
			$query['post__not_in'] = isset( $query['post__not_in'] ) ? array_merge( $query['post__not_in'], $excluded_ids ) : $excluded_ids;
210
		}
211
212
		if ( isset( $args['exclude_tree'] ) && is_post_type_hierarchical( $args['type'] ) ) {
213
			// get_page_children is a misnomer; it supports all hierarchical post types

json-endpoints/class.wpcom-json-api-list-posts-v1-2-endpoint.php 1 location

@@ 200-203 (lines=4) @@
197
			}
198
		}
199
200
		if ( isset( $args['exclude'] ) ) {
201
			$excluded_ids = (array) $args['exclude'];
202
			$query['post__not_in'] = isset( $query['post__not_in'] ) ? array_merge( $query['post__not_in'], $excluded_ids ) : $excluded_ids;
203
		}
204
205
		if ( isset( $args['exclude_tree'] ) && is_post_type_hierarchical( $args['type'] ) ) {
206
			// get_page_children is a misnomer; it supports all hierarchical post types