[WordPress] 外掛分享: Redirect multisite user to their own site (UNMAINTAINED)

首頁外掛目錄 › Redirect multisite user to their own site (UNMAINTAINED)
WordPress 外掛 Redirect multisite user to their own site (UNMAINTAINED) 的封面圖片
10+
安裝啟用
★★★★★
5/5 分(1 則評價)
1224 天前
最後更新
問題解決
WordPress 4.5+ v1.1.2 上架:2016-09-29

內容簡介

這個外掛已經不再維護。

如果多站點環境中的當前使用者存取未被授權的子站點,則將使用者重新導向回他們自己的站點。如果使用者已被授權訪問多個網站,則無法重新導向(因為沒有辦法找出哪個網站是“正確的”)。

開發者資訊

開發者可以使用三個動作掛鉤來進行編寫記錄檔或在執行動作時通知電子郵件地址等操作。

redirect-multisite-user-to-their-own-site/no-sites當使用者已登錄但沒有在當前的多站點安裝中訪問任何網站時觸發。接收$current_user(WordPress使用者物件)和$current_site_id(整數)作為屬性。
redirect-multisite-user-to-their-own-site/redirecting在使用者重新導向到適當的網站之前立即觸發。接收$current_user(WordPress使用者物件)、$current_site_id(整數)和$user_target_site->siteurl(將重新導向使用者的網址)作為屬性。
redirect-multisite-user-to-their-own-site/not-allowed當使用者已授權訪問安裝中的多個網站,因此無法重新導向時觸發。接收$current_user(WordPress使用者物件)、$current_site_id(整數)和$user_sites(陣列)作為屬性。

此外掛需要 PHP 5.3 或更新版本,因為它使用了 PHP 命名空間。

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.1.2) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Redirect multisite user to their own site (UNMAINTAINED)」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

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-sites fires 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/redirecting fires 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-allowed fires 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.

延伸相關外掛

文章
Filter
Apply Filters
Mastodon