Support

Account

Home Forums Backend Issues (wp-admin) No value updated inside repeater

Solving

No value updated inside repeater

  • Hi,

    Im trying to update some text field inside a repaeter:

    function change_field($post_id) {
        $fields = get_fields($post_id);
    
        if (have_rows('blocks', $post_id)):
            while (have_rows('blocks', $post_id)) : the_row();
                $row = get_row();
    
                if( have_rows('columns') ):
                    while( have_rows('columns')) : the_row();=
    
                        $custom_text = get_sub_field('custom_text', false);
                        $value = set_value($custom_text);
                        update_sub_field('cutom_text', $value);
                        acf_flush_value_cache($post_id, 'custom_text');
    
                    endwhile;
                endif;
            endwhile;
        endif;
    }
    
    change_field(5968);
    

    No value changed, maybe somebody knows what im doing wrong?

  • What exactly is this doing?

    
    $value = set_value($custom_text);
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘No value updated inside repeater’ is closed to new replies.