From 71ea3edf971f70aa1354e31fada0e0e884fefd4a Mon Sep 17 00:00:00 2001 From: Mykhailo Los Date: Mon, 6 Jan 2025 13:18:07 +0200 Subject: [PATCH] [MOOSE-178]: Prevent 404 on any link if not authorized --- wp-content/plugins/core/src/Post_Types/Training/Config.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/wp-content/plugins/core/src/Post_Types/Training/Config.php b/wp-content/plugins/core/src/Post_Types/Training/Config.php index 5f94ac2b..b84ec23e 100644 --- a/wp-content/plugins/core/src/Post_Types/Training/Config.php +++ b/wp-content/plugins/core/src/Post_Types/Training/Config.php @@ -82,7 +82,7 @@ public function add_user_caps(): void { * if not, send and display 404. */ public function send_404_unauthorized(): void { - if ( is_post_type_viewable( $this->post_type ) ) { + if ( is_post_type_viewable( get_post_type() ) || get_post_type() !== Training::NAME ) { return; }