Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 37-39 (lines=3) @@
34
		}
35
36
		$user = wp_get_current_user();
37
		if ( !$user || is_wp_error( $user ) || !$user->ID ) {
38
			return new WP_Error( 'authorization_required', 'An active access token must be used to manage taxonomies.', 403 );
39
		}
40
41
		$tax = get_taxonomy( $taxonomy_type );
42
		if ( !current_user_can( $tax->cap->edit_terms ) ) {

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

@@ 18-20 (lines=3) @@
15
		}
16
17
		$user = wp_get_current_user();
18
		if ( ! $user || is_wp_error( $user ) || ! $user->ID ) {
19
			return new WP_Error( 'authorization_required', 'An active access token must be used to manage taxonomies.', 403 );
20
		}
21
22
		$taxonomy_meta = get_taxonomy( $taxonomy );
23
		if ( false === $taxonomy_meta || (