Skip to content

CSS Classes for Conditional Visibility

Mostafa Soufi edited this page Mar 1, 2025 · 3 revisions

WP Statistics uses specific CSS classes to control the visibility of elements based on certain conditions.

Visibility Classes:

  1. js-wps-show_if_{id}_enabled

    • Purpose: Makes an element visible if the feature with the given ID is enabled.
    • Example: .js-wps-show_if_tracking_enabled will show the element if the "tracking" feature is enabled.
  2. js-wps-show_if_{id}_equal_{value}

    • Purpose: Makes an element visible if the feature’s value matches the given value.
    • Example: .js-wps-show_if_privacy_mode_equal_enabled will show the element if the "privacy_mode" setting is enabled.

How It Works

These classes are added dynamically by JavaScript to control element visibility based on settings and feature statuses.

Clone this wiki locally