Code Duplication    Length = 6-6 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 993-998 (lines=6) @@
990
			return false;
991
		}
992
993
		if ( 'inherit' === $post->post_status ) {
994
			$parent_post = get_post( $post->post_parent );
995
			$post_status_obj = get_post_status_object( $parent_post->post_status );
996
		} else {
997
			$post_status_obj = get_post_status_object( $post->post_status );
998
		}
999
1000
		if ( !$post_status_obj->public ) {
1001
			if ( is_user_logged_in() ) {

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

@@ 227-232 (lines=6) @@
224
			return false;
225
		}
226
227
		if ( 'inherit' === $post->post_status ) {
228
			$parent_post = get_post( $post->post_parent );
229
			$post_status_obj = get_post_status_object( $parent_post->post_status );
230
		} else {
231
			$post_status_obj = get_post_status_object( $post->post_status );
232
		}
233
234
		$authorized = (
235
			$post_status_obj->public ||