-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathoptions.class.php
More file actions
40 lines (35 loc) · 870 Bytes
/
options.class.php
File metadata and controls
40 lines (35 loc) · 870 Bytes
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
<?php
class Approval_Workflow_Options {
var $options;
var $option_name;
var $is_site_option;
function Approval_Workflow_Options($option_name, $is_site_options = false){
$this->option_name = $option_name;
$this->is_site_option = $is_site_options;
if($this->is_site_option){
$this->options = get_site_option($this->option_name);
} else {
$this->options = get_option($this->option_name);
}
if(!is_array($this->options)){
$this->options = array();
}
}
function __get($key){
return $this->options[$key];
}
function __set($key, $value){
$this->options[$key] = $value;
}
function __isset($key){
return array_key_exists($key, $this->options);
}
function save(){
if($this->is_site_option){
update_site_option($this->option_name, $this->options);
} else {
update_option($this->option_name, $this->options);
}
}
}
?>