Code Duplication    Length = 6-6 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 939-944 (lines=6) @@
936
			return false;
937
		}
938
939
		if ( 'inherit' === $post->post_status ) {
940
			$parent_post = get_post( $post->post_parent );
941
			$post_status_obj = get_post_status_object( $parent_post->post_status );
942
		} else {
943
			$post_status_obj = get_post_status_object( $post->post_status );
944
		}
945
946
		if ( !$post_status_obj->public ) {
947
			if ( is_user_logged_in() ) {

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

@@ 187-192 (lines=6) @@
184
			return false;
185
		}
186
187
		if ( 'inherit' === $post->post_status ) {
188
			$parent_post = get_post( $post->post_parent );
189
			$post_status_obj = get_post_status_object( $parent_post->post_status );
190
		} else {
191
			$post_status_obj = get_post_status_object( $post->post_status );
192
		}
193
194
		$authorized = (
195
			$post_status_obj->public ||