• Resolved LS

    (@lsterling03)


    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?

    • This topic was modified 4 months, 4 weeks ago by LS.
Viewing 1 replies (of 1 total)
  • Hello @lsterling03 ,

    thank you for your feedback.

    Unfortunately there was a mistake in the readme stating a wrong filter name. The correct filter name is “acf/admin_columns/render_output”. I have updated the readme today (not visible yet, probably published by the repository soon).

    Please let me know if it works with “acf/admin_columns/render_output”.

    Best regards,

    Florian

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.