kaiseki / wp-acf
Advanced Custom Fields (ACF) helpers for WordPress: local JSON sync, a Google Maps API key provider, and a WP-CLI field-group sync command
Requires
- php: ^8.2
- ext-json: *
- kaiseki/config: ^2.0
- kaiseki/wp-cli-util: ^1.0
- kaiseki/wp-env: ^1.0
- kaiseki/wp-hook: ^2.0
- psr/container: ^1.1 || ^2.0
Requires (Dev)
- bnf/phpstan-psr-container: ^1.1
- kaiseki/php-coding-standard: ^1.0
- maglnet/composer-require-checker: ^4.0
- php-stubs/acf-pro-stubs: ^6.0
- php-stubs/wordpress-stubs: ^6.2
- php-stubs/wp-cli-stubs: ^2.11
- phpstan/extension-installer: ^1.4
- phpstan/phpstan: ^2.0
- phpstan/phpstan-phpunit: ^2.0
- phpstan/phpstan-strict-rules: ^2.0
- phpunit/phpunit: ^11.0
- roave/security-advisories: dev-latest
- roots/wordpress-core-installer: *
- roots/wordpress-no-content: @stable
- szepeviktor/phpstan-wordpress: ^2.0
This package is auto-updated.
Last update: 2026-06-02 23:45:40 UTC
README
Advanced Custom Fields (ACF) helpers for WordPress: local JSON sync, a Google Maps API key provider, and a WP-CLI field-group sync command.
Three small pieces wired through ConfigProvider and driven by the acf config key:
LocalJson— configures ACF's local-JSON load/save paths.GoogleApiKey— sets ACF'sgoogle_api_keysetting (from config or theGOOGLE_MAPS_API_KEYconstant).SyncFieldGroups— akaiseki acf-sync-field-groupsWP-CLI command that imports all local-JSON field groups into the database.
Installation
composer require kaiseki/wp-acf
Requires PHP 8.2 or newer. Expects the ACF (Pro) plugin to be active at runtime.
Usage
Register ConfigProvider with your laminas-style config aggregator and configure the acf key:
return [ 'acf' => [ 'local_json' => [ 'load_paths' => [ get_stylesheet_directory() . '/acf-json', ], 'save_path' => get_stylesheet_directory() . '/acf-json', ], 'google_api_key' => 'AIza...', // or define('GOOGLE_MAPS_API_KEY', ...) ], ];
ConfigProvider registers factories for LocalJson and GoogleApiKey, and the SyncFieldGroups
WP-CLI command as a hook provider. The Google API key can also come from the GOOGLE_MAPS_API_KEY
constant, which takes precedence over the config value.
Sync local JSON field groups to the database:
wp kaiseki acf-sync-field-groups
Development
composer install
composer check # check-deps, cs-check, phpstan
License
MIT — see LICENSE.