Plugin API Reference
Settings API
Store and retrieve plugin configuration settings with automatic namespace isolation.
📍 Source: App\CMS\Settings\SettingsManager
Basic Usage
Access the Settings API via helper functions or the SettingsManager facade:
// Get a setting with namespace 'my_plugin'
$apiKey = get_option('my_plugin.api_key', 'default_value');
// Set a setting
update_option('my_plugin.api_key', 'secret_key_123');
// Delete a setting
delete_option('my_plugin.api_key');
Registering Settings Schema
Register setting fields in your plugin's boot() method to auto-render admin settings forms:
use App\CMS\Settings\SettingsManager;
public function boot(): void
{
SettingsManager::registerGroup('my_plugin_settings', [
'title' => 'My Plugin Settings',
'fields' => [
[
'key' => 'my_plugin.api_key',
'label' => 'API Key',
'type' => 'text',
'description' => 'Enter your API key from the developer portal.',
],
[
'key' => 'my_plugin.enable_notifications',
'label' => 'Enable Email Notifications',
'type' => 'checkbox',
'default' => true,
]
]
]);
}
Last verified against AIPostify core. © 2026 AIPostify Marketplace Developer Documentation.