Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 149-152 (lines=4) @@
146
			}
147
		}
148
149
		if ( isset( $args['exclude'] ) ) {
150
			$excluded_ids = (array) $args['exclude'];
151
			$query['post__not_in'] = isset( $query['post__not_in'] ) ? array_merge( $query['post__not_in'], $excluded_ids ) : $excluded_ids;
152
		}
153
154
		if ( isset( $args['exclude_tree'] ) && is_post_type_hierarchical( $args['type'] ) ) {
155
			// get_page_children is a misnomer; it supports all hierarchical post types

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

@@ 151-154 (lines=4) @@
148
			}
149
		}
150
151
		if ( isset( $args['exclude'] ) ) {
152
			$excluded_ids = (array) $args['exclude'];
153
			$query['post__not_in'] = isset( $query['post__not_in'] ) ? array_merge( $query['post__not_in'], $excluded_ids ) : $excluded_ids;
154
		}
155
156
		if ( isset( $args['exclude_tree'] ) && is_post_type_hierarchical( $args['type'] ) ) {
157
			// get_page_children is a misnomer; it supports all hierarchical post types