PluginProbe
Timetics – Appointment Booking Calendar & Scheduling / 1.0.0
Timetics – Appointment Booking Calendar & Scheduling v1.0.0
1.0.61 1.0.60 1.0.59 1.0.58 1.0.57 1.0.56 trunk 1.0.0 1.0.1 1.0.10 1.0.11 1.0.12 1.0.13 1.0.14 1.0.15 1.0.16 1.0.17 1.0.18 1.0.19 1.0.2 1.0.20 1.0.21 1.0.22 1.0.23 1.0.24 All 62 releases
timetics / core / settings / settings.php

settings.php in Timetics – Appointment Booking Calendar & Scheduling 1.0.0, at core/settings/settings.php

77 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 * Global settings for timetics
4 *
5 * @package Timetics
6 */
7
8 // Exit if accessed directly
9 defined( 'ABSPATH' ) || exit;
10
11 if ( ! function_exists( 'timetics_get_option' ) ) {
12 /**
13 * Get option for timetics
14 *
15 * @since 1.0.0
16 * @return mixed
17 */
18 function timetics_get_option( $key = '', $default = false ) {
19 $options = get_option( 'timetics_settings' );
20 $value = $default;
21
22 if ( isset( $options[ $key ] ) ) {
23 $value = ! empty( $options[ $key ] ) ? $options[ $key ] : $default;
24 }
25
26 return $value;
27 }
28 }
29
30 if ( ! function_exists( 'timetics_update_option' ) ) {
31
32 /**
33 * Update option
34 *
35 * @param string $key
36 *
37 * @since 1.0.0
38 *
39 * @return boolean
40 */
41 function timetics_update_option( $key = '', $value = false ) {
42 if ( ! $key ) {
43 return false;
44 }
45
46 // Get the current settings.
47 $options = get_option( 'timetics_settings', [] );
48
49 // Set new settings value.
50 $options[ $key ] = $value;
51
52 // Update the settings.
53 $did_update = update_option( 'timetics_settings', $options );
54
55 return $did_update;
56 }
57 }
58
59 if ( ! function_exists( 'timetics_get_settings' ) ) {
60
61 /**
62 * Get settings
63 *
64 * Retrieve all plugin settings
65 *
66 * @since 1.0.0
67 *
68 * @return array Timetics Settings
69 */
70 function timetics_get_settings() {
71 // Get the option key.
72 $settings = get_option( 'timetics_settings' );
73
74 return apply_filters( 'timetics_get_settings', $settings );
75 }
76 }
77