Skip to main content

benecaster_outlinks_health_settings_save_after

Action Premium outlinks

Fires once Link Health’s schedule has been saved, from the Schedule form on Settings → Link Health or the PATCH /benecaster-outlinks/v1/link-health/settings route. When the check frequency changed, the next check has already been rescheduled.

It fires only for a request that sends at least one of check_frequency and digest_frequency and passes validation, the same requests that fire benecaster_outlinks_health_settings_save_before.

Link Health is install-wide and needs Outlinks switched on for at least one show, so the hook never fires while Outlinks is off for every show or the licence has lapsed.

Parameters

Name Type Default Description
$settings array — `[ 'check_frequency' => …, 'digest_frequency' => … ]` as saved, the route's own answer
$previous array — The same two keys as they were before the save

Examples

Log a switched-off digest

add_action( 'benecaster_outlinks_health_settings_save_after', function ( array $settings, array $previous ): void {
    if ( 'off' === $settings['digest_frequency'] && 'off' !== $previous['digest_frequency'] ) {
        error_log( 'Link Health email digest switched off' );
    }
}, 10, 2 );

Notes

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