
內容簡介
**概要:**
Visibility Control for MasterStudy 可讓您在 WordPress 頁面的任何地方根據特定標準隱藏訊息和內容。您可以根據以下條件來顯示/隱藏 HTML 元素、選單和其他詳細資料:
1. 用戶對特定 MasterStudy LMS 課程的存取權限,
2. 用戶對特定 MasterStudy LMS 課程的完成狀態,或
3. 用戶是否登入或登出。
4. 用戶角色。
**問題與答案:**
1. 如何在網頁顯示元素/選單給已登錄用戶?
- 加入 `visible_to_logged_in` CSS 類別。
2. 如何在網頁隱藏元素/選單給已登錄用戶?
- 加入 `hidden_to_logged_out` CSS 類別。
3. 若要顯示元素/選單給系統管理員角色用戶,應加入哪個 CSS 類別?
- 加入 `visible_to_role_administrator` 或 `hidden_to_role_administrator` CSS 類別。
4. 如果 Course ID 是 123,要顯示元素/選單給有此課程存取權限的用戶,應加入哪個 CSS 類別?
- 加入 `visible_to_course_123` CSS 類別。
5. 什麼樣的 CSS 類別可以控制網頁上元素/選單的顯示給已完成特定課程的用戶?
- `visible_to_course_complete_123` 可顯示給已完成課程的用戶。
6. 當多個可見性控制 CSS 類別被加入時,系統如何判斷是否顯示元素?
- 所有 CSS 類別都必須符合標準才能保持元素可見。
7. 未來可能會在 Visibility Control for MasterStudy 中添加哪些功能?
- 考慮增加縮短代碼和/或 GutenBurg Block 功能。
該外掛的作用機制為:
- 如果使用多個 CSS 類別,所有標準必須符合,才會顯示元素。
- 隱藏的數據/元素會傳達到瀏覽器,但用戶無法看到。
- 根據上述規則,將 CSS 添加到頁面上的所有需隱藏的元素。
- 頁面加載後,使用 jQuery(如果可用)從頁面上刪除這些元素,以使其無法在檢查中顯示。
- 在頁面加載後呈現的元素將被隱藏,但不從 DOM/頁面中刪除。
外掛標籤
開發者團隊
② 後台搜尋「Visibility Control for MasterStudy」→ 直接安裝(推薦)
原文外掛簡介
Visibility Control for MasterStudy 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 MasterStudy LMS Course,
2. User’s course completion status of a particular MasterStudy 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 WP Courseware 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 MasterStudy LMS:
– Experience API for MasterStudy LMS
