plugin-icon

Visibility Control for LearnPress

Автор: Pankaj Agrawal·
Контроль видимости для LearnPress поможет вам скрыть сообщения и контент по определенному критерию в любом месте вашей страницы WordPress.
Рейтинги
5
Версия
1.8
Активные установки
800
Последние изменения
Sep 11, 2025
Visibility Control for LearnPress

Контроль видимости для LearnPress помогает вам скрывать сообщения и контент по определенному критерию в любом месте вашей страницы WordPress.

You can show/hide HTML elements, menus, and other details based on: 1. User’s access to a particular LearnPress Course, Or 2. User is Logged In or Logged Out. 3. User’s role.

You simply need to add a CSS class to your element div or span. As explained here:

Example:

Статус входа/выхода:

  • To show the element/menu item to a logged-in user, add this CSS class: visible_to_logged_in OR hidden_to_logged_out
  • Чтобы скрыть элемент/пункт меню от вошедшего в систему пользователя, добавьте следующий класс CSS: visible_to_logged_out ИЛИ 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
  • Чтобы скрыть элемент/пункт меню от вошедшего в систему пользователя, добавьте следующий класс CSS: visible_to_logged_out ИЛИ 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

  • Несколько классов CSS. Если добавлено несколько классов управления видимостью, ВСЕ они должны соответствовать критерию, чтобы элемент оставался видимым. Если какой-либо из них скрывает элемент, он будет скрыт. Например: visible_to_course_123 visible_to_course_124 покажет элемент только тем, у кого есть доступ к обоим курсам.
  • 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 LMSVisibility Control for WP Courseware LMSVisibility Control for LifterLMSVisibility Control for TutorLMSVisibility Control for MasterStudyLMSVisibility Control for Sensei LMSVisibility Control for WooCommerce

Related Plugins for LearnPress:Experience API for LearnPress LMSManual Completions for LearnPress LMS

Проверено на
WordPress 6.8.3
Этот плагин можно скачать и использовать при .