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.
- Host: GitHub
- URL: https://github.com/wp-forge/wp-options
- Owner: wp-forge
- Created: 2022-03-04T12:47:57.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2024-05-10T14:57:56.000Z (about 2 years ago)
- Last Synced: 2025-08-12T20:49:29.626Z (11 months ago)
- Language: PHP
- Size: 3.91 KB
- Stars: 5
- Watchers: 1
- Forks: 4
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
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();
```