ConfigRegistry loads plugin/theme settings from an array or JSON file.
You can load settings from a JSON file (example):
use WordPress_ToolKit\ConfigRegistry; $cache = new ConfigRegistry( '/path/to/config.json' );
...or you can load from an array:
use WordPress_ToolKit\ConfigRegistry; $config = new ConfigRegistry( 'name' => 'My Plugin', 'slug' => 'my-plugin', 'data' => array( 'version' => '1.0.0', 'textdomain' => 'my-text-domain' ) );
Getting a configuration option:
$version = $config->get('data/version');
Merging two ConfigRegistry objects:
$config = $config->merge( new ConfigRegistry( '/path/to/other.json' ) );
There was an error while loading. Please reload this page.