Support

Account

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.