Fiter not working
-
I’m trying to use your example filter to adjust the output of an ACF date field. But it’s having no effect:
function my_column_value($rendered_output, $field_properties, $field_value, $post_id) {
if ($field_properties['name'] == 'date') {
$field_value = DateTime::createFromFormat('Ymd', $field_value);
return $field_value->format('Y-m-d');
}
return $rendered_output;
}
add_filter('acf/admin_columns/column/render_output','my_column_value', 10, 4);The ACF field name is “date” and the value is saved in Ymd format. I want to change it to Y-m-d when displayed in the admin column. Nothing is happening.
I tested simplifying the return in case my date function was wrong, but this still had no effect:
function my_column_value($rendered_output, $field_properties, $field_value, $post_id) {
if ($field_properties['name'] == 'date') {
return 'test';
}
return $rendered_output;
}
add_filter('acf/admin_columns/column/render_output','my_column_value', 10, 4);What am I doing wrong?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- You must be logged in to reply to this topic.