[WordPress] 外掛分享: Visibility Control for Sensei LMS

首頁外掛目錄 › Visibility Control for Sensei LMS
WordPress 外掛 Visibility Control for Sensei LMS 的封面圖片
20+
安裝啟用
尚無評分
189 天前
最後更新
問題解決
WordPress 4.0+ PHP 5.6+ v1.0 上架:2024-09-13

內容簡介

以下是有關「Visibility Control for Sensei」外掛的總結:

- 這款外掛可協助你隱藏特定準則下 WordPress 頁面的訊息和內容。
- 你可以基於以下條件顯示/隱藏 HTML 元素、選單和其他細節:
1. 使用者存取特定的 Sensei LMS 課程。
2. 使用者特定 Sensei LMS 課程的完成狀態。
3. 使用者的登入或登出狀態。
4. 使用者的身份角色。

根據以上內容製作一組問題與答案:
<html>
<ul>
<li>如何可以讓已登入的使用者看到特定的元素/選單項目?</li>
<p>將這個 CSS 類別加到元素/選單項目中:visible_to_logged_in</p>

<li>如何可以隱藏已登入的使用者所看不到的元素/選單項目?</li>
<p>將這個 CSS 類別加到元素/選單項目中:hidden_to_logged_in</p>

<li>為了讓只有管理員身份的使用者可以看到元素/選單項目,應該怎麼做?</li>
<p>加入這個 CSS 類別到元素/選單項目中:visible_to_role_administrator</p>

<li>如果課程 ID 是 123,如何可以讓有存取到該課程的使用者看到元素/選單項目?</li>
<p>加入這個 CSS 類別到元素/選單項目中:visible_to_course_123</p>

<li>如果要讓已完成課程 123 的使用者看到元素/選單項目,你應該怎麼做?</li>
<p>加入這個 CSS 類別到元素/選單項目中:visible_to_course_complete_123</p>
</ul>
</html>

外掛標籤

開發者團隊

⬇ 下載最新版 (v1.0) 或搜尋安裝

① 下載 ZIP → 後台「外掛 › 安裝外掛 › 上傳外掛」
② 後台搜尋「Visibility Control for Sensei LMS」→ 直接安裝(推薦)
📦 歷史版本下載

原文外掛簡介

Visibility Control for Sensei helps you hide messages and content for specific criterion anywhere on your WordPress page.
You can show/hide HTML elements, menus, and other details based on:
1. User’s access to a particular Sensei LMS Course,
2. User’s course completion status of a particular Sensei LMS Course, Or
3. User is Logged In or Logged Out.
4. User’s role.
You simply need to add a CSS class to your element div or span. As explained here:
Example:
Login/Logout Status:

To show the element/menu item to a logged-in user, add this CSS class: visible_to_logged_in OR hidden_to_logged_out
To hide the element/menu item from a logged-in user, add this CSS class: visible_to_logged_out OR hidden_to_logged_in

For user’s role:
* To show the element/menu item to a user will role administrator, add this CSS class: visible_to_role_administrator OR hidden_to_role_administrator
* Note: To show an element to multiple specific roles only, you need add the element multiple times, one for each role. To hide an element/menu from specific multiple roles only you can add the element once add multiple classes to the same element.
If Course ID is 123

To show the element/menu item to user with access to above Course, add this CSS class: visible_to_course_123
To hide the element/menu item from user with access to above Course, add this CSS class: hidden_to_course_123
To show the element/menu item to a logged-in user, add this CSS class: visible_to_logged_in OR hidden_to_logged_out
To hide the element/menu item from a logged-in user, add this CSS class: visible_to_logged_out OR hidden_to_logged_in

For a course completion status, if Course ID is 123:

To show the element/menu item to user who completed above course, add this CSS class: visible_to_course_complete_123
To hide the element/menu item from user who completed above course, add this CSS class: hidden_to_course_complete_123
To show the element/menu item to user who has not completed above course, add this CSS class: visible_to_course_incomplete_123
To hide the element/menu item from user who has not completed above course, add this CSS class: hidden_to_course_incomplete_123

Mechanism of Functioning

Multiple CSS Classes: If multiple visibility control classes are added, ALL of them must meet the criterion to keep the element visible. If any one of them hides the element, it will be hidden. For example: visible_to_course_123 visible_to_course_124 will show the element only to those who have access to both courses.
Hidden data/elements reaches the browser. Though user’s do not see it.
CSS is added to the page for all CSS elements that needs to be hidden based on above rules.
After page is loaded. These elements are removed from page using jQuery (if available), so it won’t be available on Inspect.
Elements rendered after the page load are hidden but not removed from DOM/page.

Future Development
Depending on the interest in this feature, we will decide on adding a shortcode and/or a Gutenberg Block to achieve this feature.
Other Visibility Control Plugins:
– Visibility Control for LearnDash LMS
– Visibility Control for WPCourseware LMS
– Visibility Control for LearnPress LMS
– Visibility Control for LifterLMS
– Visibility Control for TutorLMS
– Visibility Control for Sensei LMS
– Visibility Control for WooCommerce
Related Plugins for Sensei LMS:
– Experience API for Sensei LMS

延伸相關外掛

文章
Filter
Apply Filters
Mastodon