Code Duplication    Length = 7-7 lines in 3 locations

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

@@ 123-129 (lines=7) @@
120
		return $return;
121
	}
122
123
	function build_page_handle( $post, $query ) {
124
		$column = $query['orderby'];
125
		if ( ! $column ) {
126
			$column = 'date';
127
		}
128
		return build_query( array( 'value' => urlencode( $post->$column ), 'id' => $post->ID ) );
129
	}
130
131
	function handle_where_for_page_handle( $where ) {
132
		global $wpdb;

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

@@ 348-354 (lines=7) @@
345
		return $return;
346
	}
347
348
	function build_page_handle( $post, $query ) {
349
		$column = $query['orderby'];
350
		if ( ! $column ) {
351
			$column = 'date';
352
		}
353
		return build_query( array( 'value' => urlencode($post[$column]), 'id' => $post['ID'] ) );
354
	}
355
356
	function _build_date_range_query( $column, $range, $where ) {
357
		global $wpdb;

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

@@ 346-352 (lines=7) @@
343
		return $return;
344
	}
345
346
	function build_page_handle( $post, $query ) {
347
		$column = $query['orderby'];
348
		if ( ! $column ) {
349
			$column = 'date';
350
		}
351
		return build_query( array( 'value' => urlencode($post[$column]), 'id' => $post['ID'] ) );
352
	}
353
354
	function _build_date_range_query( $column, $range, $where ) {
355
		global $wpdb;