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 (
darkorlight) is stored in WordPress options under the keywpmc_ui_theme. - When you press a theme button:
- A form submits a
POSTrequest withwpmc_ui_themeset to the chosen theme. - The value is sanitized and saved via
update_option(). - The page reloads to apply the new theme.
- A form submits a
Technical Details
- File:
header.php- Handles saving the theme via
admin_init. - Adds the theme switcher UI to the admin navigation.
- Handles saving the theme via
- 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.cssfor light mode.themes/dark.cssfor dark mode.
- If dark mode is active, adds the
wpmc-dark-modeclass to the<body>tag in the admin area for extra styling hooks.
- Reads the current theme with
Usage
- Go to any WPMC plugin admin page.
- Locate the theme switcher in the header bar.
- Click Dark 🌙 or Light ☀️ to instantly change the interface theme.
- The setting is remembered for all future sessions until changed.