# timetics/1.0.0/core/settings/settings.php

Timetics – Appointment Booking Calendar &amp; Scheduling, version 1.0.0. 77 lines.

- Page: https://pluginprobe.com/plugins/timetics/1.0.0/code/core/settings/settings.php
- Raw: https://pluginprobe.com/plugins/timetics/1.0.0/raw/core/settings/settings.php
- Modified: 2023-01-30T14:51:10+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/timetics/1.0.0/code/core/settings/settings.php#L10-L20`.

```php
<?php
/**
 * Global settings for timetics
 *
 * @package Timetics
 */

// Exit if accessed directly
defined( 'ABSPATH' ) || exit;

if ( ! function_exists( 'timetics_get_option' ) ) {
    /**
     * Get option for timetics
     *
     * @since 1.0.0
     * @return  mixed
     */
    function timetics_get_option( $key = '', $default = false ) {
        $options = get_option( 'timetics_settings' );
         $value = $default;

        if ( isset( $options[ $key ] ) ) {
            $value = ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
        }

        return $value;
    }
}

if ( ! function_exists( 'timetics_update_option' ) ) {

    /**
     * Update option
     *
     * @param   string  $key
     *
     * @since 1.0.0
     *
     * @return  boolean
     */
    function timetics_update_option( $key = '', $value = false ) {
        if ( ! $key ) {
            return false;
        }

        // Get the current settings.
        $options = get_option( 'timetics_settings', [] );

        // Set new settings value.
        $options[ $key ] = $value;

        // Update the settings.
        $did_update = update_option( 'timetics_settings', $options );

        return $did_update;
    }
}

if ( ! function_exists( 'timetics_get_settings' ) ) {

    /**
     * Get settings
     *
     * Retrieve all plugin settings
     *
     * @since 1.0.0
     *
     * @return  array Timetics Settings
     */
    function timetics_get_settings() {
        // Get the option key.
        $settings = get_option( 'timetics_settings' );

        return apply_filters( 'timetics_get_settings', $settings );
    }
}

```
