Created
January 26, 2026 21:29
-
-
Save hivepress/4a91ba345db777f518e87fdafa64fd6f to your computer and use it in GitHub Desktop.
Hide the request pages from non-registered users (redirect to login form) #hivepress #requests
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| add_action( | |
| 'template_redirect', | |
| function() { | |
| if ( ! is_user_logged_in() && in_array( hivepress()->router->get_current_route_name(), [ 'request_view_page', 'requests_view_page' ] ) ) { | |
| wp_safe_redirect( hivepress()->router->get_return_url( 'user_login_page' ) ); | |
| exit; | |
| } | |
| } | |
| ); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment