Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 90-96 (lines=7) @@
87
		}
88
89
		// Normalize post_type
90
		if ( isset( $args['type'] ) && 'any' == $args['type'] ) {
91
			if ( version_compare( $this->api->version, '1.1', '<' ) ) {
92
				$args['type'] = array( 'post', 'page' );
93
			} else { // 1.1+
94
				$args['type'] = $this->_get_whitelisted_post_types();
95
			}
96
		}
97
98
		// determine statuses
99
		$status = $args['status'];

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

@@ 101-107 (lines=7) @@
98
		}
99
100
		// Normalize post_type
101
		if ( isset( $args['type'] ) && 'any' == $args['type'] ) {
102
			if ( version_compare( $this->api->version, '1.1', '<' ) ) {
103
				$args['type'] = array( 'post', 'page' );
104
			} else { // 1.1+
105
				$args['type'] = $site->get_whitelisted_post_types();
106
			}
107
		}
108
109
		// determine statuses
110
		$status = ( ! empty( $args['status'] ) ) ? explode( ',', $args['status'] ) : array( 'publish' );