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

@@ 1021-1026 (lines=6) @@
1018
			return false;
1019
		}
1020
1021
		if ( 'inherit' === $post->post_status ) {
1022
			$parent_post = get_post( $post->post_parent );
1023
			$post_status_obj = get_post_status_object( $parent_post->post_status );
1024
		} else {
1025
			$post_status_obj = get_post_status_object( $post->post_status );
1026
		}
1027
1028
		if ( !$post_status_obj->public ) {
1029
			if ( is_user_logged_in() ) {