Support

Account

Home Forums ACF PRO please help – update_field not saving correct data

Helping

please help – update_field not saving correct data

  • Hello!
    I’ve run into an issue that I’ve never experienced before and for the life of me cannot figure out.
    I have a basic plugin that will update an ACF User field (multiple values) on a custom post type.
    The correct field is being targeted, the data to be saved is correct, but for some reason when the update_field function is called, the wrong user is saved into the array.
    Here’s a snippet of my code which includes some troubleshooting code as well: https://gist.github.com/nathanp/1be1b54dfa31eb4882aa

    —- Versions —-
    ACF v5.3.1
    WP v4.3.1

  • The user field stores the user ID or an array of user ID values it you set it to allow multiple. You need to insert just an array of ID values instead of an array of user objects.

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

The topic ‘please help – update_field not saving correct data’ is closed to new replies.