# templately/1.1.4/core/class-db.php

Templately – Elementor &amp; Gutenberg Template Library: 6500+ Free &amp; Pro Ready Templates And Cloud!, version 1.1.4. 43 lines.

- Page: https://pluginprobe.com/plugins/templately/1.1.4/code/core/class-db.php
- Raw: https://pluginprobe.com/plugins/templately/1.1.4/raw/core/class-db.php
- Modified: 2020-11-26T06:05:12+00:00

Line numbers below start at 1. Link to a line or a range by appending a fragment to the
page URL, for example `https://pluginprobe.com/plugins/templately/1.1.4/code/core/class-db.php#L10-L20`.

```php
<?php

namespace Templately;

class DB {
    /**
     * Get an option
     *
     * @param string $key
     * @param mixed $default
     * @return void
     */
    public static function get_option( $key, $default = false ){
        $trimmed_key = trim( $key );
        return empty( $trimmed_key ) ? false : \get_option( $trimmed_key, $default );
    }
    /**
     * Update an option
     *
     * @param string $key
     * @param mixed $value
     * @param string|boolean $autoload
     * @return void
     */
    public static function update_option( $key, $value, $autoload = null){
        $trimmed_key = trim( $key );
        return empty( $trimmed_key ) ? false : \update_option( $trimmed_key, $value, $autoload );
    }
    /**
     * Delete an option
     *
     * @param string $key
     * @return void
     */
    public static function delete_option( $key ){
        $trimmed_key = trim( $key );
        if( ! empty( $trimmed_key ) ) {
            return \delete_option( $trimmed_key );
        }
        return false;
    }
}

```
