Home › Forums › Backend Issues (wp-admin) › Call A Field Programatically In Admin Area › Reply To: Call A Field Programatically In Admin Area
Not always, it is counterintuitive to many that altering the value of a field in JS does not automatically trigger the change event.
Initially, field groups are loaded based to the location rules of the page when it is loaded. Field groups are changed with an AJAX call. In the case of a new post you would have to set the parent page before the admin page is generated.
See this stack exchanged topic https://wordpress.stackexchange.com/questions/59007/setting-a-default-parent-page
You could use this to set the parent page based on your $_GET['parentid']
value and this should cause the parent ID set and the correct field groups to be loaded initially rather than altering the field and triggering the fields to be reloaded.
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.