ACF field filter
I see that 4.0 removed “cac/acf/format_acf_value” I have used this filter on 8 sites and trying to change my code to work again with ACF fields. I spent the also hour with “ac/column/value” filter and just failing.
Any way to direct me to the right direction?
Here is my old function that worked before the update.
function my_cac_formatted_acf_value_dates( $value, $acf_field, $id, $originalvalue, $column_object ) {
if ( 'repeater' == $acf_field['type'] ) {
$today = strtotime(date('Ymd'));
$dateclean ='';
foreach($originalvalue as $date){
$start_date = strtotime($date["field_55a00a0df52d2"]);
if( !($start_date>=$today ))continue;
$dateclean .= '<div class="sub_field">'.date("M jS, Y @ g:ia", $start_date).'</div>';
}
$value = $dateclean;
if(empty($value)){
$value = 'Past Event';
};
}
return $value;
}
add_filter( 'cac/acf/format_acf_value', 'my_cac_formatted_acf_value_dates', 10, 5 );
Thanks!
You must be logged in to reply to this topic.