Skip to main content

benecaster_support_mode_disabled

Fires when Support Mode is turned off — either manually by an admin or automatically by the 7-day auto-disable cron.

When It Fires

Fires from:

  • Benecaster\Admin\SupportMode::disable() — when an admin toggles Support Mode off in Settings → Tools
  • Benecaster\Admin\SupportMode::auto_disable() — when the one-shot WP-Cron event fires 7 days after Support Mode was enabled

In both cases, the benecaster_support_mode_enabled and benecaster_support_mode_auto_disable_at wp_options have already been cleared before this hook fires.

Parameters

Name Type Description
$reason string 'manual' when an admin toggled Support Mode off; 'auto' when the 7-day cron fired

Notes

This is a Free hook. It fires regardless of license status.

Use this hook to tear down any verbose logging your add-on enabled in response to benecaster_support_mode_enabled. The $reason parameter is informational — most add-ons handle both paths identically.

Example Usage

Disable verbose logging and cancel the cleanup cron when Support Mode turns off:

add_action(
    'benecaster_support_mode_disabled',
    function ( string $reason ): void {
        // $reason is 'manual' or 'auto' — tear down regardless.
        update_option( 'my_addon_verbose_logging', false, false );
        wp_clear_scheduled_hook( 'my_addon_support_mode_cleanup' );
    }
);

See Also