Code Duplication    Length = 3-3 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1090-1092 (lines=3) @@
1087
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
1088
		}
1089
1090
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
1091
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
1092
		}
1093
1094
		return true;
1095
	}

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

@@ 309-311 (lines=3) @@
306
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
307
		}
308
309
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
310
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
311
		}
312
313
		return true;
314
	}