Code Duplication    Length = 6-6 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1062-1067 (lines=6) @@
1059
			return false;
1060
		}
1061
1062
		if ( 'inherit' === $post->post_status ) {
1063
			$parent_post     = get_post( $post->post_parent );
1064
			$post_status_obj = get_post_status_object( $parent_post->post_status );
1065
		} else {
1066
			$post_status_obj = get_post_status_object( $post->post_status );
1067
		}
1068
1069
		if ( ! $post_status_obj->public ) {
1070
			if ( is_user_logged_in() ) {

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

@@ 275-280 (lines=6) @@
272
			return false;
273
		}
274
275
		if ( 'inherit' === $post->post_status ) {
276
			$parent_post = get_post( $post->post_parent );
277
			$post_status_obj = get_post_status_object( $parent_post->post_status );
278
		} else {
279
			$post_status_obj = get_post_status_object( $post->post_status );
280
		}
281
282
		$authorized = (
283
			$post_status_obj->public ||