
內容簡介
以下是關於「Visibility Control for TutorLMS」的總結:
- 這個外掛幫助您在 WordPress 頁面上隱藏特定標準下的消息和內容。
- 您可以基於以下條件來顯示/隱藏 HTML 元素、菜單和其他詳細資料:
1. 用戶對特定的 Tutor LMS 課程的訪問權限,
2. 用戶對特定的 Tutor LMS 課程的完成狀態, 或
3. 用戶是否登入或登出,
4. 用戶的角色。
- 您只需為元素 div 或 span 添加一個 CSS 類別,如下所述。
基於上述內容,以下是一組問題和答案:
1. 如何可以根據用戶的登入狀態在菜單項目上進行顯示/隱藏?
- 若要顯示元素/菜單項目給已登入的用戶,請添加以下 CSS 類別:visible_to_logged_in
- 若要隱藏元素/菜單項目給已登入的用戶,請添加以下 CSS 類別:hidden_to_logged_in
2. 如何根據用戶的角色在頁面上顯示/隱藏特定內容?
- 若要向管理員角色用戶顯示元素/菜單項目,請新增以下 CSS 類別:visible_to_role_administrator
3. 如何根據課程 ID 為 123 來控制某個元素的顯示?
- 若要向能訪問上述課程的用戶顯示元素/菜單項目,新增以下 CSS 類別:visible_to_course_123
希望以上幫助您理解「Visibility Control for TutorLMS」外掛的主要功能和運作方式。
外掛標籤
開發者團隊
② 後台搜尋「Visibility Control for TutorLMS」→ 直接安裝(推薦)
原文外掛簡介
Visibility Control for TutorLMS 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 Tutor LMS Course,
2. User’s course completion status of a particular Tutor 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 MasterStudyLMS
– Visibility Control for Sensei LMS
– Visibility Control for WooCommerce
Related Plugins for TutorLMS:
* Experience API for TutorLMS
* Manual Completions for TutorLMS
