內容簡介
我創建了這個 WordPress 外掛,因為它對我來說非常有用,我希望它對他人也有用,但它可能會破壞某些東西。請謹慎使用,風險自負。如果您發現錯誤,請與我聯繫,或者更好的是在 GitHub 幫助修復。
登錄過程
Passwordless 允許您的網站用戶僅使用他們的電子郵件地址登錄。在填寫電子郵件地址的登錄表單後,用戶將收到一封包含登錄鏈接的電子郵件,該鏈接僅可使用一次。 點擊鏈接將導致用戶登錄一年或直到他退出。未使用的登錄鏈接在一天後過期。
新用戶
當新用戶嘗試首次登錄時,將自動為他們創建帳戶。在這種情況下,他們的電子郵件也將充當用戶名。他們的可見名稱將設置為“匿名”,但在個人資料頁面上可以進行更改。
登錄頁面
插件將登錄頁面 URI 從默認的 example.com/wp-login.php 更改為 example.com/login。如果禁用永久連接,則登錄頁面將為 example.com/?login。
可以使用某些相同的過濾器和行動勾子來自定義該頁面。如果需要對該頁面進行全面改造,可以將 login.php 模板文件放在當前的活動主題目錄中,以覆蓋插件的登錄頁面。
過濾器
我包含了一些新的過濾器勾子,以輕松更改插件內部工作方面的重要內容。
passwordless_login_page 適用於登錄頁面 URI。過濾函數參數:包含登錄頁面 URI 的字符串。 passwordless_pass_length 適用於生成的密碼/密鑰的長度。過濾函數參數:表示字符數的整數。 passwordless_key_expire 適用於登錄密鑰有效的秒數。過濾函數參數:整數秒數。 passwordless_login_redirect 適用於登錄後將用戶發送到的 URI。過濾函數參數:字串 URI,整數用戶 ID。 passwordless_email_subject 適用於發送給登錄用戶的郵件主題。過濾函數參數:字串 email 主題,字串 email 地址。 passwordless_email_body 適用於發送給登錄用戶的郵件正文。過濾函數參數:字串 email 正文,字串 email 地址。
外掛標籤
開發者團隊
原文外掛簡介
I have created this plugin because it is of great use to me and I hope it will be of use to others but it might break things. Please use it with caution and at your own risk. If you find bugs please get in touch with me or better yet help fix it on GitHub.
Login process
Passwordless allows your site’s users to log in using only their email addresses. After submitting the login form with the email address filled in, the user will receive an email containing a login link which can only be used once. Clicking that link results in the user getting logged in for one year or until he logs out. Unused login links expire after one day.
New users
New users will have accounts created for them automatically when they try to log in for the first time. In this case their email will also act as the username. Their visible name will be set to ‘Annonymous’ but can obviously be changed on the profile page.
Login page
The plugin changes the login page URI to example.com/login from the default example.com/wp-login.php. If permalinks are disabled the login page will instead be example.com/?login.
The page can be customized using some of the same filters and action hooks that the original login page used. If a total overhaul of the page is desired, placing a login.php template file in the currently active theme directory will override the plugin’s login page.
Filters
I have included some new filter hooks to make it easy to change important aspects of the plugin’s inner workings.
passwordless_login_page applied to the login page URI. Filter function argument: string containing the login page URI. passwordless_pass_length applied to the length of the generated passwords/keys. Filter function argument: integer representing the number of characters. passwordless_key_expire applied to the number of seconds a login key is valid for. Filter function argument: integer number of seconds. passwordless_login_redirect applied to the URI where a user is sent after logging in. Filter function arguments: string URI, integer user id. passwordless_email_subject applied to the subject of the email that gets sent to users logging in. Filter function arguments: string email subject, string email address. passwordless_email_body applied to the body of the email that gets sent to users logging in. Filter function arguments: string email body, string email address.
