1

I am working on a Wordpress multisite network, where users can register sites on subdomains.

I am developing a customized theme for the registered sites using ACF Pro, including use of their 'Options Page' feature, in order to implement customization of various features such as menus, layout settings, etc...

I populate many fields with default settings so that a registered site can function properly on a fresh install. The problem is, is that "Options Pages" do not seem to publish automatically when a site is installed. To activate the settings, the user would need to go to the page and click "publish" before they go into effect and are integrated into the theme's processes.

I am trying to either get the options pages to update automatically on an install or get the custom fields themselves to work.

I am currently experimenting on the 'wpmu_new_blog' hook. The fields I am trying to set automatic defaults to are nested within two tiers of groups (parent_group -> sub_group -> sub_field) and I am trying to use the update_sub_field() function specified by ACF PRO

 update_sub_field( array(array('parent_group', 'options'), 1, 'sub_group', 1, 'sub_field'), 'Value for Subfield' );

This is not working however. The function itself returns a series of errors:

  • Notice: Array to string conversion in [several lines on /advanced-custom-fields-pro/includes/acf-meta-functions.php ]
  • Warning: Illegal offset type in isset or empty in [several lines on /advanced-custom-fields-pro/includes/acf-meta-functions.php ]

I am at a loss here. Any suggestions would be greatly appreciated!

Thank you so much.

skysarwer
  • 23
  • 4

0 Answers0