Code Duplication    Length = 7-7 lines in 2 locations

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

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

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

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