Description
The gravityflow_inbox_entry_detail_pre_process filter allows developers to control whether the entry detail should be processed before displaying it in the Gravity Flow inbox.
Usage
add_filter('gravityflow_inbox_entry_detail_pre_process', 'my_custom_function', 10, 3);
Parameters
| Parameter | Type | Details |
|---|---|---|
| $process_entry_detail | bool | Whether to process the entry detail (true by default). |
| $form | array | The current form array. |
| $entry | array | The current entry array. |
Examples
Force entry processing only during business hours
add_filter( 'gravityflow_inbox_entry_detail_pre_process', 'sb_gravityflow_inbox_entry_detail_pre_process', 10, 3 );
function sb_gravityflow_inbox_entry_detail_pre_process( $process_entry_detail, $form, $entry ) {
$current_time = time();
$current_hour = (int)date('G', $current_time);
$start_hour = 9;
$end_hour = 17;
if ($current_hour < $start_hour || $current_hour >= $end_hour) {
echo "<h1>Processing Not Allowed</h1>";
echo "<h2>Our business hours are 9 AM to 5 PM. Please try again during business hours.</h2>";
$process_entry_detail = false;
}
return $process_entry_detail;
}
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-gravity-flow.php