Support

Account

Home Forums Feature Requests Filter returned value of get_field()

Solved

Filter returned value of get_field()

  • I am working on a proof of concept add-on for ACF and it would be really great if there were a couple more filters for me to be able to hook into.

    Specifically I would like to be able to filter the returned value from get_field() and get_sub_field().

    Example for get_field():

    return $value;

    becomes:

    return apply_filters( 'acf/field_return_value', $value, $selector, $post_id, $format_value, $field );

    Edited: to include the $field object in the filter which I need access to. In get_sub_field I need access to the $row and $sub_field objects

  • After some more searching I discovered everything that I needed is already included in the current version.

    Filters:

    acf/format_value
    acf/load_value

    Function:

    acf_get_row()

Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Filter returned value of get_field()’ is closed to new replies.