[WordPress] 外掛分享: Nav Menu Roles

首頁外掛目錄 › Nav Menu Roles
WordPress 外掛 Nav Menu Roles 的封面圖片
80,000+
安裝啟用
★★★★
4.9/5 分(218 則評價)
599 天前
最後更新
問題解決
WordPress 4.5.0+ PHP 5.3.2+ v2.1.2 上架:2012-09-19

內容簡介

這個外掛可以根據使用者角色隱藏自訂選單項目。例如,如果您只想把選單中某個連結顯示給已登入的使用者、特定類型的使用者,或者甚至只顯示給未登入的使用者,這個外掛就非常適合您。

Nav Menu Roles 非常靈活。除了標準的使用者角色以外,您可以透過新增帶有自訂標籤的核取方塊 (check boxes) 使用 `nav_menu_roles` filter 自訂功能,然後使用 `nav_menu_roles_item_visibility` filter 檢查您需要的任何條件。這可以檢查任何使用者的 meta 值(例如能力)以及其他外掛新增的任何自訂屬性。

重要提示

在 WordPress 中,選單項目和頁面是完全獨立的實體。Nav Menu Roles 不會限制存取內容。Nav Menu Roles 只用於顯示/隱藏導覽選單項目。如果您想要限制內容,您需要使用會員資格外掛。

使用方式

前往外觀 > 選單
將「顯示模式」設定為「已登入的使用者」、「登出使用者」或「所有人」。預設為「所有人」。
如果您想要按角色自訂,將「顯示模式」設定為「已登入的使用者」,然後在「將選單項目限制為最少的角色」下勾選要求的角色旁邊的方塊。請記住,這個角色並不嚴格限制項目僅允許這個角色使用,而是允許擁有此角色能力的所有人都可以使用項目。例如:設定為「訂閱者」的項目將由訂閱者和管理員訪問。請將其視為檢視項目所需的最小角色。

支援

支援服務在 WordPress 論壇中進行。請注意,支援服務有限,不包含任何自訂外掛實作。在發佈問題前,請閱讀 FAQ。同時,請驗證特定問題是否在停用其他外掛及使用預設主題時仍然存在。

如果發現任何錯誤、警告、程式碼問題,請向 Github 報告。

外掛標籤

開發者團隊

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

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Nav Menu Roles」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

This plugin lets you hide custom menu items based on user roles. So if you have a link in the menu that you only want to show to logged in users, certain types of users, or even only to logged out users, this plugin is for you.
Nav Menu Roles is very flexible. In addition to standard user roles, you can customize the functionality by adding your own check boxes with custom labels using the nav_menu_roles filter and then using the nav_menu_roles_item_visibility filter to check against whatever criteria you need. You can check against any user meta values (like capabilities) and any custom attributes added by other plugins.
IMPORTANT NOTE
In WordPress menu items and pages are completely separate entities. Nav Menu Roles does not restrict access to content. Nav Menu Roles is only for showing/hiding nav menu items. If you wish to restrict content then you need to also be using a membership plugin.
Usage

Go to Appearance > Menus
Set the “Display Mode” to either “logged in users”, “logged out users”, or “everyone”. “Everyone” is the default.
If you wish to customize by role, set the “Display Mode” to “Logged In Users” and under “Restrict menu item to a minimum role” check the boxes next to the desired roles. Keep in mind that the role doesn’t limit the item strictly to that role, but to everyone who has that role’s capability. For example: an item set to “Subscriber” will be visible by Subscribers and by admins. Think of this more as a minimum role required to see an item.

Support
Support is handled in the WordPress forums. Please note that support is limited and does not cover any custom implementation of the plugin. Before posting, please read the FAQ. Also, please verify the problem with other plugins disabled and while using a default theme.
Please report any bugs, errors, warnings, code problems to Github

延伸相關外掛

文章
Filter
Apply Filters
Mastodon