Code Duplication    Length = 3-3 lines in 2 locations

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

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

class.json-api-endpoints.php 1 location

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