前言介紹
- 這款 WordPress 外掛「Hide This」是 2013-10-12 上架。
- 目前有 3000 個安裝啟用數。
- 上一次更新是 2018-02-12,距離現在已有 2637 天。超過一年沒更新,安裝要確認版本是否可用。以及後續維護問題!
- 外掛最低要求 WordPress 3.0 以上版本才可以安裝。
- 有 49 人給過評分。
- 還沒有人在論壇上發問,可能目前使用數不多,還沒有什麼大問題。
外掛協作開發者
andrezrv |
外掛標籤
hide | role | user | content | capability |
內容簡介
Hide This 提供 [hide] 短碼,讓你可以隱藏文章和頁面的某些內容。你可以輕鬆管理隱藏內容的包含和排除方式,分為三個層次:絕對、群組和能力,以及指定用戶。
也許你的文章的某些部分還不應該發佈?或者你想向特定的群體或使用者展示內容的某些特定部分,比如登錄的使用者或你的客戶?這個外掛可能是你需要的解決方案。
非常重要的一點是,包含在短碼中的內容甚至不會作為 HTML 印出來,它真的是完全隱藏的。有許多偉大的外掛可以通過 CSS 和 JavaScript 隱藏內容,但這不是這個插件的情況。如果你希望你的內容不可見,但仍以 HTML 印出,你應該試試其中一個。
基本用法:
[hide]Lorem ipsum dolor sit amet.[/hide]
這個例子將隱藏該內容以適用於所有網站訪客。但是你可以通過使用屬性來做更具體的指定。
可接受的屬性:
- for:(可選)用於隱藏內容的規則。你可以使用絕對規則(all、none、[!]logged)、按角色和能力劃分的規則([!]{role}、[!]{role}:[!]{capability}、:[!]{capability})以及按特定用戶劃分的規則(userid:[!]{ID}、useremail:[!]{email}、username:[!]{username})。
- exclude:(可選)用於向特定訪客展示隱藏內容的規則。與 for 一樣,你可以使用絕對規則(all、none、[!]logged)、按角色和能力劃分的規則([!]{role}、[!]{role}:[!]{capability}、:[!]{capability})以及按特定用戶劃分的規則(userid:[!]{ID}、useremail:[!]{email}、username:[!]{username})。
- test:(可選)用於調試的目的。你所期望的輸出類型。接受 content 和 empty。輸出在測試結果上會顯示一條訊息,所以請明智使用。
一些有用的示例:
- 對所有訪客隱藏你的內容:
[hide]Lorem ipsum dolor sit amet.[/hide]
- 對所有訪客隱藏你的內容,除了特定的使用者:
[hide for="all" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]
- 對所有未登錄的訪客隱藏你的內容:
[hide for="!logged"]Lorem ipsum dolor sit amet.[/hide]
- 對所有已登錄的訪客隱藏你的內容:
[hide for="logged"]Lorem ipsum dolor sit amet.[/hide]
- 對所有已登錄的訪客隱藏你的內容,除了特定的使用者:
[hide for="logged" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]
- 隱藏你的內容對於某些特定角色:
[hide for="contributor"]Lorem ipsum dolor sit amet.[/hide]
- 隱藏你的內容對於兩個特定角色:
[hide for="editor, contributor"]Lorem ipsum dolor sit amet.[/hide]
- 對所有訪客隱藏你的內容,除了某個特定角色:
[hide for="!administrator"]Lorem ipsum dolor sit amet.[/hide]
[hide for="all" exclude="administrator"]Lorem ipsum dolor sit amet.[/hide]
- 對所有訪客隱藏你的內容,除了兩個特定角色:
[hide for="!administrator, !editor"]Lorem ipsum dolor sit amet.[/hide]
[hide for="all" exclude="administrator, editor"]Lorem ipsum dolor sit amet.[/hide]
隱藏你的內容對於使用哪些特定用戶,可以在屬性中使用「userid」、「useremail」和「username」。
注意,這裡的 Markdown 原始碼中可能使用了一些 HTML 標籤,請務必保留這些原始標籤。
原文外掛簡介
Hide This provides a [hide] shortcode that lets you hide some parts of the content from your posts and pages. You can easily manage inclusions and exclusions for hidden content in three levels: absolute, groups and capabilities, and specific user.
Maybe some part of your post should not be published yet? Or maybe you want to show some specific parts of your content to a certain group or users, let’s say your logged in users or your clients? This plugin may be the solution you need.
It’s very important to note that the content wrapped within the shortcode won’t even be printed as HTML. It will be really, really hidden. There are a lot of great plugins that hide the content via CSS and Javascript, but this is not the case. If you want your content to not be visible, but still printed as HTML, you should try one of those.
Basic usage:
[hide]Lorem ipsum dolor sit amet.[/hide]
This example will hide that content for all the site visitors. But you can be more specific by using attributes.
Accepted attributes:
for: (optional) your rules to hide content. You can use absolute rules (all, none, [!]logged), rules by roles and capabilities ([!]{role}, [!]{role}:[!]{capability}, :[!]{capability}), and rules by specific user (userid:[!]{ID}, useremail:[!]{email}, username:[!]{username}).
exclude: (optional) your rules to show the hidden content to some specific visitor/s. As in for, you can use absolute rules (all, none, [!]logged), rules by roles and capabilities ([!]{role}, [!]{role}:[!]{capability}, :[!]{capability}), and rules by specific user (userid:[!]{ID}, useremail:[!]{email}, username:[!]{username}).
test: (optional) for debugging purposes. The kind of output you expect. Accepts content and empty. Use it wisely, because it prints a message with the result of the test.
Some useful examples:
Hide your content to all visitors:
[hide]Lorem ipsum dolor sit amet.[/hide]
Hide your content to all visitors, except for a specific user:
[hide for="all" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]
Hide your content to all non-logged visitors:
[hide for="!logged"]Lorem ipsum dolor sit amet.[/hide]
Hide your content to all logged in visitors:
[hide for="logged"]Lorem ipsum dolor sit amet.[/hide]
Hide your content to all logged in visitors, except for a specific user:
[hide for="logged" exclude="username:foo"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for some specific role:
[hide for="contributor"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for two specific roles:
[hide for="editor, contributor"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for all visitors except for a specific role:
[hide for="!administrator"]Lorem ipsum dolor sit amet.[/hide]
[hide for="all" exclude="administrator"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for all visitors except for two specific roles:
[hide for="!administrator, !editor"]Lorem ipsum dolor sit amet.[/hide]
[hide for="all" exclude="administrator, editor"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for users with a specific role and a specific capability:
[hide for="some_role:do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for users with a specific role, not having a specific capability:
[hide for="some_role:!do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for users with a specific capability:
[hide for=":do_a_barrel_roll"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for a specific user by user name:
[hide for="username:foo"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for a specific user by user ID:
[hide for="userid:42"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for a specific user by user email:
[hide for="useremail:[email protected]"]Lorem ipsum dolor sit amet.[/hide]
Hide your content for everyone except for a specific user by user name:
[hide for="username:!foo"]Lorem ipsum dolor sit amet.[/hide]
You should get the idea by now. Notice how you can use ! to deny values such as login status, roles, capabilities and user values.
Extending
This plugin offers hooks for filters, so you can modify its functionality or add your own.
hide_this_attributes: Modify the attributes that the shortcode receives.
hide_this_content: Modify the full content that the shortcode prints.
hide_this_hide_rules: Modify rules for hiding content.
hide_this_show_rules: Modify rules for showing content.
Contribute
You can make suggestions and submit your own modifications to this plugin on Github.
各版本下載點
- 方法一:點下方版本號的連結下載 ZIP 檔案後,登入網站後台左側選單「外掛」的「安裝外掛」,然後選擇上方的「上傳外掛」,把下載回去的 ZIP 外掛打包檔案上傳上去安裝與啟用。
- 方法二:透過「安裝外掛」的畫面右方搜尋功能,搜尋外掛名稱「Hide This」來進行安裝。
(建議使用方法二,確保安裝的版本符合當前運作的 WordPress 環境。
1.0 | 1.1 | 1.1.1 | 1.1.2 | 1.1.3 | trunk |
延伸相關外掛(你可能也想知道)
WP Ghost (Hide My WP Ghost) – Security & Firewall 》Hide My WP Ghost 是一個 WordPress 安全外掛,透過強大且易於使用的功能,提供最佳的安全解決方案。它可以在不改變任何目錄或檔案的情況下,將網站的安全性...。
Email Encoder – Protect Email Addresses and Phone Numbers 》專門為電子郵件地址設計的全站保護外掛,可防止垃圾郵件機器人、電子郵件收割機和其他機器人攻擊。無需任何配置。, 此外,使用我們集成的[eeb_protect_conten...。
If Menu – Visibility control for Menus 》藉由可見度規則,您可以控制網站訪客看到哪些選單項目。以下是一些範例:, , 僅顯示選單項目,當 使用者已登入, 當裝置為行動裝置時,隱藏選單, 顯示選單 給...。
Dynamic Visibility for Elementor 》Dynamic Visibility 擴充套件讓您可以隱藏小工具、欄位、容器、區段或頁面。, 當您正在建立不想向所有人展示的內容時,這尤其有用。, 這是一個 Elementor 的...。
Hide/Remove Metadata 》Hide/Remove Metadata是一款免費、簡單而非常實用的WordPress外掛,能夠幫助您輕鬆地隱藏或刪除網站上的作者和發布日期。該外掛非常容易使用,僅提供隱藏或移...。
Hide Admin Bar 》這個 WordPress 外掛可以隱藏 WordPress 3.1+ 的管理員工具列,感謝 Yoast 和 Pete Mall 的貢獻。如果你喜歡這個外掛,可以考慮請買我一杯咖啡。。
WordPress Hide Posts 》這個外掛可以讓你隱藏首頁、分類頁、搜索頁、標籤頁、作者頁、RSS Feed、REST API、文章導覽和原生最近文章小工具的任何文章。, 試試看 Demo, 功能:, , 使用...。
Hide My Site 》選擇一個密碼以保護整個 WordPress 網站,只有知道此密碼的訪客才能存取您的 WordPress 網站。這是一個完美的工具,適合建立 WordPress 網站開發版本或者任何...。
Hide Featured Image 》有些情況下,我們可能想在某個單獨的文章頁面上顯示特色圖片,但另一些文章頁面則不想顯示。, 這個外掛可以讓您在單獨的文章頁面上顯示或隱藏特色圖片,同時...。
WP-ShowHide 》預設情況下,內容是隱藏的,使用者必須點擊「顯示內容」連結來切換內容。與 Engadget 為他們的新聞稿所做的方式相似。範例用法:[showhide type="pressreleas...。
WP Mailto Links – Protect Email Addresses 》這個外掛可以安全地保護和編碼電子郵件地址,以防止垃圾郵件機器人、亂發郵件和其他機器人。此外,它很容易使用,不需要進行任何配置即可使用。, 功能, , 全...。
WP Hide Post 》這個外掛強在幫助你完全控制文章的顯示方式。在 WordPress 網誌上,一般加入的文章會顯示在首頁中,通常是第一篇位置,也會同樣顯示在分類、標籤、存檔頁面等...。
Hide Shipping Method For WooCommerce 》s offering “Free Shipping” and “Local Pickup” on the cart page. With the Hide Shipping Method for WooCommerce plugin, you can hide all other shippi...。
Hide Categories and Products for Woocommerce 》這個外掛可以讓你隱藏選定的類別上的店鋪產品,並隱藏類別本身,無論是在列表還是單獨頁面中。, 它可以與 Storefront(主題)短代碼兼容。, 使用方式, , 前往...。
Disable Media Pages 》這個 WordPress 外掛完全停用「附件」頁面。, 預設情況下,WordPress 會為每個附件建立一個頁面。這可能會有兩個不利因素:, 搜尋引擎優化, 附件頁面除了一張...。