Code Duplication    Length = 6-6 lines in 2 locations

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

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

class.json-api-endpoints.php 1 location

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