Code Duplication    Length = 3-3 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1265-1267 (lines=3) @@
1262
				return new WP_Error( 'unauthorized', 'User cannot edit taxonomy', 403 );
1263
			break;
1264
		case 'display' :
1265
			if ( -1 == get_option( 'blog_public' ) && ! current_user_can( 'read' ) ) {
1266
				return new WP_Error( 'unauthorized', 'User cannot view taxonomy', 403 );
1267
			}
1268
			break;
1269
		default :
1270
			return new WP_Error( 'invalid_context', 'Invalid API CONTEXT', 400 );

class.json-api.php 1 location

@@ 558-560 (lines=3) @@
555
			return new WP_Error( 'unauthorized', 'User cannot access this restricted blog', 403 );
556
		}
557
558
		if ( -1 == get_option( 'blog_public' ) && !current_user_can( 'read' ) ) {
559
			return new WP_Error( 'unauthorized', 'User cannot access this private blog.', 403 );
560
		}
561
562
		return $blog_id;
563
	}