An open API service indexing awesome lists of open source software.

https://github.com/wp-forge/wp-options

A WordPress helper class for managing plugin options.
https://github.com/wp-forge/wp-options

Last synced: 10 months ago
JSON representation

A WordPress helper class for managing plugin options.

Awesome Lists containing this project

README

          

# WordPress Options

A WordPress helper class for managing plugin options.

## Installation

```shell
composer require wp-forge/wp-options
```

## Usage

### Setting Options

```php
set('name', 'value');
```

### Getting Options

```php
get('name', 'default');
```

### Deleting Options

```php
delete('name');
```

### Checking if an Option Exists

```php
has('name');
```

### Saving Options

By default, options will save automatically on the `shutdown` hook.

However, if you'd like to force a save, you can do it like this:

```php
save();
```