Skip to main content

benecaster_support_mode_disabled

Action Free

Fires when Support Mode is switched off — either by an admin in Settings → Tools, or automatically seven days after it was switched on. Support Mode is already fully off by the time your callback runs.

Use it to tear down whatever verbose logging your add-on turned on in response to benecaster_support_mode_enabled. Leaving it running is the failure mode this hook exists to prevent: the seven-day timer means most sites disable automatically, and an add-on that only listens for the manual switch-off will log forever on every one of them.

$reason tells you which path it was. Most add-ons treat both identically.

Parameters

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

Examples

Disable verbose logging and cancel cleanup cron on disable

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' );
    }
);

Need this built rather than just documented? See our services →