Because I’ll be moving my theme from server to server, I want to set up all my field groups programatically. I’ve had no problem doing this in the past with custom post type field groups but I have been unable to get it to work for the standard options page. I initially set up the field group using the ui and then exported it as json and pasted that into my php. I also converted it back to a PHP array just in case that made a difference. Here’s my array:
The crucial part is the location element. This is the parameter that appears in the admin url and it is correct. This was a later attempt after I’d already failed to add the options to the native ACF options page using the value 'acf-options'.
On the options page I just get an alert stating that no field groups have been created for this options page.
I’ve not found any explicit instructions relating to the use of this function to set up an options field group, but likewise I’ve not found anything to say it shouldn’t work.
I’m aware there’s an obvious bug there in using the incorrect variable name when passing to the acf_add_local_field_group function. That’s not the reason it’s not working, that’s just me copypasting from outside a wrapper function and then inside the wrapper function. I AM passing the correct array so ignore that.