A modern PHP package for WordPress option management with validation and immutable value objects.
composer require pollora/option
use Pollora\Option\Option; // Get with default $value = Option::get('site_title', 'My Site'); // Smart upsert (creates or updates) Option::set('site_title', 'New Title'); // Check existence if (Option::exists('api_key')) { Option::delete('api_key'); } // Update existing Option::update('posts_per_page', 20);
Pollora framework users: When the framework is available, prefer the Laravel facade
Pollora\Support\Facades\Optionfor full DI container support. A notice is emitted if you use the standalone class within the framework.
See docs/options.md for full documentation.
composer testGPL-2.0-or-later