Code Duplication    Length = 4-4 lines in 2 locations

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

@@ 38-41 (lines=4) @@
35
		}
36
37
		$taxonomy_meta = get_taxonomy( $taxonomy );
38
		if ( false === $taxonomy_meta || ( ! $taxonomy_meta->public && 
39
				! current_user_can( $taxonomy_meta->cap->assign_terms ) ) ) {
40
			return new WP_Error( 'invalid_taxonomy', 'The taxonomy does not exist', 400 );
41
		}
42
43
		$args = $this->query_args();
44
		$term = $this->get_taxonomy( $slug, $taxonomy, $args['context'] );

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

@@ 47-50 (lines=4) @@
44
		}
45
46
		$taxonomy_meta = get_taxonomy( $taxonomy );
47
		if ( false === $taxonomy_meta || ( ! $taxonomy_meta->public && 
48
				! current_user_can( $taxonomy_meta->cap->assign_terms ) ) ) {
49
			return new WP_Error( 'invalid_taxonomy', 'The taxonomy does not exist', 400 );
50
		}
51
52
		$args = $this->query_args();
53
		$args = $this->process_args( $args );