
內容簡介
此外掛會在 /login/ 建立一個登入頁面,負責管理密碼恢復和使用者通知回饋的登入流程。所有東西都在您的 page.php 模板或 page-login.php 模板中管理,以便更好地適應主題。
預設情況下,此外掛會建立虛擬頁面,但若您新增一個標題為「login」的頁面,此外掛即會開始使用該頁面。
為已登入的使用者新增重新導向功能
控制使用者登入或造訪 /login/ 頁面時要前往何處。您可以回傳文章或頁面的 post_id 或 slug。
// 透過 post_id 重新導向
add_filter( 'sewn/login/logged_in_redirect', 'custom_sewn_logged_in_redirect_id' );
function custom_sewn_logged_in_redirect_id()
{
return 4;
}
// 透過 slug 重新導向
add_filter( 'sewn/login/logged_in_redirect', 'custom_sewn_logged_in_redirect_slug' );
function custom_sewn_logged_in_redirect_slug()
{
return 'post-slug';
}
支援 Sewn In Notification Box
如果您安裝了 Sewn In Notification Box,此外掛就會開始使用該外掛。這能夠讓所有通知集中在一個地方,非常方便。
外掛標籤
開發者團隊
原文外掛簡介
Creates a log in page at /login/ and manages password recovery and user notification feedback for the log in process. Everything gets managed within your page.php template or page-login.php template in order to fit into the theme better.
By default, this plugin creates a virtual page, but if you add a page with slug ‘login’, the plugin will begin to use that.
Add a redirect for logged in users
Controls where logged in users go when they login or when they visit the ‘/login/’ page. You can either return the post_id of the post/page to send them to, or the slug of the post/page to send them to.
// Redirect using post id
add_filter( 'sewn/login/logged_in_redirect', 'custom_sewn_logged_in_redirect_id' );
function custom_sewn_logged_in_redirect_id()
{
return 4;
}
// Redirect using post slug
add_filter( 'sewn/login/logged_in_redirect', 'custom_sewn_logged_in_redirect_slug' );
function custom_sewn_logged_in_redirect_slug()
{
return 'post-slug';
}
Sewn In Notification Box Support
If you install the Sewn In Notification Box, this plugin will start using that. This is handy to keep all of your notifications in a centralized location.
