Support

Account

Home Forums Add-ons Repeater Field Manually add image to nested repeater

Solving

Manually add image to nested repeater

  • Hello,

    I have a ACF 5.0 field group structured like this:

    type : name
    repeater : revision
    – repeater : rev_files
    — file : rev_file

    ==================

    So I have a repeater in a repeater with a file field. I need to manually add an image to the file field. I can’t seem to get it to work.

    Currently I’m trying the command update_sub_field. This is way I’m trying to update the field: update_sub_field( array(‘revision’, 1, ‘rev_files’, 1, ‘rev_file’ ), $img_attachement_id );

    Note the first repeater is already containing data, it exists, but the rev_files is completely empty.

    Any suggestions or recommended documents?

    Thanks!

  • did you manage to solve this?

  • Try using the field keys instead of the field names. It may not be working because you’re adding a value rather than updating an existing value and it likely has the same problem that update_field() has https://www.advancedcustomfields.com/resources/update_field/.

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

The topic ‘Manually add image to nested repeater’ is closed to new replies.