pollora / option
A modern PHP package for WordPress option management with validation and immutable value objects
v1.1.0
2026-06-23 10:28 UTC
Requires
- php: ^8.2
Requires (Dev)
- brain/monkey: ^2.6
- laravel/pint: ^v1.22.1
- mockery/mockery: ^1.6
- pestphp/pest: ^v3.8.2
- phpstan/phpstan: ^2.1.16
README
A modern PHP package for WordPress option management with validation and immutable value objects.
Installation
composer require pollora/option
Quick Start
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.
Documentation
See docs/options.md for full documentation.
Testing
composer test
License
GPL-2.0-or-later