You can paste in a rgba value into the existing color picker as well. Works just fine.
Hey ech,
I managed to find a workaround shortly after posting to your own question, here’s the link: http://support.advancedcustomfields.com/forums/topic/get_field-after-update_sub_field-gets-old-values/
My workaround method involves updating the lists
field after setting the $list
during the foreach. This way you you’re not forced in using WP code to access updated ACF repeater data.
Hey John,
Please ignore my rambling up the top. I didn’t realize you were meant to use Field keys
, which wasn’t apparent as they were hidden away by default. I had figured this out shortly after posting the above.
Thanks for the help either way! π
Help, Hilfe, Upomoc! π
I did manage to find a temp. workaround for this issue by setting $list[ $key ]['field'] = 0
within the foreach
and then updating the repeater i.e. update_field('lists', $lists, $post->ID)
before retrieving it again. Not exactly an optimal solution though.
I’ve got the exact same issue here.
I have a update_sub_field
inside a foreach after which I do a get_field
of the repeater right after the update, but it still has the old values even though the update_sub_field
did indeed update everything correctly.
Not sure why ACF get_field
is still getting old values. Thanks for any help!
E.g.
$lists = get_field('lists', $post->ID); // repeater field
foreach ($lists as $key => $list) {
update_sub_field(array('lists', $key, 'field'), 0, $post->ID); // switch from '1' to '0'
}
$lists = get_field('lists', $post->ID);
var_dump($lists);
// outputs old values