Redirect multisite user to their own site (UNMAINTAINED)
·
Redirect a multisite user to their own site.
Rating
5/5
Version
1.1.2
Active installations
10
Last updated
Nov 11, 2022
THIS PLUGIN IS NO LONGER MAINTAINED.
If the current user in a multisite environment accesses a subsite to which access has not been granted, then redirect the user back to their own site. If the user has been granted access to more than one site in the Multisite installation, then no redirect can occur. (Because there is no way of finding out which one is “correct”.)
Information for developers
There are three action hooks available to developers. You can use them, for example, to write a log file or notify an email address when an action is carried out.
redirect-multisite-user-to-their-own-site/no-sitesfires when the user is logged in but does not have specific access to any sites in the current Multisite installation. Receives the values$current_user(WordPress User object) and$current_site_id(integer) as attributes.redirect-multisite-user-to-their-own-site/redirectingfires immediately before the user is redirected to the appropriate site. Receives the values$current_user(WordPress User object),$current_site_id(integer) and$user_target_site->siteurl(the URL to which the user will be redirected) as attributes.redirect-multisite-user-to-their-own-site/not-allowedfires when the user has authorized access to more than one site in the installation, and can therefore not be redirected. Receives the values$current_user(WordPress User object),$current_site_id(integer) and$user_sites(array) as attributes.
This plugin requires PHP 5.3 or newer because it uses PHP namespaces.
This plugin is available for download for your site.
