benecaster_support_mode_enabled
Fires from Benecaster\Admin\SupportMode::enable() after Support Mode is toggled on and the 7-day auto-disable cron event has been scheduled.
When It Fires
After the benecaster_support_mode_enabled wp_option is written to true and the benecaster_support_mode_auto_disable_at timestamp is set. Fires on every enable — including re-enabling after a previous manual or automatic disable.
Parameters
| Name | Type | Description |
|---|---|---|
$auto_disable_at |
int | Unix timestamp when the 7-day auto-disable cron is scheduled to fire |
Notes
This is a Free hook. It fires regardless of license status.
Use this hook to mirror Benecaster’s logging lifecycle in your add-on. If your add-on has its own debug logger or diagnostic recorder, enabling it here ensures that when a customer sends a diagnostic log snapshot, your add-on’s output is included.
To read the current Support Mode state in code that isn’t in a hook callback, use Benecaster\Admin\SupportMode::is_active() rather than reading benecaster_support_mode_enabled directly.
Example Usage
Enable verbose logging in your add-on when Support Mode turns on, and schedule a cleanup cron to mirror core’s auto-disable:
add_action(
'benecaster_support_mode_enabled',
function ( int $auto_disable_at ): void {
update_option( 'my_addon_verbose_logging', true, false );
// Mirror core's 7-day cutoff so the add-on never logs past
// the same window, even if core's cron is rescheduled.
wp_clear_scheduled_hook( 'my_addon_support_mode_cleanup' );
wp_schedule_single_event( $auto_disable_at, 'my_addon_support_mode_cleanup' );
}
);
Related Hooks
benecaster_support_mode_disabled— fires when Support Mode turns off (manual or auto)SupportMode— readis_active()andget_auto_disable_at()without coupling to option names