From a7b2976847b225c7a8b870fcbd82e9d126c62986 Mon Sep 17 00:00:00 2001 From: Brian Miyaji Date: Thu, 27 Aug 2020 23:11:02 +1000 Subject: [PATCH] No need to check post type allowed if SP Event --- includes/api/class-sp-rest-posts-controller.php | 5 ----- 1 file changed, 5 deletions(-) diff --git a/includes/api/class-sp-rest-posts-controller.php b/includes/api/class-sp-rest-posts-controller.php index 617e1c25..754c86d5 100644 --- a/includes/api/class-sp-rest-posts-controller.php +++ b/includes/api/class-sp-rest-posts-controller.php @@ -8,11 +8,6 @@ if ( class_exists( 'WP_REST_Posts_Controller' ) ) { } public function check_read_permission( $post ) { - $post_type = get_post_type_object( $post->post_type ); - if ( ! $this->check_is_post_type_allowed( $post_type ) ) { - return false; - } - if ( 'sp_event' === $post->post_type ) { if ( in_array( $post->post_status, array( 'publish', 'future' ) ) || current_user_can( 'read_post', $post->ID ) ) { return true;