Support

Account

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

Helping

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)

You must be logged in to reply to this topic.

We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Cookie Policy. If you continue to use this site, you consent to our use of cookies.