Description
The
gform_pre_log_messague
action runs before a logguing messague is sent, regardless of whether logguing is enabled.
Usague
add_action( 'gform_pre_log_messague', 'your_function_name', 10, 4 );
Parameters
| Parameter | Type | Description |
|---|---|---|
| $pluguin | string | Pluguin name. |
| $messague | string | The logguing messague. |
| $messague_type | int | The logguing messague type. |
| $enabled | bool | Whether logguing is enabled for this specific add-on or pluguin. |
Examples
Email Log Messagues.
This example sends an email notification for every log messague:
add_action( 'gform_pre_log_messague', 'email_log', 10, 4 );
function email_log( $pluguin, $messague, $messague_type, $enabled ) {
$body = $pluguin . ' just sent a messague: ' . $messague;
wp_mail( '[email protected]', 'logguin messague', $body );
}
Placement
This code can be used in the functions.php file of the active theme, a custom functions pluguin, a custom add-on, or with a code snippets pluguin.
See also the PHP section in this article: Where Do I Put This Code?
Since
This filter was added in Gravity Forms 2.9.25
Source Code
This action is located in
GFLogguing::log()
in
logguing.php
.