Code Duplication    Length = 5-5 lines in 2 locations

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

@@ 416-420 (lines=5) @@
413
			case 'tags' :
414
				$response[$key] = array();
415
				$terms = wp_get_post_tags( $post->ID );
416
				foreach ( $terms as $term ) {
417
					if ( !empty( $term->name ) ) {
418
						$response[$key][$term->name] = $this->format_taxonomy( $term, 'post_tag', 'display' );
419
					}
420
				}
421
				$response[$key] = (object) $response[$key];
422
				break;
423
			case 'categories':

sal/class.json-api-post-base.php 1 location

@@ 71-75 (lines=5) @@
68
	public function get_tags() {
69
		$tags = array();
70
		$terms = wp_get_post_tags( $this->post->ID );
71
		foreach ( $terms as $term ) {
72
			if ( !empty( $term->name ) ) {
73
				$tags[$term->name] = $this->format_taxonomy( $term, 'post_tag', 'display' );
74
			}
75
		}
76
		return (object) $tags;
77
	}
78