PluginProbe
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! / 1.0.0
Templately – Elementor & Gutenberg Template Library: 6500+ Free & Pro Ready Templates And Cloud! v1.0.0
3.7.5 3.7.4 3.7.3 3.7.2 1-final 3.7.1 3.7.0 3.6.8 3.6.7 3.6.6 3.6.5 3.6.4 3.6.3 3.6.2 3.6.1 3.0.3 3.0.4 3.0.5 3.0.6 3.0.7 3.0.8 3.0.9 3.1.0 3.1.1 3.1.10 All 111 releases
← All changes | core/class-db.php +42 -0 1-final1.0.0 View file →
@@ -1,0 +1,42 @@
1 +<?php
2 +
3 +namespace Templately;
4 +
5 +class DB {
6 + /**
7 + * Get an option
8 + *
9 + * @param string $key
10 + * @param mixed $default
11 + * @return void
12 + */
13 + public static function get_option( $key, $default = false ){
14 + $trimmed_key = trim( $key );
15 + return empty( $trimmed_key ) ? false : \get_option( $trimmed_key, $default );
16 + }
17 + /**
18 + * Update an option
19 + *
20 + * @param string $key
21 + * @param mixed $value
22 + * @param string|boolean $autoload
23 + * @return void
24 + */
25 + public static function update_option( $key, $value, $autoload = null){
26 + $trimmed_key = trim( $key );
27 + return empty( $trimmed_key ) ? false : \update_option( $trimmed_key, $value, $autoload );
28 + }
29 + /**
30 + * Delete an option
31 + *
32 + * @param string $key
33 + * @return void
34 + */
35 + public static function delete_option( $key ){
36 + $trimmed_key = trim( $key );
37 + if( ! empty( $trimmed_key ) ) {
38 + return \delete_option( $trimmed_key );
39 + }
40 + return false;
41 + }
42 +}