pollora/option

A modern PHP package for WordPress option management with validation and immutable value objects

Maintainers

Package info

github.com/Pollora/option

pkg:composer/pollora/option

Statistics

Installs: 1

Dependents: 0

Suggesters: 0

Stars: 0

Open Issues: 0

v1.1.0 2026-06-23 10:28 UTC

This package is auto-updated.

Last update: 2026-06-23 12:18:13 UTC


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\Option for 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