Code Duplication    Length = 7-7 lines in 2 locations

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

@@ 323-329 (lines=7) @@
320
		return $return;
321
	}
322
323
	function build_page_handle( $post, $query ) {
324
		$column = $query['orderby'];
325
		if ( ! $column ) {
326
			$column = 'date';
327
		}
328
		return build_query( array( 'value' => urlencode($post[$column]), 'id' => $post['ID'] ) );
329
	}
330
331
	function _build_date_range_query( $column, $range, $where ) {
332
		global $wpdb;

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

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