Code Duplication    Length = 6-6 lines in 2 locations

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

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

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() ) {