PluginProbe
UpdraftCentral Dashboard / trunk
UpdraftCentral Dashboard vtrunk
0.8.33 0.7.2 0.7.3 0.7.4 0.8.0 0.8.1 0.8.10 0.8.11 0.8.12 0.8.13 0.8.14 0.8.15 0.8.16 0.8.17 0.8.18 0.8.19 0.8.2 0.8.20 0.8.21 0.8.22 0.8.23 0.8.24 0.8.25 0.8.26 0.8.27 All 51 releases
updraftcentral / classes / updraftcentral-options.php

updraftcentral-options.php in UpdraftCentral Dashboard trunk, at classes/updraftcentral-options.php

38 lines 996 B
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 if (!defined('UD_CENTRAL_DIR')) die('No direct access allowed');
4
5 // Options handling
6 if (!defined('ABSPATH')) die('No direct access allowed');
7
8 if (class_exists('UpdraftCentral_Options')) return;
9
10 class UpdraftCentral_Options {
11
12 public static function get_option($option, $default = false) {
13 $tmp = get_site_option('updraftcentral_options');
14 if (isset($tmp[$option])) {
15 return $tmp[$option];
16 } else {
17 return $default;
18 }
19 }
20
21 public static function update_option($option, $value, $use_cache = true) {
22 $tmp = get_site_option('updraftcentral_options', array(), $use_cache);
23 if (!is_array($tmp)) $tmp = array();
24 $tmp[$option] = $value;
25 return update_site_option('updraftcentral_options', $tmp);
26 }
27
28 public static function delete_option($option) {
29 $tmp = get_site_option('updraftcentral_options');
30 if (is_array($tmp)) {
31 if (isset($tmp[$option])) unset($tmp[$option]);
32 } else {
33 $tmp = array();
34 }
35 update_site_option('updraftcentral_options', $tmp);
36 }
37 }
38