HUSKY - Product Filter for WooCommerce

woof_meta_use_acf_dateformat

控制是否应为日期选择器元筛选使用ACF(高级自定义字段)日期格式;当设置为true时,日期格式化为Ymd而非Unix时间戳。

参数

$use_acf (bool) —— 布尔标志,指示是否应应用ACF日期格式(默认:false)

源文件

ext/meta_filter/html_types/datepicker/index.php:115

代码示例


add_filter('woof_meta_use_acf_dateformat', function($use_acf) {
    // Enable ACF date format handling
    return true;
});

使用说明

  • 当设置为true时,起始/结束日期将使用gmdate()转换为Ymd格式。
  • 当ACF格式激活时,还会将'i'(无穷大)值转换为PHP_INT_MAX。
  • 对于通过ACF日期字段进行筛选时的兼容性至关重要。