Home › Forums › ACF PRO › acf_add_local_field not updating on save when auto-adding fields › Reply To: acf_add_local_field not updating on save when auto-adding fields
Hi @iamhexcoder
That’s because, at some point when ACF saves the data, the $_GET['post']
global variable is not available. Could you please try to get the ID like this:
if( isset( $_GET['post'] ) ){
$post_id = $_GET['post'];
} elseif ( isset( $_POST['post_ID'] ) ){
$post_id = $_POST['post_ID'];
} else {
$post_id = '0';
}
I hope this helps 🙂
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.