Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 251-256 (lines=6) @@
248
			return false;
249
		}
250
251
		if ( 'inherit' === $post->post_status ) {
252
			$parent_post = get_post( $post->post_parent );
253
			$post_status_obj = get_post_status_object( $parent_post->post_status );
254
		} else {
255
			$post_status_obj = get_post_status_object( $post->post_status );
256
		}
257
258
		$authorized = (
259
			$post_status_obj->public ||

class.json-api-endpoints.php 1 location

@@ 1029-1034 (lines=6) @@
1026
			return false;
1027
		}
1028
1029
		if ( 'inherit' === $post->post_status ) {
1030
			$parent_post = get_post( $post->post_parent );
1031
			$post_status_obj = get_post_status_object( $parent_post->post_status );
1032
		} else {
1033
			$post_status_obj = get_post_status_object( $post->post_status );
1034
		}
1035
1036
		if ( !$post_status_obj->public ) {
1037
			if ( is_user_logged_in() ) {