Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 197-199 (lines=3) @@
194
		}
195
196
		$user = wp_get_current_user();
197
		if ( !$user || is_wp_error( $user ) || !$user->ID ) {
198
			return new WP_Error( 'authorization_required', 'An active access token must be used to manage taxonomies.', 403 );
199
		}
200
201
		$tax = get_taxonomy( $taxonomy_type );
202
		if ( !current_user_can( $tax->cap->edit_terms ) ) {

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

@@ 95-97 (lines=3) @@
92
		}
93
94
		$user = wp_get_current_user();
95
		if ( ! $user || is_wp_error( $user ) || ! $user->ID ) {
96
			return new WP_Error( 'authorization_required', 'An active access token must be used to manage taxonomies.', 403 );
97
		}
98
99
		$taxonomy_meta = get_taxonomy( $taxonomy );
100
		if ( false === $taxonomy_meta || (