Description

Filter used to add additional time intervals available for the Time field Invervals dropdown.

Parameters

$intervals
(array) Array of time intervals for the Time field Invervals dropdown.

Source

includes/fields/class-date-time.php

More Information

The wpforms_datetime_time_intervals filter is used to choose the time intervals for the Time field dropdown.

Examples

/*
 * Time intervals available for the Time field dropdown.
 *
 * @link https://wpforms.com/developers/wpforms_datetime_time_intervals/
 *
 * @param   array   $intervals   Used to determine the time intervals.
 *
 * @return  array
*/
function wpf_dev_datetime_time_intervals( $intervals ) {
       
    // Add time interval
     $intervals['5'] = esc_html__( '5 minutes', 'wpforms' );
     ksort( $intervals );
   
     return $intervals;
}
add_filter( 'wpforms_datetime_time_intervals' , 'wpf_dev_datetime_time_intervals' );


Snippet Reference: How to Create Additional Intervals for the Date Time Field Time Picker