Code Duplication    Length = 3-3 lines in 2 locations

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

@@ 267-269 (lines=3) @@
264
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
265
		}
266
267
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
268
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
269
		}
270
271
		return true;
272
	}

class.json-api-endpoints.php 1 location

@@ 1045-1047 (lines=3) @@
1042
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
1043
		}
1044
1045
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
1046
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
1047
		}
1048
1049
		return true;
1050
	}