Support

Account

Home Forums Backend Issues (wp-admin) update_sub_field doing nothing, with or without keys. Reply To: update_sub_field doing nothing, with or without keys.

  • @graphix,

    Thanks for some pointers, but unfortunately this isn’t working for me. I’m curious if it’s because I’m using a Flexible Content Type vs a Repeater?

    I’m able to get the saving to work via WordPress’ update_post_meta function, just using

    
        $label = 'content_type_'.$this_count.'_label_label';
        $subtitle = 'content_type_'.$this_count.'_label_subtitle';
        update_post_meta( $post_id, $label, $the_content['label']);
    

    However, I worry that when new content types and repeaters are added in this manner, they may not be ‘registered’ with ACF. I feel I’m missing something important in the structure of my code, as it seems to work for everyone but me!

    From some fiddling, get_fields actually shows me that there is a ‘new’ field added in for each of the groups I updated, e.g.

    
    //before updating label in group label
    content_type_label_label => ''
    

    becomes

    
    //after updating label in group label
    content_type_label_0_label => 'test',
    content_type_label_label => ''
    

    Or something to that effect.