Code Duplication    Length = 4-4 lines in 2 locations

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

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

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