Code Duplication    Length = 3-3 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1097-1099 (lines=3) @@
1094
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
1095
		}
1096
1097
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
1098
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
1099
		}
1100
1101
		return true;
1102
	}

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

@@ 315-317 (lines=3) @@
312
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
313
		}
314
315
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
316
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
317
		}
318
319
		return true;
320
	}