Home Forums General Issues Concatenate to existing field value


Concatenate to existing field value

  • Im trying to get a acf field then concatenate a value onto it and update the field. Im not having much success. Is this possible. ive been trying the below:

    $existingData = get_field( “my_acf_field”, “user_10” );
    $newData = “a”;
    $combineData = $existingData.$newData;
    update_field(“my_acf_field, $combineData, “user_10”);

    The result is it writes over the existing data with the new data rather than concatenating it.

    Anyone got any ideas how to achieve this?


  • Solved with a typo issue.

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

You must be logged in to reply to this topic.