PluginProbe
Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager / 0.0.3
Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager v0.0.3
0.0.11 0.0.10 0.0.9 0.0.8 0.0.7 0.0.6 trunk 0.0.1 0.0.2 0.0.3 0.0.4 0.0.5
cookiez / modules / settings / classes / settings.php

settings.php in Cookie Consent – GDPR & CCPA Cookie Banner & Consent Manager 0.0.3, at modules/settings/classes/settings.php

45 lines 1.2 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 namespace Cookiez\Modules\Settings\Classes;
4
5 if ( ! defined( 'ABSPATH' ) ) {
6 exit; // Exit if accessed directly.
7 }
8
9 class Settings {
10 public const COOKIEZ_SETTINGS = 'cookiez_settings';
11 public const COOKIEZ_CONTENT = 'cookiez_content';
12 public const IS_VALID_PLAN_DATA = 'cookiez_is_valid_plan_data';
13 public const PLAN_DATA = 'cookiez_plan_data';
14 public const PLAN_SCOPE = 'cookiez_plan_scope';
15 public const PLAN_DATA_REFRESH_TRANSIENT = 'cookiez_plan_data_refresh';
16 public const SUBSCRIPTION_ID = 'cookiez_subscription_id';
17 public const CLIENT_ID = 'cookiez_client_id';
18 public const REVIEW_DATA = 'cookiez_review_data';
19
20 /**
21 * Returns plugin settings data by option name typecasted to an appropriate data type.
22 *
23 * @param string $option_name
24 *
25 * @return mixed
26 */
27 public static function get( string $option_name ) {
28 $data = get_option( $option_name, [] );
29
30 return is_array( $data ) ? $data : [];
31 }
32
33 /**
34 * Update the settings data by option name.
35 *
36 * @param string $option_name
37 * @param $value
38 *
39 * @return bool
40 */
41 public static function set( string $option_name, $value ): bool {
42 return update_option( $option_name, $value, false );
43 }
44 }
45