Log Out Shortcode

外掛說明

There are 3 shortcodes that can be used:

[logout] - A standard Log Out link, where the user stays on the login screen after being logged out.
[logout_to_home] - A link that logs the user out, and redirects them to your home page.
[logout_to_current] - A link that logs the user out, and redirects them back to the current page/URL.

Advanced Usage:

All 3 shortcodes all support 3 attributes/parameters:

[logout text="" class="" redirect=""]

The 3 supported attributes/parameters are:

text=""

– The text to use for the link anchor text.
– Default: Log Out
class=””
– The HTML class(es) to use for the link. Multiple classes should be separated by a space.
– Default: logout
redirect=””
– The path/URL to redirect the user to after they are logged out.
– Default: the WordPress login screen.
– Note: must be a URL or path on the same domain name as the WordPress website (cannot be an external domain/URL)

Some Examples:
[logout text=”Log Off”] – A Log Off link that logs the user out.
[logout redirect=”/members/”] – Log the user out, and redirect them to /members/.
[logout_to_home text=”Log Off”] – A Log Off link that logs the user out and redirects them to your home page.
[logout class=”log-out-link”] – Use a custom CSS/HTML class name for the log out link.

Note: the shortcodes will return nothing/empty if the user isn’t logged in.

This plugin is inspired by the Logout Button plugin by Ben Poland.

If you like, you can contribute to this plugin on GitHub.

安裝方式

  1. Activate the plugin.
  2. Add one of the shortcodes to a post/page.

常見問題集

What shortcodes can be used?

Please see the plugin description for a list of shortcodes and supported parameters.

使用者評論

2017 年 11 月 22 日
Using in conjunction with Registration Magic and Hide This. Works great to give me complete control of displaying login/logout links.
2017 年 11 月 11 日
Cannot find the words to thanks you for this plugin, I spend almost 5 hours looking for a way to customize and redirect the logout URL, all other plugins care only about registration and they dont consider the logout button Thanks alot
閱讀全部 10 則使用者評論

參與者及開發者

以下人員參與了開源軟體〈Log Out Shortcode〉的開發相關工作。

參與者

將 Log Out Shortcode 外掛本地化為台灣繁體中文版

對開發相關資訊感興趣?

任何人均可瀏覽程式碼、查看 SVN 存放庫,或透過 RSS 訂閱開發記錄

變更記錄

1.0.6

  • Mark WP 5.2 compatible

1.0.5

  • Fix a bug that meant it was not possible to use specify multiple classes in the class=”” attribute. Thanks to @hughc for the bug report.

1.0.4

  • WordPress 4.4 compatibility.
  • Documentation updates.

1.0.3

  • Clarify usage of the redirect=”” parameter.
  • WordPress 4.1 compatibility.

1.0.2

  • WordPress 4.0 compatibility.

1.0.1

  • WordPress 3.9.2 compatibility.
  • Add [logout] shortcode to plugin description.

1.0

  • Initial release.