Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 223-226 (lines=4) @@
220
			}
221
		}
222
223
		if ( isset( $args['exclude'] ) ) {
224
			$excluded_ids          = (array) $args['exclude'];
225
			$query['post__not_in'] = isset( $query['post__not_in'] ) ? array_merge( $query['post__not_in'], $excluded_ids ) : $excluded_ids;
226
		}
227
228
		if ( isset( $args['exclude_tree'] ) && is_post_type_hierarchical( $args['type'] ) ) {
229
			// 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

@@ 217-220 (lines=4) @@
214
			}
215
		}
216
217
		if ( isset( $args['exclude'] ) ) {
218
			$excluded_ids          = (array) $args['exclude'];
219
			$query['post__not_in'] = isset( $query['post__not_in'] ) ? array_merge( $query['post__not_in'], $excluded_ids ) : $excluded_ids;
220
		}
221
222
		if ( isset( $args['exclude_tree'] ) && is_post_type_hierarchical( $args['type'] ) ) {
223
			// get_page_children is a misnomer; it supports all hierarchical post types