Code Duplication    Length = 3-3 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1079-1081 (lines=3) @@
1076
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
1077
		}
1078
1079
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
1080
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
1081
		}
1082
1083
		return true;
1084
	}

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

@@ 295-297 (lines=3) @@
292
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
293
		}
294
295
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
296
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
297
		}
298
299
		return true;
300
	}