Description

The wpforms_coupons_admin_coupons_edit_time_format filters default time format for the time dropdown when editing or creating coupons with the Coupons Addon.

Parameters

$current_format
(string) (Required) Time picker dropdown.

Source

wpforms-coupons/src/Admin/Coupons/Edit.php

More Information

The filter is applied to the time dropdown that appears when editing or creating coupons with the Coupons Addon. The default format is g:i a.

Please be aware this filter has four supported formats.

[php]$supported_formats = [ ‘g:i a’, ‘g:i A’, ‘H:i’ ];[/php]

You’ll need to stick to these formats when utilizing this filter.

Examples

/**
 * Modifying time dropdown format on the Edit Coupon page.
 *
 * @link   https://wpforms.com/developers/wpforms_coupons_admin_coupons_edit_time_format/
 *
 * @param  string  $current_format Time format.
 * @return string
 */

function  wpf_coupons_admin_coupons_edit_time_format ( $current_format ) {
 
	// Set your time format for your coupons
	$current_format = 'H:i';
	
	return $current_format;
	
}

add_filter( 'wpforms_coupons_admin_coupons_edit_time_format', 'wpf_coupons_admin_coupons_edit_time_format', 10, 1 );