Code Duplication    Length = 6-6 lines in 2 locations

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

@@ 231-236 (lines=6) @@
228
			return false;
229
		}
230
231
		if ( 'inherit' === $post->post_status ) {
232
			$parent_post = get_post( $post->post_parent );
233
			$post_status_obj = get_post_status_object( $parent_post->post_status );
234
		} else {
235
			$post_status_obj = get_post_status_object( $post->post_status );
236
		}
237
238
		$authorized = (
239
			$post_status_obj->public ||

class.json-api-endpoints.php 1 location

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