Interface Theme (UI Theme Switcher)

The wpmc_ui_theme setting controls whether the plugin’s admin interface is displayed in Light Mode or Dark Mode.

Where It Appears

The theme switcher is displayed in the plugin’s admin header navigation area. You will see two buttons:

  • Dark 🌙 — Activates dark mode.
  • Light ☀️ — Activates light mode.

How It Works

  • The selected theme value (dark or light) is stored in WordPress options under the key wpmc_ui_theme.
  • When you press a theme button:
    1. A form submits a POST request with wpmc_ui_theme set to the chosen theme.
    2. The value is sanitized and saved via update_option().
    3. The page reloads to apply the new theme.

Technical Details

  • File:header.php
    • Handles saving the theme via admin_init.
    • Adds the theme switcher UI to the admin navigation.
  • File:wpmc-behavior-and-heatmap.php
    • Reads the current theme with get_option('wpmc_ui_theme', 'light').
    • Loads the appropriate CSS file from the themes/ directory:
      • themes/light.css for light mode.
      • themes/dark.css for dark mode.
    • If dark mode is active, adds the wpmc-dark-mode class to the <body> tag in the admin area for extra styling hooks.

Usage

  1. Go to any WPMC plugin admin page.
  2. Locate the theme switcher in the header bar.
  3. Click Dark 🌙 or Light ☀️ to instantly change the interface theme.
  4. The setting is remembered for all future sessions until changed.
© 2025 We handle WordPress. All of it.