Code Duplication    Length = 3-3 lines in 2 locations

class.json-api-endpoints.php 1 location

@@ 1127-1129 (lines=3) @@
1124
			);
1125
		}
1126
1127
		if ( strlen( $post->post_password ) && ! current_user_can( 'edit_post', $post->ID ) ) {
1128
			return new WP_Error(
1129
				'unauthorized',
1130
				'User cannot view password protected post',
1131
				array(
1132
					'status_code' => 403,

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

@@ 329-331 (lines=3) @@
326
			return new WP_Error( 'unauthorized', 'User cannot view post', array( 'status_code' => 403, 'error' => 'private_blog' ) );
327
		}
328
329
		if ( strlen( $post->post_password ) && !current_user_can( 'edit_post', $post->ID ) ) {
330
			return new WP_Error( 'unauthorized', 'User cannot view password protected post', array( 'status_code' => 403, 'error' => 'password_protected' ) );
331
		}
332
333
		return true;
334
	}