asdads 23
-
When editing a post (GET request), $_GET['post'] exists → $post_id is set.
-
When saving a post (POST request), $_POST['post_ID'] exists → $post_id is set.
This way, the correct fields.php will be included before ACF processes the meta save, and values will persist.
Why This Fix Works
Ah ✅ that makes sense: when saving an existing post, the request does not have $_GET['post'] because WordPress sends a POST request to post.php with action=editpost.
So inside gsia_load_section_fields(), your $post_id detection fails (it always returns 0), which means no fields.php gets included → ACF doesn’t know the fields → values