ACF
config/acf.php
The ACF configuration file contains all settings related to ACF.
load_php_fields
Section titled “load_php_fields”Fields are defined in PHP inside acf-php/ and loaded at boot time. This is the preferred approach — it keeps field definitions in version control and out of the database.
This setting is enabled by default.
return [ 'load_php_fields' => true,];Disabling this setting will:
- Stop loading PHP field definitions from
acf-php/ - Re-enable ACF JSON sync (so fields can be managed through the WordPress admin)
- Remove the custom featured image meta box overrides
return [ 'load_php_fields' => false,];register_option_pages
Section titled “register_option_pages”Registers ACF options pages. There are two ways to register an options page.
Basic usage
Section titled “Basic usage”return [ 'register_option_pages' => [ fn() => OptionsPageBuilder::make('My Options Page'), ]];With child pages
Section titled “With child pages”return [ 'register_option_pages' => [ fn() => OptionsPageBuilder::make('Theme Settings') ->addChildPage(OptionsPageBuilder::make('General')) ->addChildPage(OptionsPageBuilder::make('SEO')), ]];All options
Section titled “All options”OptionsPageBuilder::make('My Options Page') ->menuTitle('My Page') // override menu title (defaults to page title) ->menuSlug('my-page') // override menu slug (defaults to sanitized page title) ->capability('manage_options') // default: 'edit_posts' ->position(25) ->iconUrl('dashicons-admin-generic') ->postId('my_options') // ACF post ID for get_field() (defaults to 'options') ->autoload();
