Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 194-199 (lines=6) @@
191
			return false;
192
		}
193
194
		if ( 'inherit' === $post->post_status ) {
195
			$parent_post = get_post( $post->post_parent );
196
			$post_status_obj = get_post_status_object( $parent_post->post_status );
197
		} else {
198
			$post_status_obj = get_post_status_object( $post->post_status );
199
		}
200
201
		$authorized = (
202
			$post_status_obj->public ||

class.json-api-endpoints.php 1 location

@@ 946-951 (lines=6) @@
943
			return false;
944
		}
945
946
		if ( 'inherit' === $post->post_status ) {
947
			$parent_post = get_post( $post->post_parent );
948
			$post_status_obj = get_post_status_object( $parent_post->post_status );
949
		} else {
950
			$post_status_obj = get_post_status_object( $post->post_status );
951
		}
952
953
		if ( !$post_status_obj->public ) {
954
			if ( is_user_logged_in() ) {