server/content/plugins/redirect-chat.php
Ryan McCue a68db46674
Move chat redirect to a non-mu-plugin (#20)
Signed-off-by: Ryan McCue <me@ryanmccue.info>
2025-07-31 15:12:43 -05:00

23 lines
595 B
PHP

<?php
/**
* Plugin Name: FAIR Server - Redirect to Slack Registration
*
* To Do: Make this a more generic redirect to the Slack registration page.
*/
add_action( 'template_redirect', function() {
// Logged in users can see the site.
if ( is_user_logged_in() ) {
return;
}
// Also, allow access to login and admin, even for non-logged-in users.
// (Admin allows the redirect to the login page.)
if ( is_admin() || is_login() ) {
return;
}
// Redirect to Slack.
wp_redirect( 'https://join.slack.com/t/fair/shared_invite/zt-38pl25a7p-Zyykxt~bVyv6WZA6i47wMw', 302 );
exit;
} );