Support

Account

Home Forums Bug Reports update_field does not work with repeater field inside a prefixed cloned field

Unread

update_field does not work with repeater field inside a prefixed cloned field

  • I have a prefixed cloned field that contains a repeater field. When trying to update the repeater field value nothing seems to happen. I have tried all possible variations for the field selector.

    Field 1: myCloneField
    Contains a clone of Field 2 “myRepeaterField”. This field is named “myCloneField” with the setting on to prefix all field names with the field name (“myCloneField”).

    Field 2: myRepeaterField
    Contains a repeater field with name “myRepeaterField”.

    For example:

    $data = [
        [
            'title' => 'A title',
            'text' => 'Some text',
        ],
        [
            'title' => 'Another title',
            'text' => 'Some other text',
        ]
    ];
    
    update_field('myCloneField_myRepeaterField', $data, $post_id);
    update_field('myCloneField_myCloneField_myRepeaterField', $data, $post_id);
    
    update_field('myCloneField_field_62f3b528e5146', $data, $post_id);
    update_field('myCloneField_myCloneField_field_62f3b528e5146', $data, $post_id);
    
    update_field('field_62f3b58d3fc2c_field_62f3b528e5146', $data, $post_id);
    update_field('field_62f3b58d3fc2c_myCloneField_field_62f3b528e5146', $data, $post_id);
    

    None of these seem to do anything other than saving an array as the given field key. When checking my database I do not see the individual post_meta rows that repeater fields should create.

Viewing 1 post (of 1 total)

You must be logged in to reply to this topic.