AI Summary
Description
The wpforms_coupons_admin_coupons_edit_date_format filters default format for the date picker when editing or creating coupons with the Coupons Addon.
Parameters
- $current_format
- (string) (Required) Date picker date format.
Source
wpforms-coupons/src/Admin/Coupons/Edit.php
More Information
The filter is applied to the date picker that appears when editing or creating coupons with the Coupons Addon. The default format is F j Y.
Please be aware this filter has four supported formats.
[php]$supported_formats = [ ‘F j, Y’, ‘Y-m-d’, ‘m/d/Y’, ‘d/m/Y’ ];[/php]
You’ll need to stick to these formats when utilizing this filter.
Examples
/**
* Modifying date format for the date-pickers on the Edit Coupon page.
*
* @link https://wpforms.com/developers/wpforms_coupons_admin_coupons_edit_date_format/
*
* @param string $current_format Date picker date format.
* @return string
*/
function wpf_coupons_admin_coupons_edit_date_format ( $current_format ) {
// Set your date format for your coupons
$current_format = 'Y-m-d';
return $current_format;
}
add_filter( 'wpforms_coupons_admin_coupons_edit_date_format', 'wpf_coupons_admin_coupons_edit_date_format', 10, 1 );