Code Duplication    Length = 6-6 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 980-985 (lines=6) @@
977
			return false;
978
		}
979
980
		if ( 'inherit' === $post->post_status ) {
981
			$parent_post = get_post( $post->post_parent );
982
			$post_status_obj = get_post_status_object( $parent_post->post_status );
983
		} else {
984
			$post_status_obj = get_post_status_object( $post->post_status );
985
		}
986
987
		if ( !$post_status_obj->public ) {
988
			if ( is_user_logged_in() ) {

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

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