gravitysmtp_delete_log_on_deactivate

Description

The gravitysmtp_delete_log_on_deactivate filter allows developers to control whether the debug log should be deleted when debug logging is disabled.

Usage

add_filter( 'gravitysmtp_delete_log_on_deactivate', 'your_function_name', 10, 1 );

Parameters

ParameterTypeDescription
$delete_logboolWhether to delete the debug log when debug logging is disabled. Default is false

Examples

Automatically delete debug logs when debug logging is disabled.

add_filter( 'gravitysmtp_delete_log_on_deactivate', '__return_true' );

Placement

This code can be used in the functions.php file of the active theme, a custom functions plugin, a custom add-on, or with a code snippets plugin.

See also the PHP section in this article: Where Do I Put This Code?

Source Code

This filter is located in class-debug-log-event-handler.php

Since

This filter was added in Gravity SMTP version 1.5.1