Skip to content

Commit

Permalink
[MOOSE-178]: Prevent 404 on any link if not authorized
Browse files Browse the repository at this point in the history
  • Loading branch information
MlKilderkin committed Jan 6, 2025
1 parent 1057023 commit 71ea3ed
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion wp-content/plugins/core/src/Post_Types/Training/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}

Expand Down

0 comments on commit 71ea3ed

Please sign in to comment.