Code Duplication    Length = 6-6 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1045-1050 (lines=6) @@
1042
			return false;
1043
		}
1044
1045
		if ( 'inherit' === $post->post_status ) {
1046
			$parent_post = get_post( $post->post_parent );
1047
			$post_status_obj = get_post_status_object( $parent_post->post_status );
1048
		} else {
1049
			$post_status_obj = get_post_status_object( $post->post_status );
1050
		}
1051
1052
		if ( !$post_status_obj->public ) {
1053
			if ( is_user_logged_in() ) {

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

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