Description
The wpforms_pro_forms_fields_camera_field_wait_time_seconds
filter adjusts the countdown timer that appears before the Camera field captures a photo or video.
By default, the Camera field uses a 3-second countdown. You can use this filter to increase or decrease that wait time, or even remove it completely.
Parameters
parameter | type | description |
---|---|---|
$wait_time | int (required) | Number of seconds before the snapshot. Default is 3 |
Source
wpforms/src/Pro/Forms/Fields/FileUpload/Field.php
More Information
This filter is applied to the countdown timer value shown in the Camera field before a snapshot or video recording begins.
Developers can use this to:
- Shorten the countdown for faster captures
- Lengthen the countdown to give users more prep time
- Set it to
0
for instant captures with no wait
Example
/**
* Change the Camera field countdown timer before capturing.
*
* @link https://wpforms.com/developers/wpforms_pro_forms_fields_camera_field_wait_time_seconds/
*
* @param int $wait_time Number of seconds before the snapshot (default is 3).
* @return int
*/
function wpf_dev_camera_field_wait_time( $wait_time ) {
// Set countdown to 5 seconds
return 5;
}
add_filter( 'wpforms_pro_forms_fields_camera_field_wait_time_seconds', 'wpf_dev_camera_field_wait_time' );