Code Duplication    Length = 7-7 lines in 3 locations

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

@@ 170-176 (lines=7) @@
167
		return $return;
168
	}
169
170
	function build_page_handle( $post, $query ) {
171
		$column = $query['orderby'];
172
		if ( ! $column ) {
173
			$column = 'date';
174
		}
175
		return build_query( array( 'value' => urlencode( $post->$column ), 'id' => $post->ID ) );
176
	}
177
178
	function handle_where_for_page_handle( $where ) {
179
		global $wpdb;

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

@@ 423-429 (lines=7) @@
420
		return $return;
421
	}
422
423
	function build_page_handle( $post, $query ) {
424
		$column = $query['orderby'];
425
		if ( ! $column ) {
426
			$column = 'date';
427
		}
428
		return build_query(
429
			array(
430
				'value' => urlencode( $post[ $column ] ),
431
				'id'    => $post['ID'],
432
			)

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

@@ 418-424 (lines=7) @@
415
		return $return;
416
	}
417
418
	function build_page_handle( $post, $query ) {
419
		$column = $query['orderby'];
420
		if ( ! $column ) {
421
			$column = 'date';
422
		}
423
		return build_query(
424
			array(
425
				'value' => urlencode( $post[ $column ] ),
426
				'id'    => $post['ID'],
427
			)