Support

Account

Home Forums Reply To:

  • Hello,

    I am confused as this is either by design; the documentation is wrong; or a bug waiting to be fixed.

    acf/update_value filter states that:

    This hook allows you to modify the value of a field before it is saved to the database.

    But, when you actually use get_field() function inside that filter using the same selector, the get_field() will actually output the submitted value, which in a sense is already saved in the database, right?

    Example:

    add_filter( “acf/update_value/key=field_123456”, ‘cb_try_to_get_field_this’, 10, 3 );

    function cb_try_to_get_field_this( $value, $post_id, $field ) {

    $the_value_of_the_post = get_field( ‘field_123456’, $post_id );
    error_log( print_r( $the_value_of_the_post, 1 ), 3, “debug.log” );

    return $value;

    }

    and you’ll be able to see that $the_value_of_the_post actually returned the submitted/new values.

    how come?