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.
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.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
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 Privacy Policy. If you continue to use this site, you consent to our use of cookies.