-
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathOptionInterface.php
More file actions
49 lines (43 loc) · 1.05 KB
/
OptionInterface.php
File metadata and controls
49 lines (43 loc) · 1.05 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<?php
namespace PluginFrame\Core\Services\Options\Interfaces;
interface OptionInterface
{
/**
* Register a new option into WordPress options table.
*
* @param string $key
* @param mixed $default
* @param array $args Optional args like description, type, group, etc.
* @return void
*/
public function register(string $key, $default = null, array $args = []): void;
/**
* Get all registered options by this service.
*
* @return array
*/
public function all(): array;
/**
* Get a specific option value.
*
* @param string $key
* @param mixed $default
* @return mixed
*/
public function get(string $key, $default = null);
/**
* Update a specific option value.
*
* @param string $key
* @param mixed $value
* @return bool
*/
public function update(string $key, $value): bool;
/**
* Delete a registered option.
*
* @param string $key
* @return bool
*/
public function delete(string $key): bool;
}